SubnetTAO

Storage Map v233 → v411

TAO in the subnet liquidity pool.

Explore chain
Queried by: stakersvalidatorsanalyticsdevelopers

The Big Picture

SubnetTAO is the TAO side of the AMM pool. Together with SubnetAlphaIn, it determines the exchange rate for staking and unstaking. More TAO in the pool means alpha is relatively cheaper (you get more alpha per TAO). The constant product (SubnetTAO × SubnetAlphaIn = k) ensures there's always liquidity.

Why This Matters

What's the exchange rate for staking? SubnetTAO is half the equation. TAO/Alpha rate = SubnetAlphaIn / SubnetTAO. This determines how much alpha you receive when you stake.

Example Scenario

Query SubnetTAO(netuid=1) returns 1000000000000000 (1M TAO in RAO). SubnetAlphaIn returns 10T alpha. Rate = 10T / 1M TAO = 10,000 alpha per TAO. Staking 100 TAO gets you ~1M alpha (minus slippage).

Common Questions

Why does this change?
When you stake, you add TAO to the pool (SubnetTAO increases) and receive alpha (SubnetAlphaIn decreases). The opposite happens when unstaking.
What's slippage?
Large trades move the price. If SubnetTAO is 1M and you stake 100K TAO, you're adding 10% to the pool - the rate changes significantly during your trade.
Can the pool run out of TAO?
The AMM curve prevents depletion. As TAO gets scarce, unstaking becomes very unfavorable, naturally discouraging withdrawal.

Use Cases

  • Calculate current TAO/alpha exchange rate
  • Estimate slippage for large stake operations
  • Build AMM pool visualizations and analytics
  • Monitor subnet liquidity depth
  • Track TAO inflows and outflows per subnet

From Chain Metadata

MAP ( netuid ) --> tao_in_subnet | Returns the amount of TAO in the subnet.

Purpose & Usage

Purpose

Track TAO side of subnet AMM - the other half of the constant product formula.

Common Query Patterns

  • Query by netuid for pool state
  • Combine with SubnetAlphaIn to calculate exchange rate
  • Monitor pool depth for slippage estimation
Part of: Block EmissionTAO FlowAlpha Token ConversionNet TAO Flow Accounting

Query Keys

#NameTypeDescription
1
netuid
u16 netuid (u16, hashed key component)

Stored Value

tao_in_subnet (u64)

RAO -> TAO (/ 10^9)

Relationships

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);

// Query SubnetTAO storage
const netuid = 1;

const result = await api.query.SubtensorModule.SubnetTAO.getValue(netuid);
console.log("SubnetTAO:", result);

On-Chain Activity

Write Frequency
●●●●●○ High 1M–10M est. writes

1M–10M estimated writes

#10 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 7,429,232

Version History

v233 block 4,920,350 Added
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind
v353–v360 · runtime versions skipped on chain (never deployed)
v361 block 7,063,679 Internal re-bind Current

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v233
Current Version
v411