-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflowchart
More file actions
45 lines (36 loc) · 1.45 KB
/
flowchart
File metadata and controls
45 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Universe = Vec<Symbol>
1. Get Universe from config (public stream)
2. Get Trading symbols (need private + public stream)
3. Book will be modified by ApiManager
4. Book will be viewed by Strategy/AlphaProvider
ApiManager:
1. Determine what websocket listeners to init according to Universe
2. For different websocket stream:
1. Public data
- Maintain the newest orderbook in Universe-Symbol-book
- Feed add/delete/trade to CC, and let CC send to alpha provider/Strategy.
2. Private data
- Send standadized update messages to order manager.
Order manager:
1. Send requests to CC, CC -> api manager, api manager sends responses to order manager
2. api manager: private data to CC, CC -> order manager
3. Orders: aggressive or passive
Alpha provider:
1. Listen to add/delete/trade from CC
2. Calculate the alphas
3. Provide alpha to Strategy
Strategy:
1. Has read access to order manager/alpha provider/Universe, know the status of every orders
2. Only react to packet-end
3. Decide when to send/cancel/modify orders, and PostOnly/IoC order type, order size and price.
4. For different order state, decide how to handle them.
CC:
ALL
init order:
TODO:
WebsocketClient: hang central_controler to callback
SOP:
When finished developing a new exchange public data, please add to src/apis/apimanager.rs
1. WebsocketClient::EXCHANGE(EXCHANGE_CLIENT)
2. source name to new client
3. start event loop to websocket_message_consumer (can't implement a trait for these shits.)