BlackBot icon indicating copy to clipboard operation
BlackBot copied to clipboard

Price is pulled with moved decimal by two digits

Open kastmada opened this issue 3 years ago • 10 comments

@jansenmarc @PyWaves image the price has been pulled as 1750.39 instead 17.5039

same issue on all pairs. Are the last commits from March 2019 correct?

setting the manual price in the bot.cfg file doesn't solve the problem, since every time order is filled, bot reads the wrong sell price with moved decimal.

Is there a change to discuss it with anyone here?

kastmada avatar Dec 10 '21 14:12 kastmada

Yep, price calculation depends on the version of transactions.

You can try to change all lines:

10 ** (PAIR.asset2.decimals + (PAIR.asset2.decimals - PAIR.asset1.decimals)

into

10 ** 8

since PyWaves is currently using Version 3 of exchange transactions.

If that is successful, please provide a pull request.

jansenmarc avatar Dec 10 '21 14:12 jansenmarc

it works now by replacing:

10 ** (PAIR.asset2.decimals + (PAIR.asset2.decimals - PAIR.asset1.decimals)

with:

10 ** 6

After changing it to 10 ** 8 decimal got moved two digits too far (0.175039).

kastmada avatar Dec 10 '21 16:12 kastmada

After some testing it turns out, that 10 ** 8 works for some pairs and 10 ** 6 works for other pairs. I'm not familiar with Python so I won't be able to fix the code, unfortunately.

kastmada avatar Dec 13 '21 06:12 kastmada

Can you please check which verson of PyWaves you are using? If it is not the latest version, please upgrade accordingly. Since version 3 is used for orders, 8 should be working properly.

jansenmarc avatar Dec 13 '21 10:12 jansenmarc

How to check this? For the WAVES/USDN pair I had to use 10**6.

kinbitz avatar Dec 14 '21 16:12 kinbitz

Show me the output of:

pip list | grep PyWaves

please.

jansenmarc avatar Dec 14 '21 17:12 jansenmarc

PyWaves 0.8.41

How to get the latest version? I am using pip install pywaves. I have python3.

kinbitz avatar Dec 15 '21 09:12 kinbitz

I checked in the Waves developers group and this is in fact the latest version of PyWaves.

kinbitz avatar Dec 21 '21 10:12 kinbitz

Again, did you check if the following formula works:

10^(8 + priceAssetDecimals - amountAssetDecimals)

jansenmarc avatar Dec 21 '21 12:12 jansenmarc

This formula works, but I tested only on the WAVES/USDN pair.

kinbitz avatar Dec 22 '21 14:12 kinbitz