bmino / binance-triangle-arbitrage

Detect in-market cryptocurrency arbitrage
MIT License
1.08k stars 340 forks source link

Age Threshold #75

Closed kuuulwin closed 5 years ago

kuuulwin commented 5 years ago

Hello. How come the age of each leg is almost the same or ends up similar to each other, even in execution logs. Are the prices for each tick change at the same time or is there something else at play?

Screen Shot 2019-07-26 at 21 31 23
bmino commented 5 years ago

The age of an individual ticker, as I think you are asking here, is the number of milliseconds since a depth websocket has reported information on that particular ticker. Websocket connections are opened in intervals (configured via INITIALIZATION_INTERVAL). This means that some websockets will be initialized in such a way that they report at the same time:

Websockets are supposed to report every second so if I opened a websocket for some ticker at t=0ms, then again at t=500ms, then again at t=1000ms, I would expect the first and third websocket to be reporting data at approximately the same time every second.

bazan101 commented 5 years ago

hum, ok I understand why the startup time is so slow. THX for the good work.

bmino commented 5 years ago

@kuuulwin I'll leave this open for you to continue discussion or close it