FeeRate

Storage Map v290 → current

Swap fee rate per subnet , normalized between 0 and u16::MAX.

Explore chain
Queried by: stakersdevelopersanalytics

The Big Picture

Fee rates determine LP earnings. ~196 = 0.3%. Higher rates = more LP income.

Use Cases

  • Calculate expected fees
  • Compare subnet LP yields
  • Display fee rates

From Chain Metadata

The fee rate applied to swaps per subnet, normalized value between 0 and u16::MAX

Purpose & Usage

Purpose

Determines fee percentage taken from each swap.

Common Query Patterns

  • Query by netuid
  • Iterate to compare subnets
Part of: Concentrated Liquidity

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

value (u16)

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

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

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

Runtime Info

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