Skip to content

Commit 94c3526

Browse files
committed
docs: _
1 parent 4875267 commit 94c3526

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

docs/ARCHITECTURE.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@ flowchart TD
1313
### `v_exchanges_api_generics`
1414
Provides a standardized interface for defining how an exchange wants to be communicated with.
1515

16-
### `v_exchanges_core`
17-
Defines `Exchange` trait and associated structs. If some interactions/methods can be generalized _on top of_ the specified standard objects, they can also be exposed here (under a feature flag probably).
18-
19-
2016
### `v_exchanges`
21-
Implementation of each exchange's interactions, consists of blocks for
2217

23-
- `Settings` struct that persists keys, session tokens, etc
24-
- enum with all API endpoints
25-
- `binance-rs`-like function call for all the ones I care about. They return predefined Response structs
26-
- impl of `Exchange` trait
27-
so say `binance` would have a `struct Binance(BinanceSettings)`, where all the `Exchange` functions first call native method on `BinanceSettings`, then just apply translation
18+
#### `::core`
19+
Defines `Exchange` trait and associated structs. If some interactions/methods can be generalized _on top of_ the specified standard objects, they can also be exposed here (under a feature flag probably).
2820

29-
#### models
30-
any models shared across different markets (futures, spot, margin, etc), are defined in well a shared `models/` directory at the root of associated exchange's directory. Say if `KlinesResponse` matches for
31-
`/binance/futures/market.rs` and `/binance/spot/market.rs`, the model is defined and exported from `/binance/models/market.rs`
21+
#### other
22+
Split into sections for each implemented exchange.
23+
In each we make the calls and deserialize the responses from the endpoints we care about, following `Exchange` trait specialization. They are then immediately translated into a general form, which is the same across all exchanges (even if at the cost of some data).
3224

25+
Some functions on specific exchange+endpoint pairs, on `Exchange` trait or not, could build upon other calls (eg stitching together a longer `/aggrTrade` response than what's allowed). When doing so, we still use general forms of return from each established endpoint interaction.
3326

34-
#### data endpoints
27+
### data endpoints
3528
Some exchanges provide specialized `data` endpoints. Those can't be part of `Exchange` trait, but then I just trivially expose them natively on the associated structs of each exchange, without any traits whatsoever.

0 commit comments

Comments
 (0)