-
Notifications
You must be signed in to change notification settings - Fork 337
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
Account has insufficient balance for requested action #37
Comments
As per the keepOpen option of websockets: As per trading on a percent basis: |
Perhaps orders will not get stuck if you have some spare change in your wallet such as BTC and ETH. |
Yup, that would avoid the insufficient balance error @kuuulwin, but there is still a large window between calculation and when the final execution completes. That calculation has a lower degree of accuracy as time passes |
Piggy backing off your idea however If the calculation says Pros:
Cons:
|
Another idea, perform a calculation after the first or before the last trade. |
It looks like whether you want it or not you can't make a buy or a sell using the exact values as in MIN, MAX and STEP. Binance will round them up either way. So after the first or before last trade, the triangle is recalculated for the new purchase or sale price and no extra http calls as I understand. |
I like where your thought process is going! If I read your idea correctly, you are suggesting once a determined amount of A is successfully converted into some amount of B, we then do another calculation to determine how much C we should expect from that amount of B? The simpler approach would be to simply look at the exact amount of B we actually obtained. This can perhaps be done by:
|
Looks like Binance has changed their api for market orders since the last time I looked. They now provide two golden parameters called After each leg in linear execution, we can look at the amount of the previous symbol received or spent, recalculate based on current market conditions if necessary, and then convert 100% of that into the next symbol. No need for insufficient balance errors! It also allows us to convert as much of A as possible into B -> C -> A with minimal dust being generated in intermediate symbols. |
So this issue might be resolved by these parameters ? This issue still occurs in current version, might be fixed in next release ? |
I'm testing it locally, but the next release will likely include these changes! |
All right? |
The recalculation logic is looking good, but there is still the occasional "account has insufficient balance" error. We're going for 100% bug squashing here though! My other idea is to provide a config option that locks the three trade methods to BUY, SELL, SELL. This guarantees that we know the quantity of conversion in the second and third trade and can safely assume that we are even or slightly overestimating the initial investment quantity of A |
Release 5.0.0 should fix this issue. If you continue to experience this issue using the latest release and settings, please open a new issue |
Description:
This issue stems from the high latency it takes to execute three trades. The app can calculate profits in maybe 20ms, but then it takes almost 1000ms to execute the first trade and more time to execute the next two trades. By the time the first trade completes, too much time has passed and the market has shifted.
You can have market information that is 10ms old, and complete calculations in 20ms, but if it then takes 2500ms to execute the three trades, you are in a pickle :(
More Technical Description:
The bot calculates that with the current depth cache you should convert currency A into X amount of currency B and then X amount of currency B into Y amount of currency C, but by the time the first or second trade completes, that market depth cache information which the initial calculation was based on is stale so you can end up with less B or C than expected.
This error will occur when trying to perform the second or third leg of the triangle arbitrage.
Solutions:
TRADING.EXECUTION_STRATEGY
of"parallel"
The text was updated successfully, but these errors were encountered: