noahtheprogrammer / soltrade

Python trading bot using the Solana blockchain.
https://discord.gg/WDS9Ya8KvX
GNU General Public License v3.0
185 stars 71 forks source link

Intermittent - receive successful TxnID - no update to wallet and can't find in SolScan #3

Closed pgrubaugh closed 7 months ago

pgrubaugh commented 9 months ago

I am seeing intermittent success for the transactions. 100% receive a successful TxnID, but around 50% do not end up occurring, and the TxnID is not findable on SolScan. It does not seem to be based on Slippage because I have received a successful TxnID, wallet did not update, but I could at least find the TxnID on Solscan and it says the slippage was exceeded. Was hoping I could increase the slippage to address (I had initially lowered from the 50 in the codebase), but that does not seem to be what is causing. Happening on both v4 and v6 of the Jupiter API. If it is truly intermittent, would wonder if there is away to confirm TxnID was actually successful and then if not immediately retry.

pgrubaugh commented 9 months ago

Thanks for the codebase! It has been fun to play around with.

369Martin369 commented 8 months ago

very cool. you are a hell of programer!! I'm now porting my strategy here (https://github.com/369Martin369/Binance_robo-trading) to solana chain using your code base. wish me luck :-)

noahtheprogrammer commented 8 months ago

Thank you for your feedback! Based on what I've found from recreating separate test cases in another project, it appears to be an intermittent issue on Jupiter's end. However, by increasing the max_retries to a greater number, Soltrade might be able to circumvent this problem and successfully complete previously failed transactions.

noahtheprogrammer commented 8 months ago

Based on some other research, it does appear that Jupiter runs into liquidity issues quite often. This might be possible to circumvent by implementing an algorithm that automatically re-executes performSwap() with the same parameters if it is found to fail, but I'm not certain on this.

wafwoof commented 8 months ago

Hey I just setup soltrade bot with an account but it does nothing after initializing the trading algorithm. Wallet I gave it on solscan shows no new transactions. Thoughts?

wafwoof commented 8 months ago

my output:

2024-Jan-07 01:47:28: Soltrade has detected 35.0 $USDC tokens available for trading.
2024-Jan-07 01:47:28: Soltrade has successfully imported the API requirements.
2024-Jan-07 01:47:28: Soltrade has now initialized the trading algorithm.
2024-Jan-07 01:47:28: Available commands are /statistics, /pause, /resume, and /quit.
2024-Jan-07 07:47:30: Soltrade was unable to take a market position.
2024-Jan-07 07:47:30: SoltradeException: 'swapTransaction'

any help with this would be appreciated.

noahtheprogrammer commented 8 months ago

Many of these issues might be that Soltrade is still using Jupiter's V4 API, as opposed to their newest V6. I will fix this shortly.

wafwoof commented 8 months ago

Many of these issues might be that Soltrade is still using Jupiter's V4 API, as opposed to their newest V6. I will fix this shortly.

Thanks for the speedy reply, and great work so far! Would I just have to update the http requests to go to the /v6 instead of /v4 ? Maybe I can fix it myself in the meantime.

noahtheprogrammer commented 8 months ago

@wafwoof Thank you! Yes, I believe that would be all you would have to do. It does look like they've added some other features to combat this issue was well, which is pretty neat. Here are Jupiter's docs on the subject if needed.

wafwoof commented 8 months ago

@noahtheprogrammer Tried the simple workaround, so far the bot has not done anything for a day now. I'll keep running it and check later, also gonna add some more print()s around the place to get a better idea of what its doing.

noahtheprogrammer commented 7 months ago

This should be fixed by the handled rate-limiting implementing in the pull request above. Closing this issue (hopefully forever).