You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @kasia-antos , I have double-checked it and I confirm this case; thank you for reporting it.
The reason is rounding error. The smart contract only supports integers, and division results are rounded down to an integer (Ex. 10/4=2). SDKs should follow the same arithmetic to be able to get the exact result.
We will be checking the possible improvements. The JS SDK uses big interger and results are converted to int directly, but Python SDK converts the float results to the integer at the end.
The result calculated on the web app should be closer to the actual result. We need to double-check this part.
The effect will be less for the assets with decimal places. In this case, PAGO has no decimal places so the input amount is 80 micro unit, rounding error is more visible. For ALGO, which has 6 decimals, 80 Algo is 80.000.000 micro-unit. So, I assume fixing this is important but not urgent.
Hi 👋
I'm trying to get fixed input swap quote and I noticed it's not correct for some pools. In below example
PAGO/ALGO
pool on the testnet.I get the following quote for ALGO out amount and min out amount
while in the Tinyman app I get
which is almost the same but still slightly different.
When I make the transaction from the app the value I receive is matching the minimum value from the app but it seems like the total value (min + excess) is matching the value calculated by the SDK https://testnet.algoexplorer.io/tx/group/MEYPju6fy6LvBzph49xU%2BmvYyj3bpdf4A0FlmYTykU0%3D
Looks like the bug is on the app side not SDK but maybe you can double check it and confirm?
The text was updated successfully, but these errors were encountered: