Total amount used by short bot incorrect

Bug info: Short calculates only up to +100% deviation from the opening price - if you put any value over +100% it won’t be calculated in the Total required by the bot.

In the bot posted below the total is 372 HBAR but it should be around 630 HBAR

  • Bot URL → Gainium app
  • [Optional] Steps to reproduce → Create a short bot to cover +400% with the DCAs - you will see the total required it calculates only up to +100% deviation
  • Expected result → In the link posted above the total required should be around 630 HBAR ($186) as also shown in the ‘Example orders for a deal’ table at the bottom of the bot

2 Likes

Hi Ross.

From what I understand, the bot has calculated correctly, assuming the required HBAR will be bought just in time when SO is required (hence the smaller required total (only 372 HBAR).
I have manually calculated in excel and its about the same.

On the other hand, yes It will need 630 HBAR if you buy all the base upfront ( $ 0.295 x 630 = $186)

So the difference here is due to when the base is bought (ie all in upfront VS when required)

Am I missing something?

Yes, you are possibly missing something. The required amount of total HBAR currently is 374. If you buy that for the start price you pay:

0.28498 * 374 = 106.58252

Theoretically than you should be enough to run the bot. It only could be that because of exchange requirements or rounding issues some steps may use a little more HBAR than precalculated and you may not be able to execute a few safety orders of the end of the list.

The total cost only shows what you got back from the initial long spot deal, since the safety orders of a “short” spot deal can be seen as take profit order of a long deal that was started with 374 HBAR worth ~$106 right before the “short” spot deal was started. (Of course, if the HBAR was there before it depends on its average price else.)

Not sure that understand the problem. Example orders of deal, last line deviation -402%, total base 374HBAR, the same as total required in DCA section.

We are ignoring DCA orders over +100%, but not -100%.

Yes you understood correctly - This was my point, the short bot calculates the total base to cover +100% (374 HBAR) and not the actual deviation +400% (630 HBAR = $184)

The actual base required to run the bot and cover +400% should be 630 HBAR equal to $184 (not 374 HBAR as shown in the total needed before running the bot). Hope it makes sense

No.

0.28498 * 374 = 106.58252

The max. total cost of the last safety order isn’t important to know how much you have to pay for your HBAR. Buy 374 HBAR and you will have enough to run the bot, if your “short” deal starts directly and the price of HBAR increases directly. If the price drops instead by e.g. 10 %, you will surely have to less HBAR. But that’s a usual issue of “short” deals

Actually, I agree with Rossano.

To simplify the needed number of coins calculation, instead of using HBAR let’s use USDC/USDT where we know the ratio is 1 and it will show the needed USD amount. As you can see in the screen capture it calculates the percentage for %2 deviation (order step) and 1.1 step scale it is calculating 113 USD which is not correct (it should be 184 like Rossano’s table above).
image

Wrong. You have to buy the required amount of USDC upfront for the price of the initial order.

The total amount of base that gets sold at maximum is 113.

If you buy those 113 USDC upfront at a price of 1, you only pay 113 * 1.

Your quote “… You have to buy the required amount of USDC upfront for the price of the initial order…” >>> I totally agree. We should buy upfront. What we are trying the tell that the screen is telling us to buy 113 $ worth of coins TOTAL whereas we will need 184 $ worth of coins.

Wrong. USDC increases in price. Therefore you don’t have to buy USDC worth

32 * 5.6

but “total base at DCA step 32” * “initial price”, that is

113 * 1.

32 dca order * 5.6$ = 179.2$ + 1 Base order => 179.2 + 5.6 = 184.8 $
What is wrong here !!!

The answer is here - topic closed :joy:

simple math - simple problem - simple answer

1 Like