Skip to content

Commit 588497f

Browse files
committed
updates README
1 parent 0c70b6c commit 588497f

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

README.md

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# High level
44

5-
Builds a live orderbook from http snapshots from N configurable exchanges and updates it through
6-
websocket depth updates. After a update the best ten asks and bids aswell as well as the spread
7-
are provided through a grpc server endpoint
5+
Builds a live orderbook from http snapshots from N configurable exchanges and then updates the orderbook
6+
through soft real time websocket depth updates. After a update the best ten asks and bids aswell as well
7+
as the spread are provided through a grpc server endpoint
88

99
# Lower level
1010

@@ -13,18 +13,24 @@ pinned threads.
1313

1414
Orderbook is ran with multiplie threads. One for writing to the book the others for reading it.
1515

16+
## Orderbook structure
17+
18+
// todo -- update my reasoning here ... on why i didn't just use a simple red black tree
19+
or the previous [initial linked list idea](https://github.com/githubsands/liquidity-engine/pull/10)
20+
1621
# Configuration
1722

1823
Exchange boots through a config by running `./orderbook-quoter-server --config=$(CONFIG_LOCATION)`. The
1924
amount of exchanges in the exchange array must be equal to the orderbook's `exchange_count`. Every
2025
`depth` field must be equal in the exchanges and orderbook's depth field should cover the entire
21-
expected trading range for the lifetime of this service. The larger expected volatility the higher the orderbook's
22-
depth needs to be.
26+
expected trading range for the lifetime of this service.
27+
28+
The larger expected volatility the higher the orderbook's depth needs to be.
2329

2430
```
2531
exchanges:
2632
- client_name: "binance_usa_1"
27-
exchange_name: 1
33+
exchange_name: 0
2834
snapshot_enabled: true
2935
http_client: true
3036
snapshot_uri: "http://localhost:5000"
@@ -34,7 +40,7 @@ exchanges:
3440
depth: 5000
3541
buffer_size: 6000
3642
- client_name: "binance_usa_2"
37-
exchange_name: 2
43+
exchange_name: 1
3844
snapshot_enabled: true
3945
http_client: true
4046
snapshot_uri: "http://localhost:6000"
@@ -71,30 +77,30 @@ Files changed by the build script are:
7177

7278
## Components
7379

74-
### ExchangeStream
80+
### 1. ExchangeStream
7581

7682
Runs both http snapshot streams and websocket streams. Can handle retriggering the http snapshot stream
7783
but it currently is not implemented in the Orderbook/DepthDriver.
7884

7985
Future work: Ideally these streams are done purely on the stack but this must be verified. Correct
8086
sequencing of orderbook snapshots and depth updates through their timestamps
8187

82-
### Exchange
88+
### 2. Exchange
8389

8490
Wrapper around exchange stream to handle websocket sinks and other functionality
8591

86-
### DepthDriver
92+
### 3. DepthDriver
8793

88-
Provides a controlling interface to all exchange streams.
94+
Provides a controlling interface to all exchange streams that push depths.
8995

90-
Future work:
96+
#### Future work:
9197

9298
(1) Needs to handle orderbook reset and orderbook snapshot
9399
retriggering with correct sequencing (https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md#how-to-manage-a-local-order-book-correctly)
94100

95101
(2) Exchange Stream websocket failure states.
96102

97-
### Orderbook
103+
### 4. Orderbook
98104

99105
Handles orderbook writing and reading.
100106

@@ -104,7 +110,15 @@ Has 2 states:
104110

105111
(2) Updating the the orderbook with ws depths and then reading the orderbook for best deals
106112

107-
Future work:
113+
### 5. Quote GRPC Server
114+
115+
Takes the spread and provides the best ten deals and asks to a grpc client
116+
117+
#### Future work:
118+
119+
TBD
120+
121+
#### Future work:
108122

109123
(1) A state when the orderbook is needs rebuilding if a ExchangeStream websocket connection fails.
110124

@@ -122,24 +136,19 @@ Future work:
122136

123137
#### 1. Depth Generator
124138

125-
Generates depths in many different sequences.
139+
Generates depths in many different sequences: upward, downward through
140+
hacking a brownian motion stochastic process.
126141

127-
Future Work:
142+
##### Future Work:
128143

129144
Oscillating Depths rather then just upward and downward trends
130145

131146
#### 2. Exchange Stubs
132147

133-
Provides both HTTP and websocket endpoints for depths. Leverages depth generator.
148+
Provides both HTTP and websocket endpoints for depths. Leverages depth generator
149+
as a dependency.
134150

135151
#### 3. Exchange Server
136152

137-
Dockerized exchange stub for full integration testing.
138-
139-
### Quote GRPC Server
140-
141-
Takes the spread and provides the best ten deals and asks to a grpc client
142-
143-
Future work:
144-
145-
TBD
153+
Dockerized exchange stub for full integration testing. Leverages exchange stub as a
154+
dependency.

0 commit comments

Comments
 (0)