Swap::Error

Variant 542 v393

pallet_subtensor_swap::pallet::pallet::Error

The `Error` enum of this pallet.

About This Type

The raw extrinsic (transaction) format before signature verification.

This is the actual on-chain transaction format: a length-prefixed byte sequence containing an optional signature and the encoded call data. This is what gets broadcast to the network.

Encoding: Compact length prefix + 1-byte version/signing flag + optional (signer + signature + extra) + call bytes.

Variants (14)

IndexNameFieldsDocs
0FeeRateTooHighnoneThe fee rate is too high
1InsufficientInputAmountnoneThe provided amount is insufficient for the swap.
2InsufficientLiquiditynoneThe provided liquidity is insufficient for the operation.
3PriceLimitExceedednoneThe operation would exceed the price limit.
4InsufficientBalancenoneThe caller does not have enough balance for the operation.
5LiquidityNotFoundnoneAttempted to remove liquidity that does not exist.
6InvalidTickRangenoneThe provided tick range is invalid.
7MaxPositionsExceedednoneMaximum user positions exceeded
8TooManySwapStepsnoneToo many swap steps
9InvalidLiquidityValuenoneProvided liquidity parameter is invalid (likely too small)
10ReservesTooLownoneReserves too low for operation.
11MechanismDoesNotExistnoneThe subnet does not exist.
12UserLiquidityDisablednoneUser liquidity operations are disabled for this subnet
13SubtokenDisablednoneThe subnet does not have subtoken enabled

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 14 possible variants.
Size
variable (1+ bytes)

Examples

FeeRateTooHigh
0x00
00 Variant index 0 = FeeRateTooHigh
InsufficientInputAmount
0x01
01 Variant index 1 = InsufficientInputAmount
InsufficientLiquidity
0x02
02 Variant index 2 = InsufficientLiquidity

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Swap::Error — variant "FeeRateTooHigh"
const value = registry.createType("Swap::Error", "FeeRateTooHigh");
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (21)

and 1 more...

Also See

Type Information

Type ID
542
Kind
Variant
Path
pallet_subtensor_swap::pallet::pallet::Error
Runtime
v393