Queried by: analyticsdevelopersstakersvalidators
The Big Picture
Volume measures cumulative trading activity through the subnet's AMM. High volume indicates active staking and unstaking - people are moving capital in and out. Low volume suggests a more static stake distribution. This is a key health metric for subnet liquidity and engagement.
Why This Matters
Is this subnet economically active? Volume tells you. High volume means lots of staking activity - people are actively participating. Low volume might mean stagnation or very long-term holders.
Example Scenario
Query SubnetVolume(netuid=1) returns 5000000000000000 (5M TAO equivalent volume). This subnet has seen 5M TAO worth of trading activity through its AMM pool.
Common Questions
- Is volume cumulative or per-period?
- This is typically cumulative total volume. For period-based analytics, you'd track changes over time using an indexer.
- Does high volume mean a good subnet?
- Not necessarily. High volume indicates activity, but could be churn (people leaving) as much as growth (people joining). Combine with other metrics.
- What counts as volume?
- Both stake and unstake operations contribute to volume. It measures total capital flow through the AMM in both directions.
Use Cases
- Measure subnet economic activity and interest
- Compare subnets by trading activity
- Build volume-based subnet rankings
- Identify trending or declining subnets
- Research staking behavior patterns
Purpose & Usage
Purpose
Track historical buy/sell activity through the AMM pool.
Common Query Patterns
- Query by netuid for volume metrics
- Compare volume across subnets
- Track volume trends over time
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | u16 | key1 (u16) |
Stored Value
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 });
// Query SubnetVolume storage
const key1 = 0;
const result = await api.query
[stringCamelCase("SubtensorModule")]
[stringCamelCase("SubnetVolume")](
key1
);
console.log("SubnetVolume:", result.toHuman());Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v233
- Current Version
- v393