Vest
This document provides an overview of the Vest module functionality in the Cetus SDK, which handles vesting-related operations for CLMM (Concentrated Liquidity Market Maker) positions.
Core Concepts
Vesting Information
The vesting system allows users to lock their liquidity positions for a specified period, earning rewards in return. The module provides various methods to interact with and manage these vesting positions.
API Methods
1. Get CLMM Vest Info List
Retrieves a list of all vesting information for CLMM positions.
import { CetusClmmSDK } from '@cetusprotocol/sui-clmm-sdk'
const sdk = CetusClmmSDK.createSDK({ env: 'mainnet' })
const vestInfoList = await sdk.Vest.getClmmVestInfoList()
2. Get CLMM Vest Info
Retrieves specific vesting information for a CLMM position.
const vestInfo = await sdk.Vest.getClmmVestInfo()
3. Get Pool Liquidity Snapshot
Retrieves liquidity snapshot information for a specific pool and its positions.
const poolSnapshot = await sdk.Pool.getPoolLiquiditySnapshot(pool_id)
const { remove_percent, snapshots } = poolSnapshot
// Get position snapshot
const posSnap = await sdk.Pool.getPositionSnapshot(snapshots.id, position_ids)
4. Get Position Vesting
Retrieves vesting information for specific positions in a pool.
const vestingList = await sdk.Vest.getPositionVesting([
{
clmm_position_ids: ['position_id_1', 'position_id_2'],
clmm_pool_id: 'pool_id',
coin_type_a: 'coin_type_a',
coin_type_b: 'coin_type_b'
}
])
5. Redeem Vesting Position
Redeems a vested position to claim rewards.
const tx = sdk.Vest.buildRedeemPayload([
{
clmm_pool_id: pool.id,
clmm_position_id: position_id,
period: 0,
coin_type_a: pool.coin_type_a,
coin_type_b: pool.coin_type_b
}
])
// Execute the transaction
const transferTxn = await sdk.FullClient.executeTx(keyPair, tx, false)
Parameters
Vesting Position Parameters
clmm_pool_id
: The ID of the CLMM poolclmm_position_ids
: Array of position IDs to check vesting statuscoin_type_a
: Type of the first token in the poolcoin_type_b
: Type of the second token in the poolperiod
: The vesting period (0 for immediate redemption)
Snapshot Parameters
pool_id
: The ID of the pool to get snapshot forposition_ids
: Array of position IDs to get snapshot forremove_percent
: Percentage of liquidity removedsnapshots
: Snapshot information containing position details
Notes
Vesting Period
Positions can be vested for different periods
Rewards are typically proportional to the vesting period
Redemption
Positions can be redeemed after the vesting period
Rewards are distributed upon redemption
Pool Snapshots
Snapshots track liquidity changes in pools
Used to calculate rewards and vesting status
Position Management
Multiple positions can be managed simultaneously
Each position can have different vesting parameters
Last updated