Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Infinite loop when encounters a trade that is different from base/quote asset #770

Open
ddombrowsky opened this issue Sep 30, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ddombrowsky
Copy link

There is an infinite loop when the bot encounters a trade from a different pair on the account. This happens to me often since I switch between bots on the same stellar account (not running them simultaneously).

I would expect it to just ignore the trade and move on.

Frequency: this happens every time I switch from one pair to another.

2022/09/30 16:39:04 encountered a trade (ID=184281168177836033-0) that is different from the base and quote asset (:/WFTM:GAEDZ7BHMDYEMU6IJT3CTTGDUSLZWS5CQWZHGP4XUOIDG5ISH3AFAEK2) on the bot or uses a different trading account, botTraderAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77 (tradeBaseAccount=GAITTRFFPHN76ETLGET52ZXZJRELJ56B32X46OOGLG3SIC5RBC5BYT4E, tradeCounterAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77)
2022/09/30 16:39:04 continuing to fetch trades from the new updated cursor (184281142407536641-1) because we did not hit a stoppping condition, (numFetchedTrades = 0, total len(trades) = 0, sdexTradesFetchLimit = 200; hitCursorEnd=false, hitRateLimit=false)
2022/09/30 16:39:04 returned from fetch trades API call for SDEX using cursor '184281142407536641-1' (len(records) = 1, error = <nil>)
2022/09/30 16:39:04 encountered a trade (ID=184281168177836033-0) that is different from the base and quote asset (:/WFTM:GAEDZ7BHMDYEMU6IJT3CTTGDUSLZWS5CQWZHGP4XUOIDG5ISH3AFAEK2) on the bot or uses a different trading account, botTraderAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77 (tradeBaseAccount=GAITTRFFPHN76ETLGET52ZXZJRELJ56B32X46OOGLG3SIC5RBC5BYT4E, tradeCounterAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77)
2022/09/30 16:39:04 continuing to fetch trades from the new updated cursor (184281142407536641-1) because we did not hit a stoppping condition, (numFetchedTrades = 0, total len(trades) = 0, sdexTradesFetchLimit = 200; hitCursorEnd=false, hitRateLimit=false)
2022/09/30 16:39:04 returned from fetch trades API call for SDEX using cursor '184281142407536641-1' (len(records) = 1, error = <nil>)
.... and so on, forever ...

It makes the bot unusable until it finally encounters a trade that it expects.

The configuration is using the balanced strategy.

@ddombrowsky ddombrowsky added the bug Something isn't working label Sep 30, 2022
@scoobie-bot
Copy link

Having the same issue (when manually claiming / burning dust).
Leave it run for 5 mins, then restart - seems to be long enough to work it's way through the unexpected transactions.

@scoobie-bot
Copy link

Did you make any progress solving this?

Surely there must be a way of 'resetting' a strategy to use different pairs

@ddombrowsky
Copy link
Author

@scoobie-bot

I haven't dug into the source yet. Looks like this project is all but abandoned, unfortunately.

@scoobie-bot
Copy link

Yes, spoke with the dev recently and it is.

Solved our issue though.
In trader.cfg you can change the FILL_TRACKER_LAST_TRADE_CURSOR_OVERRIDE
(This is where(when?) kelp starts to search for transactions)
You can get the latest cursor number from
https://stellar.expert/explorer/public/asset/XLM
Put that in the FILL_TRACKER and restart - you'll be good to go

@smserwan
Copy link

i fill empty FILL_TRACKER_LAST_TRADE_CURSOR_OVERRIDE = ""

Yes, spoke with the dev recently and it is.

Solved our issue though. In trader.cfg you can change the FILL_TRACKER_LAST_TRADE_CURSOR_OVERRIDE (This is where(when?) kelp starts to search for transactions) You can get the latest cursor number from https://stellar.expert/explorer/public/asset/XLM Put that in the FILL_TRACKER and restart - you'll be good to go

i put an empty value and it's working fine, kelp updating last cursor every few minutes
FILL_TRACKER_LAST_TRADE_CURSOR_OVERRIDE = ""

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants