tsarbuig / LimitSwap

LimitSwap is fully functional DeFi Trading Bot. No fees. You just need to hold LIMIT Utility token in your wallet to use.
https://www.limitswap.com/
17 stars 30 forks source link

Create a token cache so LimitSwap can be restarted if needed and resume checking prices after restart #105

Open wibuf opened 2 years ago

wibuf commented 2 years ago

I would like to be able to test some settings around, however LimitSwap is not able to resume checking prices for held tokens upon a restart. I believe setting up a token cache file, that updates during buys and sells, and read into LimitSwap on startup could alleviate this issue.

wibuf commented 2 years ago

I believe all that would be needed to be stored would be token address(for lookup), token name, bought amount(so it knows what is has to sell), and the ATH price(so bot can calculate the trailing stop)

Basically, the bot should add to this cache during any buys, and remove from the cache any sells. Also, upon launch the bot should read each token into memory and do a check to get current prices for each and sell if any stoplosses are hit, or continue to monitor prices until a sell gets triggered.