Skip to main content

ISemiFungiblePositionManager

Git Source

Functions
​

mintTokenizedPosition
​

Create a new position tokenId containing up to 4 legs.

Both V3 and V4 implementations use bytes poolKey to abstract the underlying pool.

function mintTokenizedPosition(
bytes calldata poolKey,
TokenId tokenId,
uint128 positionSize,
int24 slippageTickLimitLow,
int24 slippageTickLimitHigh
) external returns (LeftRightUnsigned[4] memory collectedByLeg, LeftRightSigned totalMoved, int24 finalTick);

Parameters

NameTypeDescription
poolKeybytesThe ABI-encoded pool key (V3: address, V4: PoolKey)
tokenIdTokenIdThe tokenId of the minted position
positionSizeuint128The number of contracts minted
slippageTickLimitLowint24Lower price bound
slippageTickLimitHighint24Upper price bound

Returns

NameTypeDescription
collectedByLegLeftRightUnsigned[4]Fees collected per leg
totalMovedLeftRightSignedNet amount moved to/from AMM
finalTickint24The tick at the end of the mint/burn operation

burnTokenizedPosition
​

Burn an existing position containing up to 4 legs.

function burnTokenizedPosition(
bytes calldata poolKey,
TokenId tokenId,
uint128 positionSize,
int24 slippageTickLimitLow,
int24 slippageTickLimitHigh
) external returns (LeftRightUnsigned[4] memory collectedByLeg, LeftRightSigned totalMoved, int24 finalTick);

getAccountLiquidity
​

function getAccountLiquidity(
bytes calldata poolKey,
address owner,
uint256 tokenType,
int24 tickLower,
int24 tickUpper
) external view returns (LeftRightUnsigned accountLiquidities);

getAccountPremium
​

function getAccountPremium(
bytes calldata poolKey,
address owner,
uint256 tokenType,
int24 tickLower,
int24 tickUpper,
int24 atTick,
uint256 isLong,
uint256 vegoid
) external view returns (uint128 premium0, uint128 premium1);

getPoolId
​

function getPoolId(bytes memory id, uint8 vegoid) external view returns (uint64 poolId);

getEnforcedTickLimits
​

function getEnforcedTickLimits(uint64 poolId) external view returns (int24, int24);

getCurrentTick
​

function getCurrentTick(bytes memory poolKey) external view returns (int24 currentTick);

expandEnforcedTickRange
​

function expandEnforcedTickRange(uint64 poolId) external;

safeTransferFrom
​

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

safeBatchTransferFrom
​

function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;

Events
​

TokenizedPositionBurnt
​

Emitted when a position is destroyed/burned.

event TokenizedPositionBurnt(address indexed recipient, TokenId indexed tokenId, uint128 positionSize);

TokenizedPositionMinted
​

Emitted when a position is created/minted.

event TokenizedPositionMinted(address indexed caller, TokenId indexed tokenId, uint128 positionSize);