LiquidityRemoved
Event v290 → current #3Emitted when a user removes an entire liquidity position .
View events on chainUseful 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.
Triggers
Emitted by
Preconditions
- Position existed
- User owned the position
Effects
Storage Modified
Postconditions
- Position deleted
- TAO/Alpha returned
- Fees paid out
Side Effects
- Updates tick state
- May affect pool depth
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | coldkey | AccountId | Cold wallet address (offline storage) (hex -> SS58) |
| 1 | hotkey | AccountId | Hot wallet address (active operations) (hex -> SS58) |
| 2 | netuid | u16 | Subnet/network identifier (0-65535) |
| 3 | position_id | PositionId | position_id (PositionId) |
| 4 | liquidity | u64 | liquidity (u64) |
| 5 | tao | u64 | tao (u64) |
| 6 | alpha | u64 | alpha (u64) (RAO -> TAO (/ 10^9)) |
| 7 | fee_tao | u64 | fee_tao (u64) (RAO -> TAO (/ 10^9)) |
| 8 | fee_alpha | u64 | fee_alpha (u64) (RAO -> TAO (/ 10^9)) |
| 9 | tick_low | TickIndex | tick_low (TickIndex) (price = 1.0001^tick) |
| 10 | tick_high | TickIndex | tick_high (TickIndex) (price = 1.0001^tick) |
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 });
// Subscribe to LiquidityRemoved events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("Swap") &&
event.method === "LiquidityRemoved"
)
.forEach(({ event }) => {
console.log("LiquidityRemoved:", event.data.toHuman());
});
});On-Chain Activity
Emission Frequency
●●○○○○ Moderate 10K–100K emissions
Occasional use
#44 most emitted event
As of block 7,429,232
Runtime Info
View Source- Pallet Index
- 28
- Event Index
- 3
- First Version
- v290
- Current Version
- v393