ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.38k stars 826 forks source link

OKEx Full orderbook load and latency increasing #531

Closed serzhiio closed 6 years ago

serzhiio commented 6 years ago

Guys, after we started to load full orderbook into K my latency dramatically increased. After i fallback to one of the previous commit everything comes to normal state.

serzhiio commented 6 years ago

Could we have setting inside *.sh file how many levels of orderbook to load?

ctubio commented 6 years ago

yea that was in the plan; just that im slow (and that doesnt feels necesary here)

btw on what exchange do you mean? gdax works super nice here

CarlitoGrey commented 6 years ago

Hey Carles,

I think this is the same thing I mentioned yesterday. I managed to get the super high latency (1s+) to stop by using a ramdisk but I still notice a spike.

ctubio commented 6 years ago

buuut your issue was because of too much frequent writes to the disk, no?

CarlitoGrey commented 6 years ago

That's what I thought it was, and it resolved the issue a bit when I used a ramdisk, but the first time I noticed the high latency was when I update to the latest commit.

ctubio commented 6 years ago

ok well, im not feeling any side bad effect because of the increase of market levels; but will investigate this or any other possible cause of latency in orders.

note orders has nothing to do with market data; and the bandwidth of market data was not increased in latest commit, market data was just stored for longer (and the app is still under the 16Mb)

also please consider to add to your comment what exchange is the affected one for you (at least 1 even if all :P)

serzhiio commented 6 years ago

I noticed such latency at HitBTC. Okex is not affected because of limited by 20 orderbook. But i think for all exchagen we should have an ability to choose loaded depth, i say i dont need big depth for my strategy 3-5 is good, speed is a king.

4 янв. 2018 г. 2:11 пользователь "CarlitoGrey" notifications@github.com написал:

That's what I thought it was, and it resolved the issue a bit when I used a ramdisk, but the first time I noticed the high latency was when I update to the latest commit.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/531#issuecomment-355154287, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9ytxy_xcMoV7LcRCzsN703SSDYi_6Yks5tHAk2gaJpZM4RSQjU .

serzhiio commented 6 years ago

Does it affect on okex channel subsctiption?

4 янв. 2018 г. 5:17 пользователь "Carles Tubio" notifications@github.com написал:

Closed #531 https://github.com/ctubio/Krypto-trading-bot/issues/531 via 0d57491 https://github.com/ctubio/Krypto-trading-bot/commit/0d57491b264a68166b2d1cc0ddc2ce87568a863f .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/531#event-1408855775, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9ytwdlDlE5ww4A89mYb2q9y84moxA4ks5tHDSrgaJpZM4RSQjU .

ctubio commented 6 years ago

not much because okex have the most stupid api interface with a hardcoded integer in the function names

at https://www.okex.com/ws_api.html it says that only possible value of Y is: 5, 10, 20(Amount)

serzhiio commented 6 years ago

If I set up 5? will it be subscribed to 5depth channel?

P.S.: Do we manage binary data from Okex? 2018-01-04 12:53 GMT+03:00 Carles Tubio notifications@github.com:

not much because okex have the most stupid api interface with a hardcoded integer in the function names

at https://www.okex.com/ws_api.html it says that only possible value of Y is: 5, 10, 20(Amount)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/531#issuecomment-355241229, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9yt2fCYElWXhf_8ay5erwSjTVtFtfyks5tHJ-CgaJpZM4RSQjU .

-- С Уважением, Матыцин Сергей Леонидович sergey.matytsin@gmail.com

ctubio commented 6 years ago

as of today it will subscribe to depth_20 always

that is because K minimum depth is 15, so we cannot make use of 10 or 5 as of today

but you would like to see only 5 market levels for example in okex? (im not sure the UI how ugly will look, but is possible sure if required [and the UI cannot be more ugly xD])

serzhiio commented 6 years ago

Yes i would like to try.

2018-01-04 15:29 GMT+03:00 Carles Tubio notifications@github.com:

as of today it will subscribe to depth_20 always

that is because K minimum depth is 15, so we cannot make use of 10 or 5 as of today

do you would like to see only 5 market levels for example in okex?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/531#issuecomment-355270521, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9yt8fboXIZ2zHKDF6O8rEfb6fS1PNnks5tHMQYgaJpZM4RSQjU .

-- С Уважением, Матыцин Сергей Леонидович sergey.matytsin@gmail.com

serzhiio commented 6 years ago

Carles, just to remember:

  1. [DONE] Binary mode (if we get orderbook gzipped latency will decrease i think)
  2. [DONE] Limited depth to choose (tech team adviced to use 10depth orderbook) All this things can help to solve Okex problems. Thx in advance.
serzhiio commented 6 years ago

Wow, thx for speed!