v3-core
v3-core copied to clipboard
Feature Request: Uniswap V3 sqrtPrice, require token decimals as input
Feature Request
I propose adding token decimal values as an input parameter to the sqrtPrice
function in Uniswap V3. This would help improve the accuracy of position and liquidity calculations, particularly for pools involving USDC pairs or any other pairs with differing decimals.
Rationale
Currently, the Uniswap V3 UI sometimes displays misleading information about positions and liquidity, especially when the token pairs have different decimals. This inaccuracy can result in flawed decision-making processes for traders and liquidity providers.
Proposed Solution
Extend the sqrtPrice
function to accept the decimal counts of the paired tokens as an argument. Then, adjust the underlying calculations to account for these decimals, which should make the output more accurate.
Additional Context
- Similar issues have been discussed on GitHub and Stack Overflow.
- This is particularly important for USDC pairs, where the discrepancy can be significant due to differing decimals.
Hi, any one working on this feature?