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

get_underlying_balance in registry return values that are not with the correct decimal precision #42

Open
NicolasWent opened this issue Dec 14, 2022 · 0 comments

Comments

@NicolasWent
Copy link

Hello,

The issue:
The method: get_underlying_balance from the registry does not give the balances with the right decimal precision

Example:
In polygon on this given registry: https://polygonscan.com/address/0x094d12e5b541784701FD8d65F11fc0598FBC6332#readContract

For the pool: 0x445FE580eF8d70FF569aB36e80c647af338db351

At the time of my writing, here are the reserves that I got from the contract:
0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063 (DAI): 7484982047960936456164609
0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 (USDC): 10327405276018000000000000
0xc2132D05D31c914a87C6611C10748AEb04B58e8F (USDT): 8072344730218000000000000

USDT has 6 decimals which would mean that the reserve is: 8072344730218000000000000 / 106 = 8072344730218000000 which is way to high.
Instead the real value of the reserve of USDT is: 8072344730218000000000000 / 10
18 = 8072344.730218

Which means that the value returned by the method get_underlying_balance for USDT have 18 decimal precision instead of the 6 decimal precision that it should have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant