You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+7-14Lines changed: 7 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,23 +13,16 @@ flowchart TD
13
13
### `v_exchanges_api_generics`
14
14
Provides a standardized interface for defining how an exchange wants to be communicated with.
15
15
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
-
20
16
### `v_exchanges`
21
-
Implementation of each exchange's interactions, consists of blocks for
22
17
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).
28
20
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).
32
24
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.
33
26
34
-
####data endpoints
27
+
### data endpoints
35
28
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