BetaIndexFundSample

Storage Map v450 → current

Map (validator_hotkey) to the fund last completed index-sweep sample: NAV, display price, and stake price.

Explore chain
Queried by: analyticsdevelopers

The Big Picture

A chained index is only as honest as its per-period relatives. Sampling every fund at the end of each pass, and refusing to chain across gaps in a fund life, is what keeps deposits, retirements, and revivals from ever registering as market moves.

Why This Matters

This is the audit trail for the index. Anyone can recompute a pass from these samples and confirm the published levels.

Example Scenario

A fund sampled at NAV 1,000 TAO and display 1.20 shows display 1.26 on the next pass. It contributes a 1.05 relative at weight 1,000 to that pass index update.

Use Cases

  • Reproduce an index level change from per-fund relatives
  • Audit that a fund contribution to the index used realizable pricing

From Chain Metadata

MAP ( validator_hotkey ) --> the fund's last completed index-sweep sample (see [`BetaIndexFundSampleOf`]). Written by the sweep as it visits each fund (the current pass's sample replaces the previous pass's in the same visit) and consumed as the start-of-period state of the next pass's price relative. Removed when the fund becomes unpriceable, retires, or starts a new life, so no relative ever chains across a gap in the fund's history.

Purpose & Usage

Purpose

The start-of-period state the next sweep pass chains against. The fund next price relative is display now over the sampled display, weighted by the sampled NAV.

Common Query Patterns

  • Query by validator hotkey to see the exact state the index last measured for a fund

Notes

  • Weighting by start-of-period NAV means deposits and redemptions between passes change the weight but never fabricate a return
  • Each pass replaces the previous sample in the same visit
  • Removed when the fund becomes unpriceable, retires, or starts a new life, so no relative ever chains across a gap in fund history

Query Keys

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

Stored Value

the (BetaIndexFundSampleOf)

Default Value

None (absent keys return no value)

Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.

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

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

Runtime Info

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