LiquidityModified

Event v290 → current #4

Emitted when a user modifies an existing liquidity position .

View events on chain
Useful for: stakersdevelopersanalyticswallets

The Big Picture

Modifications allow LPs to adjust without full exit. Zero delta just claims fees.

Use Cases

  • Track position changes
  • Monitor fee claims
  • Analyze LP strategies

From Chain Metadata

Event emitted when a liquidity position is modified in a subnet's liquidity pool. Modifying causes the fees to be claimed.

Part of: Concentrated Liquidity

Triggers

Emitted by

Preconditions

  • Position exists
  • User owns the position

Effects

Postconditions

  • Position liquidity changed
  • Fees claimed

Side Effects

  • Fees always claimed on modification
  • May affect pool liquidity

Event Data

#NameTypeDescription
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
i64 liquidity (i64)
5
tao
i64 tao (i64)
6
alpha
i64 alpha (i64)
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 LiquidityModified events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Swap") &&
      event.method === "LiquidityModified"
    )
    .forEach(({ event }) => {
      console.log("LiquidityModified:", event.data.toHuman());
    });
});

Runtime Info

View Source
Pallet Index
28
Event Index
4
First Version
v290
Current Version
v393