Swap::Error

Variant 521 v411

pallet_subtensor_swap::pallet::pallet::Error

The `Error` enum of this pallet.

About This Type

Error enum for the pallet pallet.

Contains all error types that the pallet pallet can return when a call fails.

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

Also See

Type Information

Type ID
521
Kind
Variant
Path
pallet_subtensor_swap::pallet::pallet::Error
Runtime
v411