curve-pool-registry
curve-pool-registry copied to clipboard
get_underlying_balance in registry return values that are not with the correct decimal precision
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 / 1018 = 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.