Uniswap.Contracts.V3Pool (Uniswap v0.0.5)
View SourceUniswap V3 Pool Contract
Summary
Functions
Default address of the contract. Returns nil
if not specified.
Prepares burn(int24 tickLower, int24 tickUpper, uint128 amount)
call parameters on the contract.
Prepares collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested)
call parameters on the contract.
Prepares collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested)
call parameters on the contract.
Prepares contract constructor values for deployment.
Prepares factory()
call parameters on the contract.
Prepares fee()
call parameters on the contract.
Prepares feeGrowthGlobal0X128()
call parameters on the contract.
Prepares feeGrowthGlobal1X128()
call parameters on the contract.
Prepares flash(address recipient, uint256 amount0, uint256 amount1, bytes data)
call parameters on the contract.
Prepares increaseObservationCardinalityNext(uint16 observationCardinalityNext)
call parameters on the contract.
Prepares initialize(uint160 sqrtPriceX96)
call parameters on the contract.
Prepares liquidity()
call parameters on the contract.
Prepares maxLiquidityPerTick()
call parameters on the contract.
Prepares mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data)
call parameters on the contract.
Prepares observations(uint256)
call parameters on the contract.
Prepares observe(uint32[] secondsAgos)
call parameters on the contract.
Calculates the position key based PositionKey.sol library implementation
Prepares positions(bytes32)
call parameters on the contract.
Prepares protocolFees()
call parameters on the contract.
Prepares setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1)
call parameters on the contract.
Prepares slot0()
call parameters on the contract.
Prepares snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
call parameters on the contract.
Prepares swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data)
call parameters on the contract.
Prepares tickBitmap(int16)
call parameters on the contract.
Prepares tickSpacing()
call parameters on the contract.
Prepares ticks(int24)
call parameters on the contract.
Prepares token0()
call parameters on the contract.
Prepares token1()
call parameters on the contract.
Functions
@spec __default_address__() :: nil
Default address of the contract. Returns nil
if not specified.
To specify a default address see Ethers.Contract
@spec burn(integer(), integer(), non_neg_integer()) :: Ethers.TxData.t()
Prepares burn(int24 tickLower, int24 tickUpper, uint128 amount)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- tickLower:
{:int, 24}
- tickUpper:
{:int, 24}
- amount:
{:uint, 128}
Return Types (when called with Ethers.call/2
)
- amount0:
{:uint, 256}
- amount1:
{:uint, 256}
@spec collect( Ethers.Types.t_address(), integer(), integer(), non_neg_integer(), non_neg_integer() ) :: Ethers.TxData.t()
Prepares collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- recipient:
:address
- tickLower:
{:int, 24}
- tickUpper:
{:int, 24}
- amount0Requested:
{:uint, 128}
- amount1Requested:
{:uint, 128}
Return Types (when called with Ethers.call/2
)
- amount0:
{:uint, 128}
- amount1:
{:uint, 128}
@spec collect_protocol(Ethers.Types.t_address(), non_neg_integer(), non_neg_integer()) :: Ethers.TxData.t()
Prepares collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- recipient:
:address
- amount0Requested:
{:uint, 128}
- amount1Requested:
{:uint, 128}
Return Types (when called with Ethers.call/2
)
- amount0:
{:uint, 128}
- amount1:
{:uint, 128}
@spec constructor() :: binary()
Prepares contract constructor values for deployment.
To deploy a contracts use Ethers.deploy/2
and pass the result of this function as
:encoded_constructor
option.
Parameters
@spec factory() :: Ethers.TxData.t()
Prepares factory()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
:address
@spec fee() :: Ethers.TxData.t()
Prepares fee()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:uint, 24}
@spec fee_growth_global0_x128() :: Ethers.TxData.t()
Prepares feeGrowthGlobal0X128()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:uint, 256}
@spec fee_growth_global1_x128() :: Ethers.TxData.t()
Prepares feeGrowthGlobal1X128()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:uint, 256}
@spec flash(Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), binary()) :: Ethers.TxData.t()
Prepares flash(address recipient, uint256 amount0, uint256 amount1, bytes data)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- recipient:
:address
- amount0:
{:uint, 256}
- amount1:
{:uint, 256}
- data:
:bytes
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec increase_observation_cardinality_next(non_neg_integer()) :: Ethers.TxData.t()
Prepares increaseObservationCardinalityNext(uint16 observationCardinalityNext)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- observationCardinalityNext:
{:uint, 16}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec initialize(non_neg_integer()) :: Ethers.TxData.t()
Prepares initialize(uint160 sqrtPriceX96)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- sqrtPriceX96:
{:uint, 160}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec liquidity() :: Ethers.TxData.t()
Prepares liquidity()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:uint, 128}
@spec max_liquidity_per_tick() :: Ethers.TxData.t()
Prepares maxLiquidityPerTick()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:uint, 128}
@spec mint( Ethers.Types.t_address(), integer(), integer(), non_neg_integer(), binary() ) :: Ethers.TxData.t()
Prepares mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- recipient:
:address
- tickLower:
{:int, 24}
- tickUpper:
{:int, 24}
- amount:
{:uint, 128}
- data:
:bytes
Return Types (when called with Ethers.call/2
)
- amount0:
{:uint, 256}
- amount1:
{:uint, 256}
@spec observations(non_neg_integer()) :: Ethers.TxData.t()
Prepares observations(uint256)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
{:uint, 256}
Return Types (when called with Ethers.call/2
)
- blockTimestamp:
{:uint, 32}
- tickCumulative:
{:int, 56}
- secondsPerLiquidityCumulativeX128:
{:uint, 160}
- initialized:
:bool
@spec observe([non_neg_integer()]) :: Ethers.TxData.t()
Prepares observe(uint32[] secondsAgos)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
- secondsAgos:
{:array, {:uint, 32}}
Return Types (when called with Ethers.call/2
)
- tickCumulatives:
{:array, {:int, 56}}
- secondsPerLiquidityCumulativeX128s:
{:array, {:uint, 160}}
Calculates the position key based PositionKey.sol library implementation
Examples
iex> V3Pool.position_key(-276330, -276320)
"0x83947e3b1c37534eabbcccb7343ebdbf5390725cbe77c0d7dae7963d7d8d3a3d"
@spec positions(<<_::256>>) :: Ethers.TxData.t()
Prepares positions(bytes32)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
{:bytes, 32}
Return Types (when called with Ethers.call/2
)
- liquidity:
{:uint, 128}
- feeGrowthInside0LastX128:
{:uint, 256}
- feeGrowthInside1LastX128:
{:uint, 256}
- tokensOwed0:
{:uint, 128}
- tokensOwed1:
{:uint, 128}
@spec protocol_fees() :: Ethers.TxData.t()
Prepares protocolFees()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
- token0:
{:uint, 128}
- token1:
{:uint, 128}
@spec set_fee_protocol(non_neg_integer(), non_neg_integer()) :: Ethers.TxData.t()
Prepares setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- feeProtocol0:
{:uint, 8}
- feeProtocol1:
{:uint, 8}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec slot0() :: Ethers.TxData.t()
Prepares slot0()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
- sqrtPriceX96:
{:uint, 160}
- tick:
{:int, 24}
- observationIndex:
{:uint, 16}
- observationCardinality:
{:uint, 16}
- observationCardinalityNext:
{:uint, 16}
- feeProtocol:
{:uint, 8}
- unlocked:
:bool
@spec snapshot_cumulatives_inside(integer(), integer()) :: Ethers.TxData.t()
Prepares snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
- tickLower:
{:int, 24}
- tickUpper:
{:int, 24}
Return Types (when called with Ethers.call/2
)
- tickCumulativeInside:
{:int, 56}
- secondsPerLiquidityInsideX128:
{:uint, 160}
- secondsInside:
{:uint, 32}
@spec swap( Ethers.Types.t_address(), boolean(), integer(), non_neg_integer(), binary() ) :: Ethers.TxData.t()
Prepares swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- recipient:
:address
- zeroForOne:
:bool
- amountSpecified:
{:int, 256}
- sqrtPriceLimitX96:
{:uint, 160}
- data:
:bytes
Return Types (when called with Ethers.call/2
)
- amount0:
{:int, 256}
- amount1:
{:int, 256}
@spec tick_bitmap(integer()) :: Ethers.TxData.t()
Prepares tickBitmap(int16)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
{:int, 16}
Return Types (when called with Ethers.call/2
)
{:uint, 256}
@spec tick_spacing() :: Ethers.TxData.t()
Prepares tickSpacing()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
{:int, 24}
@spec ticks(integer()) :: Ethers.TxData.t()
Prepares ticks(int24)
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Function Parameter Types
{:int, 24}
Return Types (when called with Ethers.call/2
)
- liquidityGross:
{:uint, 128}
- liquidityNet:
{:int, 128}
- feeGrowthOutside0X128:
{:uint, 256}
- feeGrowthOutside1X128:
{:uint, 256}
- tickCumulativeOutside:
{:int, 56}
- secondsPerLiquidityOutsideX128:
{:uint, 160}
- secondsOutside:
{:uint, 32}
- initialized:
:bool
@spec token0() :: Ethers.TxData.t()
Prepares token0()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
:address
@spec token1() :: Ethers.TxData.t()
Prepares token1()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
:address