SubnetLeaseShares

Storage Map v290 → v411 Changed in v411

Share ownership in subnet leases.

Explore chain
Queried by: stakersdevelopersanalytics

The Big Picture

Lease contributors own shares proportional to their contribution. This tracks each contributors shares for dividend distribution.

Use Cases

  • Check your lease shares
  • Calculate share value
  • Build lease portfolio tools

From Chain Metadata

DMAP ( lease_id, contributor ) --> shares | The shares of a contributor for a given lease.

Purpose & Usage

Purpose

Track each contributors share in a lease.

Common Query Patterns

  • Query by (lease_id, contributor)

Query Keys

#NameTypeDescription
1
lease_id
u32 lease_id (u32, hashed key component)
2
contributor
AccountId contributor (AccountId, hashed key component) (hex -> SS58)

Stored Value

shares (FixedU128)

Decoding the value

FixedU128 (Q64.64 fixed-point)

FixedU128 encodes as Q64.64: raw bits divided by 2^64 gives the rational. Magnitude > 0 means non-zero.

const fraction = Number(value as bigint) / 2 ** 64;

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 SubnetLeaseShares storage
const lease_id = 0;
const contributor = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.SubtensorModule.SubnetLeaseShares.getValue(lease_id, contributor);
console.log("SubnetLeaseShares:", result);

Version History

v290 block 5,947,548 Added
v307–v314 · runtime versions skipped on chain (never deployed)
v315 block 6,414,634 Internal re-bind
v316–v319 · runtime versions skipped on chain (never deployed)
v320 block 6,523,566 Internal re-bind
v327–v333 · runtime versions skipped on chain (never deployed)
v334 block 6,811,690 Internal re-bind
v353–v360 · runtime versions skipped on chain (never deployed)
v361 block 7,063,679 Internal re-bind
v363–v364 · runtime versions skipped on chain (never deployed)
v365 block 7,135,419 Internal re-bind
v378–v384 · runtime versions skipped on chain (never deployed)
v385 block 7,782,670 Internal re-bind
v386–v390 · runtime versions skipped on chain (never deployed)
v391 block 7,782,857 Internal re-bind
v394–v400 · runtime versions skipped on chain (never deployed)
v401 block 8,036,576 Internal re-bind
v403–v410 · runtime versions skipped on chain (never deployed)
v411 block 8,283,784 Internal re-bind Current

Runtime Info

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