Skip to content
New issue

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

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

Already on GitHub? # to your account

Discard outdated position.json data #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GiorgosK
Copy link

@GiorgosK GiorgosK commented Feb 23, 2025

I have encounced a situation where position.json contained

{"is_open": true, "sl": 0.6535125, "tp": 0.883125}

meanwhile there was no real position, had probably been already executed but the position.json was not properly updated. Perhaps this resulted from a forced stop (there is no graceful stop of the program is there ?)

This situation is bad as it creates an infinite loop. The program trying to find a way to sell a position of 0 amount and hence it results in an infinite loop

2025-02-23 07:31:36     Soltrade is creating exchange for 0.0 JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
2025-02-23 07:31:36     Soltrade API Link: https://quote-api.jup.ag/v6/quote?inputMint=JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=0&slippageBps=50
2025-02-23 07:31:36     Soltrade is creating transaction for the following quote: 
{'error': 'Could not find any route', 'errorCode': 'COULD_NOT_FIND_ANY_ROUTE'}

Well this MR helps realize this an reset the position.json on first encounter

@noahtheprogrammer
Copy link
Owner

I'm going to try to look over everything this week and hopefully get this pull request merged.

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

Successfully merging this pull request may close these issues.

2 participants