LastPositionId

Storage Plain v290 → current

Counter for unique position IDs.

Explore chain
Queried by: developers

The Big Picture

Globally unique position IDs across all subnets.

Use Cases

  • Generate next ID
  • Count total positions

From Chain Metadata

Position ID counter.

Purpose & Usage

Purpose

Generates unique position identifiers.

Common Query Patterns

  • Single value query
Part of: Concentrated Liquidity

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Relationships

Modified By

Related Events

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 LastPositionId storage (no keys - plain value)
const result = await api.query
  [stringCamelCase("Swap")]
  [stringCamelCase("LastPositionId")]();
console.log("LastPositionId:", result.toHuman());

Runtime Info

View Source
Pallet
Swap
Storage Kind
Plain
First Version
v290
Current Version
v393