Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return incorrect information #28

Closed
0xlimon opened this issue Feb 16, 2022 · 3 comments
Closed

Return incorrect information #28

0xlimon opened this issue Feb 16, 2022 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@0xlimon
Copy link

0xlimon commented Feb 16, 2022

I get the price of a token via sdk via the example code
For example the price of goETH
But there is a problem, the price received via sdk is very different from the price inside the site (I tested it again today, the price difference was about $ 40!)

@0xlimon
Copy link
Author

0xlimon commented Feb 16, 2022

I tested it now
The information is as follows!
in site : 1 goETH = 3226 ALGO
with sdk : 1 goETH = 3123 ALGO

What is the problem?

from tinyman.v1.client import TinymanMainnetClient
account = {
    'address': 'ALGORAND_ADDRESS_HERE',
    'private_key': 'base64_private_key_here', # Use algosdk.mnemonic.to_private_key(mnemonic) if necessary
}

client = TinymanMainnetClient(user_address=account['address'])

goETH = client.fetch_asset(386195940)

ALGO = client.fetch_asset(0)

pool = client.fetch_pool(goETH, ALGO)

quote1 = pool.fetch_fixed_input_swap_quote(goETH(1 * 10 ** goETH.decimals), slippage=0.01)

print(quote1)

and returned :
SwapQuote(swap_type='fixed-input', amount_in=goETH('1'), amount_out=ALGO('3123.557726'), swap_fees=goETH('0.003'), slippage=0.01)

@fergalwalsh
Copy link
Contributor

Do you still see this issue? Could you post a screenshot if you do? When I check right now I see the exact same values.

@gokselcoban gokselcoban added the duplicate This issue or pull request already exists label Nov 16, 2022
@gokselcoban
Copy link
Contributor

Thank you for your contribution.

There is one more similar issue, I am closing this one since it is not active.

Please check #36. Feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants