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.37k stars 823 forks source link

Bot stops trading after some time with AK-47 #473

Closed ghost closed 6 years ago

ghost commented 6 years ago

Using 10 bullets and hamelinRat, Usually It completes 1 sets of buy and sell trades and then it stops. (Bot Locks up essentially and needs to be restarted)

ctubio commented 6 years ago

consider using less bullets meanwhile you still have issues with the amount of it

rsampaio commented 6 years ago

I can confirm that anything greater than 2 bullets causes the same lockup behavior, CPU usage goes to 100% and a restart is required, happened with Top and hamelinRat, unlocked version FWIW.

ctubio commented 6 years ago

thanks for the infos'' let me try to improve ak47, but i dont think we can go greater than 10; lets try to allow 10 as a maximum (and set a proper limit in place to avoid users go greater)

can i ask in what exchange are you using ak47?

rsampaio commented 6 years ago

Sounds great! The exchange I'm using is bitfinex.

Thanks for looking into this!

ctubio commented 6 years ago
#0  0x00005555559f1c47 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*) [clone .localalias.3] ()
#1  0x00005555556f9040 in std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, K::mOrder> >::operator++ (
    this=<synthetic pointer>) at /usr/include/c++/6/bits/stl_tree.h:209
#2  K::QE::updateQuote (this=0x7fffffffd820, q=..., side=K::mSide::Bid, isPong=<optimized out>) at src/server/qe.h:491
#3  0x00005555556f96c5 in K::QE::sendQuoteToAPI (this=0x7fffffffd820) at src/server/qe.h:102
#4  K::QE::calcQuote (this=0x7fffffffd820) at src/server/qe.h:91
#5  0x00005555556f98e8 in K::QE::waitData()::{lambda()#4}::operator()() const (__closure=0x7fffffffd540) at src/server/qe.h:58
blackivory commented 6 years ago

just wonder if the rate limit for Bitfinex is per API key or per account ? i cannot seems to get the AK47 working on Bitfinex ( e.g stopped after working for few minutes just like the case here , have no issues in running pingpong or boomerang )

if we have the rate limit here (e.g 90 request per 60s ) , whats the solutioni here you guys were using ? or just slowing it down ? n if its the per API key , so i have to more btc each key to unlock the bot here for each new currency pairs i want to add ?

ctubio commented 6 years ago

here is the official info https://www.bitfinex.com/posts/188 (note in bitfinex we use REST API only onboot to read the ticker and if cxl is enabled; all other data/functions are over websockets on bitfinex)

placing multiple K instances on different machines with different IPs/api keys helps to avoid rate limits; i never had issues with a single machine since we moved wallet data to websocket