SwapV3Initialized

Storage Map v290 → current

Whether V3 swap is initialized for a subnet .

Explore chain
Queried by: developerssubnet owners

The Big Picture

Once true, subnet uses V3. Cannot revert to V2.

Use Cases

  • Check if LP is possible
  • Determine swap version

From Chain Metadata

Storage to determine whether swap V3 was initialized for a specific subnet.

Purpose & Usage

Purpose

Tracks if subnet uses concentrated liquidity.

Common Query Patterns

  • Query by netuid

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

value (bool)

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

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

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

Runtime Info

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