LiquidityRemoved

Event v290 → v292, v297 → v298, v301 → v385, v391 → current #3

Emitted when a user removes an entire liquidity position .

View events on chain
Useful for: stakersdevelopersanalyticswallets

The Big Picture

LP removals return assets plus accumulated fees. fee_tao/fee_alpha show earnings.

Use Cases

  • Track LP exits
  • Monitor TVL decreases
  • Confirm position closure
  • Analyze fee accumulation

From Chain Metadata

Event emitted when a liquidity position is removed from a subnet's liquidity pool.

Part of: Concentrated Liquidity

Triggers

Emitted by

Preconditions

  • Position existed
  • User owned the position

Effects

Postconditions

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

Side Effects

  • Updates tick state
  • May affect pool depth

Event Data

#NameTypeDescription
0
coldkey
AccountId Coldkey of the liquidity provider (hex -> SS58)
1
hotkey
AccountId Hotkey associated with the liquidity provider (hex -> SS58)
2
netuid
u16 NetUidSubnet ID for the liquidity pool
3
position_id
PositionId Unique identifier of the closed position
4
liquidity
u64 Liquidity units removed (raw u64)
5
tao
→ tao_withdrawn
u64 TaoBalanceTAO withdrawn from the pool (RAO; ÷10⁹ for TAO)
6
alpha
→ alpha_withdrawn
u64 AlphaBalanceAlpha withdrawn from the pool (alpha-RAO; ÷10⁹ for alpha) (RAO -> TAO (/ 10^9))
7
fee_tao
u64 TaoBalanceAccumulated TAO fees collected (TAO RAO) (RAO -> TAO (/ 10^9))
8
fee_alpha
u64 AlphaBalanceAccumulated Alpha fees collected (alpha-RAO) (RAO -> TAO (/ 10^9))
9
tick_low
TickIndex Lower tick boundary of the closed range (price = 1.0001^tick)
10
tick_high
TickIndex Upper tick boundary of the closed range (price = 1.0001^tick)

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to LiquidityRemoved events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Swap.LiquidityRemoved.get(block.hash);
  for (const evt of events) {
    console.log("LiquidityRemoved:", evt.payload);
  }
});

On-Chain Activity

Emission Frequency
●●○○○○ Moderate 10K–100K emissions

Occasional use

#44 most emitted event

As of block 7,429,232

Version History

v290 block 5,947,548 11 args
v297 block 6,067,943 11 args
v301 block 6,205,194 11 args
v391 block 7,782,857 11 args Current

Runtime Info

View Source
Pallet Index
28
Event Index
3
First Version
v290
Current Version
v411