BasketTwr

Storage Map v450 → current

Map (validator_hotkey) to the fund staker total-return accumulator, the canonical root-staker return series.

Explore chain
Queried by: stakersanalyticswalletsdevelopers

The Big Picture

Before v450 every wallet derived its own staker return series and they disagreed. This accumulator is the one canonical series: everything staker-facing derives from it, and the stake index chains its relatives. The rate-delta figure some tools show is the pending-entitlement mark, which re-values accrued beta at today's price; it is not an alternative return series.

Why This Matters

When two dashboards show different APY for the same validator, this is the number that settles it. Any two samples of it produce the same window return for everyone.

Example Scenario

Twr reads 1.10 at the start of the month and 1.155 at the end. The staker return for the month is 1.155 / 1.10 - 1, or 5%, regardless of who computes it.

Common Questions

Does adding stake mid-window distort it?
No. Flows never move the accumulator. Each dividend multiplies in the value it added per rao of root stake at that moment.

Use Cases

  • Compute a validator staker return over any window from two storage reads
  • Verify a dashboard APY figure against the chain-defined series

From Chain Metadata

MAP ( validator_hotkey ) --> the fund's staker total-return accumulator. The one canonical root-staker return series. Starts at 1.0 and multiplies by `1 + stakers_value / total_root_stake` on every dividend share mint — the value that deposit actually added per rao of claimant root stake, locked in at the deposit's own (realizable) pricing. Flows never move it; only dividends do. The staker return of τ1 staked over any window (claim-and-restake convention) is `Twr(t1) / Twr(t0) - 1`, so any two archive samples agree for every consumer. Everything staker-facing derives from it: `stake_price` is this accumulator spliced onto the stake index (`tr_splice × Twr`), and the index chains its relatives. The rate-delta figure `(BasketRate - rate0) * price` is *not* an alternative return series — it is the pending-entitlement mark (`staker_yield`), which re-values all accrued β at today's price. Accumulates from the upgrade that introduced it; earlier history lives in the seeded `tr_splice` (see `migrate_stamp_beta_baselines`). Like [`BetaBaseline`], scoped to one fund life: moves on hotkey swap and is retired when the fund drains or a dust revival starts a new life.

Purpose & Usage

Purpose

Starts at 1.0 and multiplies by 1 + stakers_value / total_root_stake on every dividend share mint, locking in the value each deposit actually added at its own realizable pricing.

Common Query Patterns

  • Sample at two blocks: the staker return over the window is Twr(t1) / Twr(t0) - 1
  • Multiply by the BetaBaseline tr_splice for the fund stake price

Notes

  • Only dividends move it; deposits, claims, and other flows never do
  • The claim-and-restake convention holds, so any two archive samples agree for every consumer
  • Accumulates from the upgrade that introduced it; earlier history lives in the seeded tr_splice
  • Scoped to one fund life like BetaBaseline: moves on hotkey swap, retired when the fund drains or revives from dust

Query Keys

#NameTypeDescription
1
validator_hotkey
AccountId [u8; 32]validator_hotkey (AccountId, hashed key component) (hex -> SS58)

Stored Value

the (FixedU128)

Default Value

18446744073709551616 0x00000000000000000100000000000000

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

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 BasketTwr storage
const validator_hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

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

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v450
Current Version
v472