Close Position
Before close position, you need:
Remove all liquidity from the position
Collect all accumulated fees
Collect all pending rewards (must include all reward coins from the pool)
Delete the position
// Close position (This will collect all fees, rewards and remove all liquidity)
const tx = sdk.Position.closePositionPayload({
pool_id,
position_id,
coin_type_a,
coin_type_b,
reward_coins: pool.reward_manager.rewards.map(reward => reward.reward_coin) // Required: Must include all reward coin types from the pool
})
// Simulate or send the transaction
const sim_result = await sdk.FullClient.sendSimulationTransaction(tx, wallet)
Last updated