Skip to content
This repository was 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

@mesozoic-technology

Description

@mesozoic-technology

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions