ISemiFungiblePositionManager
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
| Name | Type | Description |
|---|---|---|
poolKey | bytes | The ABI-encoded pool key (V3: address, V4: PoolKey) |
tokenId | TokenId | The tokenId of the minted position |
positionSize | uint128 | The number of contracts minted |
slippageTickLimitLow | int24 | Lower price bound |
slippageTickLimitHigh | int24 | Upper price bound |
Returns
| Name | Type | Description |
|---|---|---|
collectedByLeg | LeftRightUnsigned[4] | Fees collected per leg |
totalMoved | LeftRightSigned | Net amount moved to/from AMM |
finalTick | int24 | The 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);