CurrentTick

Storage Map v290 → current

Current price tick per subnet .

Explore chain
Queried by: developersanalytics

The Big Picture

Current tick determines which LP positions earn fees.

Use Cases

  • Determine active liquidity
  • Check position in-range status

From Chain Metadata

Storage for the current price tick.

Purpose & Usage

Purpose

Discrete representation of current price.

Common Query Patterns

  • Query by netuid
Part of: Concentrated Liquidity

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

value (TickIndex)

price = 1.0001^tick

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 CurrentTick storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("Swap")]
  [stringCamelCase("CurrentTick")](
  key1
);

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

Runtime Info

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