Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Uniswap V3 liquidity library - ability to calculate liquidity within a specific range #132

Open
mesozoic-technology opened this issue Jan 7, 2022 · 0 comments

Comments

@mesozoic-technology
Copy link
Contributor

Understanding BalancerV2 is Overlay's launch point, I did happen to be rooting around in Uniswap's periphery repo and encountered this library for ascertaining liquidity amounts between particular price points.

https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/LiquidityAmounts.sol

I wanted to catalogue this discussion due to a curiosity about what this library might mean for a formalism built around UniV3.

Where we currently have this as the Overlay market's measure for the market liquidity,

            _marketLiquidity = ethIs0
                ? ( uint256(_liquidity) << 96 ) / _sqrtPrice
                : FullMath.mulDiv(uint256(_liquidity), _sqrtPrice, X96);

According to this library, it could be augmented to read liquidity between between specific tick boundaries.

Perhaps this lends more security to a formalism built around uni v3?

Tabling this out of curiosity for potential future development.

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

No branches or pull requests

1 participant