Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot convert 'Transaction' object to bytes #1

Open
creosmart opened this issue Oct 21, 2024 · 9 comments
Open

cannot convert 'Transaction' object to bytes #1

creosmart opened this issue Oct 21, 2024 · 9 comments
Assignees

Comments

@creosmart
Copy link

Hello, seems there's an error when running trade.py:

"Attempt 1 to create associated token account failed: cannot convert 'Transaction' object to bytes"

Thanks

@akegaviar
Copy link
Contributor

That's most likely due to the mismatch between the data you received from blockSubscribe and the chain data. What this means ultimately is you need to increase the cooldown period to allow the chain data to catch up from the moment you receive it over blockSubscribe and have the actual chain data. See the relevant issue anza-xyz/agave#3074

@AidHamza
Copy link

As @akegaviar mentioned, sleep is a workaround, for my case, I kind of decoupled the logic, and separated the buy event, instead of waiting, you can rerun with retries till the expected result is satisfied. It had a great impact on the bot results

@creosmart
Copy link
Author

@akegaviar I increased the cooldown to 120 await asyncio.sleep(120) but still getting the same error, any suggestions? @AidHamza I was hoping to be one of the first buyers of the token, can this be achieved with the logic you mentioned?

@akegaviar
Copy link
Contributor

@creosmart I suggest you add logging to see at what the stage the issue is.

@nickatnight
Copy link

nickatnight commented Oct 24, 2024

@creosmart I encountered this same issue. I fixed it by using solana version 0.34.0 instead of 0.35.0

@akegaviar
Copy link
Contributor

Thanks for the help @nickatnight . I should have included requirements.txt right from the start but missed that and only added it yesterday.

@creosmart
Copy link
Author

Thanks a lot @nickatnight, as a beginner I couldn't figure it out and it was doing my head in 😁

@Avinaash7
Copy link

@creosmart I encountered this same issue. I fixed it by using solana version 0.34.0 instead of 0.35.0

Facing the same issue even in version 0.34.0

@teletonn
Copy link

There should be solana==0.34.3 in requirements.txt, or it will install 35 version thats not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants