LiquidityAdded
Event v290 → v292, v297 → v298, v301 → v385, v391 → 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 | Coldkey of the liquidity provider (hex -> SS58) |
| 1 | hotkey | AccountId | Hotkey associated with the liquidity provider (hex -> SS58) |
| 2 | netuid | u16 NetUid | Subnet ID for the liquidity pool |
| 3 | position_id | PositionId | Unique identifier for the new concentrated-liquidity position |
| 4 | liquidity | u64 | Liquidity units added to the position (raw u64) |
| 5 | tao → tao_deposited | u64 TaoBalance | TAO deposited into the pool (RAO; ÷10⁹ for TAO) |
| 6 | alpha → alpha_deposited | u64 AlphaBalance | Alpha deposited into the pool (alpha-RAO; ÷10⁹ for alpha) (RAO -> TAO (/ 10^9)) |
| 7 | tick_low | TickIndex | Lower tick boundary of the concentrated-liquidity range (price = 1.0001^tick) |
| 8 | tick_high | TickIndex | Upper tick boundary of the concentrated-liquidity 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 LiquidityAdded events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.Swap.LiquidityAdded.get(block.hash);
for (const evt of events) {
console.log("LiquidityAdded:", evt.payload);
}
});On-Chain Activity
Emission Frequency
●●○○○○ Moderate 10K–100K emissions
Occasional use
#42 most emitted event
As of block 7,429,232
Version History
v290 block 5,947,548 9 args
v297 block 6,067,943 9 args
v301 block 6,205,194 9 args
v391 block 7,782,857 9 args Current
Runtime Info
View Source- Pallet Index
- 28
- Event Index
- 2
- First Version
- v290
- Current Version
- v411