remove_liquidity

Call v290 → current #2

Removes an entire liquidity position and claims accrued fees.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: stakersdeveloperswallets

The Big Picture

Closes position entirely, returning assets plus accumulated fees.

Use Cases

  • Exit position
  • Claim accumulated fees

From Chain Metadata

Remove liquidity from a specific position. Parameters: origin: The origin of the transaction netuid: Subnet ID position_id: ID of the position to remove Emits `Event::LiquidityRemoved` on success

Part of: Concentrated Liquidity

Input Parameters

#NameTypeDescription
0
hotkey
AccountId Hot wallet address (active operations) (hex -> SS58)
1
netuid
u16 Subnet/network identifier (0-65535)
2
position_id
PositionId position_id (PositionId)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Position exists for caller
  • Position ID is valid

Effects

Events Emitted

Postconditions

  • Position deleted
  • TAO/Alpha returned
  • Fees paid out

Side Effects

  • Emits LiquidityRemoved event
  • Updates tick state

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build remove_liquidity call
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const position_id = 0 as any /* PositionId */;

const call = api.tx[stringCamelCase("Swap")][stringCamelCase("remove_liquidity")](
  hotkey,
  netuid,
  position_id
);

On-Chain Activity

Usage Frequency
●●○○○○ Low 1K–10K extrinsics

Infrequent

#49 most used call

Success Rate Near-certain

Over 95% of submissions succeed

As of block 7,429,232

Runtime Info

View Source
Pallet Index
28
Call Index
2
First Version
v290
Current Version
v393