v3-info
v3-info copied to clipboard
Fix ticks prices decimals
This PR fixes the number of decimals used to calculate the ticks' prices.
It was harcoded to use only 4 decimals, now it uses the token's decimals.
The tick's price1
is used to calculate the TVL locked amount0
. The loss of precision is causing the amount0
to be incorrectly calculated.
https://github.com/Uniswap/uniswap-v3-info/blob/93eaaf001dbcc4981c3605f2ac8ad3593e310f8c/src/components/DensityChart/index.tsx#L162
I also replaced the formatting of prices that used toLocaleString
with formatAmount(priceX, 4)
@NicolasMahe is attempting to deploy a commit to the Uniswap Team on Vercel.
A member of the Team first needs to authorize it.