stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.1k stars 263 forks source link

console command - quit and kill #603

Open antb123 opened 3 years ago

antb123 commented 3 years ago

Desired Behavior

Ability to quit and kill existing orders from the console and refresh (nice to have)

I want to ... Be able to quit and kill all outstanding orders very quickly (less than 3 seconds)

Currently control c kills the console and leaves outstanding orders on the dex from my understanding. I would like a console command to quit and kill all outstanding dex orders. This is protection from market events or a bad configuration It could be q or kk or something like this:

Second the current -- delete function leaves other pairs live on the market - (e.g. if you have several bots and configs)

Other console commands that would be nice are r - "refresh" - this would wake the sleeping state and refresh the order book.

Impact

The desired behaviour will allow me to ...

Save money if there is a market event or a fat finger error (actually a bad config file).

Alternatives

currently you can use the kelp --strategy delete command :

./kelp trade --botConf trader.cfg --strategy delete

However this takes too long and it does not kill orders that are outside of the defined pair you are trading. For example say you have 3 bots trading using the same trading account but with different source accounts. If you delete it only acts on the one pair.

If XLM is having a market event this could take too much time to react.

nikhilsaraf commented 3 years ago

this seems like a much broader "exit the market" type of command. I don't anticipate building this if we can achieve the same result with the following:

  1. https://github.com/stellar/kelp/issues/572 - which will delete offers once the bot gets the ^C signal
  2. add a script to "kill all bots" which in turn would trigger the delete all offers operations from (1) above before the bot exits cleanly.

would this work for you @antb123?