0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
Solidity v0.7.6+commit.7338295f
Concentrated-liquidity AMM pool (Uniswap V3 or a bytecode-compatible fork).
管理与风险
谁能修改规则?
Detected mintable controls from the verified ABI.
概览
读取函数
Block #25,253,135 · just nowThe contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The contract address |
The pool's fee in hundredths of a bip, i.e. 1e-6
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint24 | The fee |
The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
The currently in range liquidity available to the pool
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint128 |
The maximum amount of position liquidity that can use any tick in the range
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint128 | The max amount of liquidity per tick |
Returns data about a specific observation index
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockTimestamp | uint32 | blockTimestamp The timestamp of the observation, Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, Returns initialized whether the observation has been initialized and the values are safe to use |
| tickCumulative | int56 | |
| secondsPerLiquidityCumulativeX128 | uint160 | |
| initialized | bool |
Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| secondsAgos | uint32[] | Each amount of time to look back, in seconds, at which point to return an observation |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| tickCumulatives | int56[] | tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo` |
| secondsPerLiquidityCumulativeX128s | uint160[] | secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo` |
Returns the information about a position by the position's key
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bytes32 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| liquidity | uint128 | _liquidity The amount of liquidity in the position, Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke |
| feeGrowthInside0LastX128 | uint256 | |
| feeGrowthInside1LastX128 | uint256 | |
| tokensOwed0 | uint128 | |
| tokensOwed1 | uint128 |
The amounts of token0 and token1 that are owed to the protocol
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| token0 | uint128 | |
| token1 | uint128 |
The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas when accessed externally.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| sqrtPriceX96 | uint160 | sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value tick The current tick of the pool, i.e. according to the last tick transition that was run. This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick boundary. observationIndex The index of the last oracle observation that was written, observationCardinality The current maximum number of observations stored in the pool, observationCardinalityNext The next maximum number of observations, to be updated when the observation. feeProtocol The protocol fee for both tokens of the pool. Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. unlocked Whether the pool is currently locked to reentrancy |
| tick | int24 | |
| observationIndex | uint16 | |
| observationCardinality | uint16 | |
| observationCardinalityNext | uint16 | |
| feeProtocol | uint8 | |
| unlocked | bool |
Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tickLower | int24 | The lower tick of the range |
| tickUpper | int24 | The upper tick of the range |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| tickCumulativeInside | int56 | tickCumulativeInside The snapshot of the tick accumulator for the range |
| secondsPerLiquidityInsideX128 | uint160 | secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range |
| secondsInside | uint32 | secondsInside The snapshot of seconds per liquidity for the range |
Returns 256 packed tick initialized boolean values. See TickBitmap for more information
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| — | int16 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
The pool tick spacing
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | int24 | The tick spacing |
Look up information about a specific tick in the pool
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| — | int24 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| liquidityGross | uint128 | liquidityGross the total amount of position liquidity that uses the pool either as tick lower or tick upper, liquidityNet how much liquidity changes when the pool price crosses the tick, feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, secondsOutside the seconds spent on the other side of the tick from the current tick, initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. In addition, these values are only relative and must be used only in comparison to previous snapshots for a specific position. |
| liquidityNet | int128 | |
| feeGrowthOutside0X128 | uint256 | |
| feeGrowthOutside1X128 | uint256 | |
| tickCumulativeOutside | int56 | |
| secondsPerLiquidityOutsideX128 | uint160 | |
| secondsOutside | uint32 | |
| initialized | bool |
The first of the two tokens of the pool, sorted by address
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The token contract address |
The second of the two tokens of the pool, sorted by address
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The token contract address |
写入函数
Burns a specified amount of liquidity from a position between two ticks and accounts the owed tokens.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tickLower | int24 | Lower tick of the position.✨ AI |
| tickUpper | int24 | Upper tick of the position.✨ AI |
| amount | uint128 | Amount of liquidity to remove, expressed in liquidity units (uint128).✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | uint256 | Amount of token0 accounted to the caller as a result of burning the liquidity.✨ AI |
| amount1 | uint256 | Amount of token1 accounted to the caller as a result of burning the liquidity.✨ AI |
Collects tokens owed to a position
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| recipient | address | The address which should receive the fees collected |
| tickLower | int24 | The lower tick of the position for which to collect fees |
| tickUpper | int24 | The upper tick of the position for which to collect fees |
| amount0Requested | uint128 | How much token0 should be withdrawn from the fees owed |
| amount1Requested | uint128 | How much token1 should be withdrawn from the fees owed |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | uint128 | amount0 The amount of fees collected in token0 |
| amount1 | uint128 | amount1 The amount of fees collected in token1 |
Collect the protocol fee accrued to the pool
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| recipient | address | The address to which collected protocol fees should be sent |
| amount0Requested | uint128 | The maximum amount of token0 to send, can be 0 to collect fees in only token1 |
| amount1Requested | uint128 | The maximum amount of token1 to send, can be 0 to collect fees in only token0 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | uint128 | amount0 The protocol fee collected in token0 |
| amount1 | uint128 | amount1 The protocol fee collected in token1 |
Receive token0 and/or token1 and pay it back, plus a fee, in the callback
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| recipient | address | The address which will receive the token0 and token1 amounts |
| amount0 | uint256 | The amount of token0 to send |
| amount1 | uint256 | The amount of token1 to send |
| data | bytes | Any data to be passed through to the callback |
Increase the maximum number of price and liquidity observations that this pool will store
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| observationCardinalityNext | uint16 | The desired minimum number of observations for the pool to store |
Initializes the pool's price and internal state using the provided sqrtPriceX96 value.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| sqrtPriceX96 | uint160 | Initial square root price expressed as a Q64.96 fixed-point value.✨ AI |
Adds liquidity between tickLower and tickUpper for recipient, mints the requested liquidity, and triggers the mint callback.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| recipient | address | Address that will own the minted position and receive any accrued fees.✨ AI |
| tickLower | int24 | Lower tick boundary of the position's price range (inclusive).✨ AI |
| tickUpper | int24 | Upper tick boundary of the position's price range (exclusive).✨ AI |
| amount | uint128 | Amount of liquidity to mint (in pool liquidity units).✨ AI |
| data | bytes | Arbitrary data forwarded to the mint callback; used by the caller to provide payment.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | uint256 | amount0: The amount of token0 the caller must transfer to the pool for the minted liquidity.✨ AI |
| amount1 | uint256 | amount1: The amount of token1 the caller must transfer to the pool for the minted liquidity.✨ AI |
Set the denominator of the protocol's % share of the fees
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| feeProtocol0 | uint8 | new protocol fee for token0 of the pool |
| feeProtocol1 | uint8 | new protocol fee for token1 of the pool |
Swap token0 for token1, or token1 for token0
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| recipient | address | The address to receive the output of the swap |
| zeroForOne | bool | The direction of the swap, true for token0 to token1, false for token1 to token0 |
| amountSpecified | int256 | The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) |
| sqrtPriceLimitX96 | uint160 | The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap |
| data | bytes | Any data to be passed through to the callback |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | int256 | amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive |
| amount1 | int256 | amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive |
事件
Emitted when a position's liquidity is removed
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| owner | address | ✓ | The owner of the position for which liquidity is removed |
| tickLower | int24 | ✓ | The lower tick of the position |
| tickUpper | int24 | ✓ | The upper tick of the position |
| amount | uint128 | The amount of liquidity to remove | |
| amount0 | uint256 | The amount of token0 withdrawn | |
| amount1 | uint256 | The amount of token1 withdrawn |
Emitted when fees are collected by the owner of a position
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| owner | address | ✓ | The owner of the position for which fees are collected |
| recipient | address | ||
| tickLower | int24 | ✓ | The lower tick of the position |
| tickUpper | int24 | ✓ | The upper tick of the position |
| amount0 | uint128 | The amount of token0 fees collected | |
| amount1 | uint128 | The amount of token1 fees collected |
Emitted when the collected protocol fees are withdrawn by the factory owner
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| sender | address | ✓ | The address that collects the protocol fees |
| recipient | address | ✓ | The address that receives the collected protocol fees |
| amount0 | uint128 | The amount of token1 protocol fees that is withdrawn | |
| amount1 | uint128 |
Emitted by the pool for any flashes of token0/token1
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| sender | address | ✓ | The address that initiated the swap call, and that received the callback |
| recipient | address | ✓ | The address that received the tokens from flash |
| amount0 | uint256 | The amount of token0 that was flashed | |
| amount1 | uint256 | The amount of token1 that was flashed | |
| paid0 | uint256 | The amount of token0 paid for the flash, which can exceed the amount0 plus the fee | |
| paid1 | uint256 | The amount of token1 paid for the flash, which can exceed the amount1 plus the fee |
Emitted by the pool for increases to the number of observations that can be stored
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| observationCardinalityNextOld | uint16 | The previous value of the next observation cardinality | |
| observationCardinalityNextNew | uint16 | The updated value of the next observation cardinality |
Emitted exactly once by a pool when #initialize is first called on the pool
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| sqrtPriceX96 | uint160 | The initial sqrt price of the pool, as a Q64.96 | |
| tick | int24 | The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool |
Emitted when liquidity is minted for a given position
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| sender | address | The address that minted the liquidity | |
| owner | address | ✓ | The owner of the position and recipient of any minted liquidity |
| tickLower | int24 | ✓ | The lower tick of the position |
| tickUpper | int24 | ✓ | The upper tick of the position |
| amount | uint128 | The amount of liquidity minted to the position range | |
| amount0 | uint256 | How much token0 was required for the minted liquidity | |
| amount1 | uint256 | How much token1 was required for the minted liquidity |
Emitted when the protocol fee is changed by the pool
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| feeProtocol0Old | uint8 | The previous value of the token0 protocol fee | |
| feeProtocol1Old | uint8 | The previous value of the token1 protocol fee | |
| feeProtocol0New | uint8 | The updated value of the token0 protocol fee | |
| feeProtocol1New | uint8 | The updated value of the token1 protocol fee |
Emitted by the pool for any swaps between token0 and token1
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| sender | address | ✓ | The address that initiated the swap call, and that received the callback |
| recipient | address | ✓ | The address that received the output of the swap |
| amount0 | int256 | The delta of the token0 balance of the pool | |
| amount1 | int256 | The delta of the token1 balance of the pool | |
| sqrtPriceX96 | uint160 | The sqrt(price) of the pool after the swap, as a Q64.96 | |
| liquidity | uint128 | The liquidity of the pool after the swap | |
| tick | int24 | The log base 1.0001 of price of the pool after the swap |