EnabledUserLiquidity

Storage Map v290 → current

Whether user liquidity is enabled per subnet .

Explore chain
Queried by: developersstakerssubnet owners

The Big Picture

When true, users can provide concentrated liquidity.

Use Cases

  • Check if LP is open
  • Verify before adding liquidity

From Chain Metadata

Indicates whether a subnet has been switched to V3 swap from V2. If `true`, the subnet is permanently on V3 swap mode allowing add/remove liquidity operations. Once set to `true` for a subnet, it cannot be changed back to `false`.

Purpose & Usage

Purpose

Controls add_liquidity availability.

Common Query Patterns

  • Query by netuid

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

value (bool)

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

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

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

Runtime Info

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