InsufficientLiquidity

Error Re-added v233 → v315, v320 → v326, v334 → v377, v385 → current 7.82

Not enough liquidity in the pool for this operation.

Encountered by: stakersdeveloperswallets

Why This Error Exists

Dynamic TAO uses AMM (Automated Market Maker) pools for alpha/TAO swaps. Each pool has limited liquidity - the TAO and alpha deposited by participants. If you try to withdraw more than the pool contains, or your trade would drain the pool, this error prevents the impossible operation.

Deep Dive

SubnetAlphaIn(netuid) is the alpha in the pool. SubnetTAO(netuid) is the TAO in the pool. AMM formulas like x*y=k mean large trades dramatically affect price and may exceed available liquidity. If your tao_amount or alpha_amount exceeds what's in the pool, or would leave the pool with near-zero of either token, this fails.

Debugging Example

You call swap_tao_for_alpha(netuid=5, tao_amount=1000). Error: InsufficientLiquidity. Query SubnetTAO(5) - returns 500 TAO. Query SubnetAlphaIn(5) - returns 5000 alpha. The pool only has 500 TAO total, but you're asking for an output based on 1000 TAO input that would exceed available alpha. Solution: Reduce your trade to a fraction of pool size (try 50 TAO).

Prevention Tips

  • Check pool state before large trades
  • Keep trades to <10% of pool size for reasonable execution
  • Use allow_partial=true to get what's available instead of failing

From Chain Metadata

Not enough liquidity.

What This Means

Not enough liquidity in the pool for this operation.

Common Causes

  • Pool doesn't have enough TAO or alpha
  • Large trade relative to pool size

How to Fix

  • Reduce the trade size
  • Check SubnetAlphaIn and SubnetTAO for pool state

Storage to Check

Version History

v233 block 4,920,350 Added
v320 block 6,523,566 Re-added
v334 block 6,811,690 Re-added
v385 block 7,782,670 Re-added Current

Runtime Info

Pallet Index
7
Error Index
82
Error Code
7.82
Runtime Version
v393