LiquidityAdded
Event v290 → current #2Emitted when a user adds liquidity to a subnet 's pool.
View events on chainUseful for: stakersdevelopersanalyticswallets
The Big Picture
Liquidity additions increase pool depth, enabling larger swaps with less slippage.
Use Cases
- Track LP activity
- Monitor TVL changes
- Build liquidity analytics
- Confirm LP transaction
From Chain Metadata
Event emitted when a liquidity position is added to a subnet's liquidity pool.
Triggers
Emitted by
Preconditions
- V3 mode enabled
- User had sufficient TAO/Alpha
- Valid tick range
Effects
Storage Modified
Postconditions
- Position created
- User balances decreased
- Pool liquidity increased
Side Effects
- Updates tick boundaries
- May affect current price
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 | tick_low | TickIndex | tick_low (TickIndex) (price = 1.0001^tick) |
| 8 | 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 LiquidityAdded events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("Swap") &&
event.method === "LiquidityAdded"
)
.forEach(({ event }) => {
console.log("LiquidityAdded:", event.data.toHuman());
});
});On-Chain Activity
Emission Frequency
●●○○○○ Moderate 10K–100K emissions
Occasional use
#42 most emitted event
As of block 7,429,232
Runtime Info
View Source- Pallet Index
- 28
- Event Index
- 2
- First Version
- v290
- Current Version
- v393