Skip to content

V1 - Swap quote mismatch #36

@kasia-antos

Description

@kasia-antos

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.

from tinyman.v1.client import TinymanTestnetClient

client = TinymanTestnetClient(algod_client)

asset1 = client.fetch_asset(92772865)
asset2 = client.fetch_asset(0)
amount = 80
asset_in = asset1

pool = client.fetch_pool(asset1, asset2)
quote = pool.fetch_fixed_input_swap_quote(asset_in(amount * 10 ** asset_in.decimals), slippage=0.05)

I get the following quote for ALGO out amount and min out amount

image

while in the Tinyman app I get

image

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

image

image

image

Looks like the bug is on the app side not SDK but maybe you can double check it and confirm?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestwontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions