USDC/WETH 0.05%

Ethereum Uniswap V3 Pool 浏览链

0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640

Solidity v0.7.6+commit.7338295f

Concentrated-liquidity AMM pool (Uniswap V3 or a bytecode-compatible fork).

🤖
通过你的 AI 查询此合约
引用: univ3-usdc-weth-eth 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
示例提示词: "Tell me the current state of univ3-usdc-weth-eth"
还没有接入 AI?→ mcp.smarts.md · 浏览链

管理与风险

谁能修改规则?

Detected mintable controls from the verified ABI.

Mintable

概览

读取函数
17
写入函数
9
事件
9

读取函数

Block #25,253,135 · just now
factory() view → 0x1f98431c8ad98523631ae4a59f267346ea31f984

The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface

返回值

名称 类型 描述
address The contract address
fee() view → 500

The pool's fee in hundredths of a bip, i.e. 1e-6

返回值

名称 类型 描述
uint24 The fee
feeGrowthGlobal0X128() view → 4,753,928,598,500,303,021,621,053,908,725,239

The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool

开发者: This value can overflow the uint256

返回值

名称 类型 描述
uint256
feeGrowthGlobal1X128() view → 2,017,482,446,485,071,056,590,346,688,375,358,345,984,103

The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool

开发者: This value can overflow the uint256

返回值

名称 类型 描述
uint256
liquidity() view → 1,793,597,369,905,874,382

The currently in range liquidity available to the pool

开发者: This value has no relationship to the total liquidity across all ticks

返回值

名称 类型 描述
uint128
maxLiquidityPerTick() view → 1,917,569,901,783,203,986,719,870,431,555,990

The maximum amount of position liquidity that can use any tick in the range

开发者: This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool

返回值

名称 类型 描述
uint128 The max amount of liquidity per tick
observations(uint256) view

Returns data about a specific observation index

开发者: You most likely want to use #observe() instead of this method to get an observation as of some amount of time ago, rather than at a specific index in the array.

参数

名称 类型 描述
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
observe(secondsAgos: uint32[]) view

Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`

开发者: Reverts if `secondsAgos` > oldest observation

参数

名称 类型 描述
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`
positions(bytes32) view

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
protocolFees() view → 319,594,064, 212,104,212,398,869,108

The amounts of token0 and token1 that are owed to the protocol

开发者: Protocol fees will never exceed uint128 max in either token

返回值

名称 类型 描述
token0 uint128
token1 uint128
slot0() view → 2,014,083,041,337,335,984,059,362,230,357,718, 202,876, 664, 723, 723, 68, true

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
snapshotCumulativesInside(tickLower: int24, tickUpper: int24) view

Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range

开发者: Snapshots must only be compared to other snapshots, taken over a period for which a position existed. I.e., snapshots cannot be compared if a position is not held for the entire period between when the first snapshot is taken and the second snapshot is taken.

参数

名称 类型 描述
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
tickBitmap(int16) view

Returns 256 packed tick initialized boolean values. See TickBitmap for more information

参数

名称 类型 描述
int16

返回值

名称 类型 描述
uint256
tickSpacing() view → 10

The pool tick spacing

开发者: 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 initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... This value is an int24 to avoid casting even though it is always positive.

返回值

名称 类型 描述
int24 The tick spacing
ticks(int24) view

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
token0() view → 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

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

返回值

名称 类型 描述
address The token contract address
token1() view → 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

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

返回值

名称 类型 描述
address The token contract address

写入函数

burn(tickLower: int24, tickUpper: int24, amount: uint128) nonpayable

Burns a specified amount of liquidity from a position between two ticks and accounts the owed tokens.✨ AI

开发者: noDelegateCall is applied indirectly via _modifyPosition

参数

名称 类型 描述
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
collect(recipient: address, tickLower: int24, tickUpper: int24, amount0Requested: uint128, amount1Requested: uint128) nonpayable

Collects tokens owed to a position

开发者: Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.

参数

名称 类型 描述
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
collectProtocol(recipient: address, amount0Requested: uint128, amount1Requested: uint128) nonpayable

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
flash(recipient: address, amount0: uint256, amount1: uint256, data: bytes) nonpayable

Receive token0 and/or token1 and pay it back, plus a fee, in the callback

开发者: Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling with 0 amount{0,1} and sending the donation amount(s) from 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
increaseObservationCardinalityNext(observationCardinalityNext: uint16) nonpayable

Increase the maximum number of price and liquidity observations that this pool will store

开发者: This method is no-op if the pool already has an observationCardinalityNext greater than or equal to the input observationCardinalityNext.

参数

名称 类型 描述
observationCardinalityNext uint16 The desired minimum number of observations for the pool to store
initialize(sqrtPriceX96: uint160) nonpayable

Initializes the pool's price and internal state using the provided sqrtPriceX96 value.✨ AI

开发者: not locked because it initializes unlocked

参数

名称 类型 描述
sqrtPriceX96 uint160 Initial square root price expressed as a Q64.96 fixed-point value.✨ AI
mint(recipient: address, tickLower: int24, tickUpper: int24, amount: uint128, data: bytes) nonpayable

Adds liquidity between tickLower and tickUpper for recipient, mints the requested liquidity, and triggers the mint callback.✨ AI

开发者: noDelegateCall is applied indirectly via _modifyPosition

参数

名称 类型 描述
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
setFeeProtocol(feeProtocol0: uint8, feeProtocol1: uint8) nonpayable

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(recipient: address, zeroForOne: bool, amountSpecified: int256, sqrtPriceLimitX96: uint160, data: bytes) nonpayable

Swap token0 for token1, or token1 for token0

开发者: The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback

参数

名称 类型 描述
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

事件

Burn(owner: address, tickLower: int24, tickUpper: int24, amount: uint128, amount0: uint256, amount1: uint256)

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
Collect(owner: address, recipient: address, tickLower: int24, tickUpper: int24, amount0: uint128, amount1: uint128)

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
CollectProtocol(sender: address, recipient: address, amount0: uint128, amount1: uint128)

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
Flash(sender: address, recipient: address, amount0: uint256, amount1: uint256, paid0: uint256, paid1: uint256)

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
IncreaseObservationCardinalityNext(observationCardinalityNextOld: uint16, observationCardinalityNextNew: uint16)

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
Initialize(sqrtPriceX96: uint160, tick: int24)

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
Mint(sender: address, owner: address, tickLower: int24, tickUpper: int24, amount: uint128, amount0: uint256, amount1: uint256)

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
SetFeeProtocol(feeProtocol0Old: uint8, feeProtocol1Old: uint8, feeProtocol0New: uint8, feeProtocol1New: uint8)

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
Swap(sender: address, recipient: address, amount0: int256, amount1: int256, sqrtPriceX96: uint160, liquidity: uint128, tick: int24)

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