6 releases (3 breaking)
new 0.4.0 | Jan 18, 2025 |
---|---|
0.3.0 | Jan 16, 2025 |
0.2.1 | Jan 7, 2025 |
0.1.1 | Jan 1, 2025 |
#248 in Asynchronous
593 downloads per month
Used in rm_engine
140KB
3.5K
SLoC
v_exchanges
Trying to make a unified library for all crypto exchange interactions, instead of redefining the response structs again and again.
Installation
TODO
Usage
Example evocations of crate's methods are exposed in [./examples], with their [[example]]
references defined [./v_exchanges/Cargo.toml].
To run:
cargo run -p v_exchanges --example binance_market
Roadmap
- full binance integration
- Copy over
crypto-botters
- For binance, copy over the struct definitions from binance-rs
- distribute the current infrastructure to defined boundaries (add _adapters, keep generic-api-client for now (mb rename to _api_generics later)). Get responses with it.
- go into src/binance/ on ::, implement klines methods with defined xxxResponse structs, have it just cover the websocket and rest for klines. Print both in main.
- define core types
- improve error tracing. If the response fails to deserialize, want to know why. Look up how discretionary_engine does it. Want to print the actual response (+ utils functions to concat when too long (add later)), then the target type.
- now implement
Exchange
for them (same place for now). Call methods. - now implement
Exchange
for bybit.
- Copy over
- full bybit integration
- method to execute all known requests in test mode[^1], on
success
full responses, persist the returned json objects to use in test later.
[^1] where allowed, otherwise use min position size or just skip problematic endpoints
Relevant projects and documentations
- crypto-botters, from where I stole the entire
generic-api-client
(asv_exchanges_api_generics
). - binance-rs, which provided a cheat-sheet for so many binance interactions and best-practices on testing.
Binance main docs: https://developers.binance.com/docs Binance spot docs: https://github.com/binance/binance-spot-api-docs?tab=readme-ov-file
Conventions
Purely usage guidance, writing for myself to standardise interfacing with the library across my projects wherever possible. List acronyms / other conventions that are preferred when interfacing with the library.
Exchange names
Binance: bn
Bybit: bb
Bitflyer: bf
Coincheck: ch
This repository follows my best practices.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~21–34MB
~520K SLoC