ConcentratedLiquidityPool

집중된 유동성으로 관리되는 AMM Pool 컨트랙트로, 유동성 공급 / 제거 / 수수료 수취 / 스왑에 대한 low level 메서드를 제공합니다.

Overview

Concentrated Liquidity Pool은 Pangea의 Exchange Module 중 코어 컨트랙트로, 크게 6가지 기능을 수행합니다.

  1. MINT : 포지션 생성

  2. BURN : 포지션 소각

  3. SWAP : 풀에서 스왑처리

  4. COLLECT : 발생한 스왑 수수료 수취

  5. FLASH : flash loan 수행

  6. DEPOSIT_AIRDROP : 에어드랍 보상 예치 (예치된 에어드랍 보상은 1주간 선형 분배)

Concentrated Liquidity Pool은 유저의 자산을 직접적으로 다루기 때문에 Non-Upgradable Contract로 설계되었으며, low level 메서드로 구성되어 있습니다.

이를 처리하기 위해 Concentrated LiquidityPool의 메서드를 직접 호출하기 보다 high level contract인 ConcentratedLiquidityPoolManager와 poolRouter를 통해 호출하길 권합니다.

Methods

burn

Burns LP tokens - should be called via the Concentrated Liquidity pool manager contract.

collect

Collects tokens owed to a position

collectProtocolFee

factory

Returns the address of the factory contract

feeGrowthGlobal0

The fee growth of token0 collected per unit of liquidity for the entire life of the pool

feeGrowthGlobal1

The fee growth of token1 collected per unit of liquidity for the entire life of the pool

flash

Receives token0 or token1 and pays it back with fee

getAssets

Returns the list of the tokens of the pool, sorted by address

getImmutables

getPriceAndNearestTicks

Returns the price and nearestTick

getReserves

Returns the reserve of token0 and token1

getSecondsGrowthAndLastObservation

Returns the information about seconds growth global and the timestamp of the observation

liquidity

Returns the current in range liquidity available to the pool

mint

nearestTick

Returns the tick that is just below the current price.

positions

Returns the information about the position

price

Sqrt of price aka. √(token1/token0), multiplied by 2^96.

rangeFeeGrowth

Returns the fee growth of token0 & token1 inside the given price range

swap

Swaps one token for another. The router must prefund this contract and ensure there isn't too much slippage.

swapFee

1000 corresponds to 0.1% fee. Fee is measured in pips.

tickSpacing

Returns the tick spacing of the pool.

Ticks can only be used at multiples of this value, minimum of 1 and always positive e.g.: a tickSpacing of 3 means ticks can be created every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...Reference: tickSpacing of 100 -> 1% between ticks.

ticks

Looks up the information about a specific tick in the pool

token0

Returns the address of the first of the two tokens of the pool, sorted by address

token1

Returns the address of the second of the two tokens of the pool, sorted by address

totalTicks

Returns the number of ticks in the Pool, starts with two ticks (MIN_TICK ~ MAX_TICK)

Last updated