Close Position

Before close position, you need:

  1. Remove all liquidity from the position

  2. Collect all accumulated fees

  3. Collect all pending rewards (must include all reward coins from the pool)

  4. 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