Skip to main content
Helpful?

IPositionManager

Git Source | Generated with forge doc

Inherits: INotifier

Interface for the PositionManager contract

Functions

modifyLiquidities

Unlocks Uniswap v4 PoolManager and batches actions for modifying liquidity

This is the standard entrypoint for the PositionManager

function modifyLiquidities(bytes calldata unlockData, uint256 deadline) external payable;

Parameters

NameTypeDescription
unlockDatabytesis an encoding of actions, and parameters for those actions
deadlineuint256is the deadline for the batched actions to be executed

modifyLiquiditiesWithoutUnlock

Batches actions for modifying liquidity without unlocking v4 PoolManager

This must be called by a contract that has already unlocked the v4 PoolManager

function modifyLiquiditiesWithoutUnlock(bytes calldata actions, bytes[] calldata params) external payable;

Parameters

NameTypeDescription
actionsbytesthe actions to perform
paramsbytes[]the parameters to provide for the actions

nextTokenId

Used to get the ID that will be used for the next minted liquidity position

function nextTokenId() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 The next token ID

getPositionLiquidity

this value can be processed as an amount0 and amount1 by using the LiquidityAmounts library

function getPositionLiquidity(uint256 tokenId) external view returns (uint128 liquidity);

Parameters

NameTypeDescription
tokenIduint256the ERC721 tokenId

Returns

NameTypeDescription
liquidityuint128the position's liquidity, as a liquidityAmount

getPoolAndPositionInfo

function getPoolAndPositionInfo(uint256 tokenId) external view returns (PoolKey memory, PositionInfo);

Parameters

NameTypeDescription
tokenIduint256the ERC721 tokenId

Returns

NameTypeDescription
<none>PoolKeyPositionInfo a uint256 packed value holding information about the position including the range (tickLower, tickUpper)
<none>PositionInfopoolKey the pool key of the position

Errors

NotApproved

Thrown when the caller is not approved to modify a position

error NotApproved(address caller);

DeadlinePassed

Thrown when the block.timestamp exceeds the user-provided deadline

error DeadlinePassed(uint256 deadline);
Helpful?