SubnetLeaseShares

Storage Map v290 → current

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
key1
u32 key1 (u32)
2
key2
AccountId key2 (AccountId) (hex -> SS58)

Stored Value

value (FixedU128)

Relationships

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

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("SubnetLeaseShares")](
  key1,
  key2
);

console.log("SubnetLeaseShares:", result.toHuman());

Runtime Info

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