MaxPositions

Constant v290 → current u32

Limits position count to prevent storage bloat.

Current Value

100
Relevant for: stakersdevelopers

The Big Picture

Users must stay under this limit. Close old positions to make room for new ones.

From Chain Metadata

The maximum number of positions a user can have

Use Cases

  • Check before adding position
  • Manage position count

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 MaxPositions constant
const value = api.consts[stringCamelCase("Swap")][stringCamelCase("MaxPositions")];
console.log("MaxPositions:", value.toHuman());

Type Information

Type
u32
Byte Size
4 bytes
Encoding
fixed
Raw Hex
0x64000000

Runtime Info

Pallet
Swap
First Version
v290
Latest Version
v290
Current Runtime
v393