lapismyt / ston-fi.py

GNU General Public License v3.0
22 stars 7 forks source link

Wrong swap sums for jettons with not 9 decimals. #2

Closed lapismyt closed 6 months ago

lapismyt commented 7 months ago

Swapping jUSDT to [anything]. offer_amount = 0.01, sending 10 jUSDT.

Possible solution: Check "decimals" field in jetton metadata before swapping.

BonifacioCalindoro commented 7 months ago

That should be the solution, you have to add as much zeroes as decimals, so the builder functions in your code should take the big integers as amount_in, instead of taking the float and converting it to_nano (9 decimals)

lapismyt commented 6 months ago

Solved