pub enum PoolError {
Show 34 variants
InvalidAmount,
InsufficientLiquidity,
MathOverflow,
InvalidPoolType,
InvalidTokenIndex,
InvalidSwapParameters,
InvalidLiquidityParameters,
PoolNotFound,
HookError(String),
Custom(String),
ZeroInvariant,
MaxInRatioExceeded,
MaxOutRatioExceeded,
InvalidInput(String),
InputTokenNotFound,
OutputTokenNotFound,
TradeAmountTooSmall,
BeforeSwapHookFailed,
AfterSwapHookFailed,
BeforeAddLiquidityHookFailed,
AfterAddLiquidityHookFailed,
BeforeRemoveLiquidityHookFailed,
AfterRemoveLiquidityHookFailed,
UnsupportedPoolType(String),
UnsupportedHookType(String),
NoStateForHook(String),
StableInvariantDidntConverge,
StableZeroBalance,
TokenAmountOutIsGreaterThanBalance,
TimestampBeforeLastUpdate,
ReClammNegativeAmountOut,
BufferWrapAmountTooSmall,
Erc4626ExceededMaxDeposit {
requested: U256,
max: U256,
},
Erc4626ExceededMaxMint {
requested: U256,
max: U256,
},
}Expand description
Errors that can occur during pool operations
Variants§
InvalidAmount
Invalid amount provided (zero or negative)
InsufficientLiquidity
Insufficient liquidity for the operation
MathOverflow
Mathematical overflow occurred
InvalidPoolType
Invalid pool type specified
InvalidTokenIndex
Invalid token index
InvalidSwapParameters
Invalid swap parameters
InvalidLiquidityParameters
Invalid liquidity parameters
PoolNotFound
Pool not found
HookError(String)
Hook error
Custom(String)
Custom error message
ZeroInvariant
Zero invariant error
MaxInRatioExceeded
Maximum input ratio exceeded
MaxOutRatioExceeded
Maximum output ratio exceeded
InvalidInput(String)
Invalid input parameters
InputTokenNotFound
Input token not found on pool
OutputTokenNotFound
Output token not found on pool
TradeAmountTooSmall
Trade amount too small
BeforeSwapHookFailed
Before swap hook failed
AfterSwapHookFailed
After swap hook failed
BeforeAddLiquidityHookFailed
Before add liquidity hook failed
AfterAddLiquidityHookFailed
After add liquidity hook failed
BeforeRemoveLiquidityHookFailed
Before remove liquidity hook failed
AfterRemoveLiquidityHookFailed
After remove liquidity hook failed
UnsupportedPoolType(String)
Unsupported pool type
UnsupportedHookType(String)
Unsupported hook type
NoStateForHook(String)
No state for hook
StableInvariantDidntConverge
Stable invariant didn’t converge
StableZeroBalance
Stable math received a zero token balance (invariant undefined unless all balances are zero)
TokenAmountOutIsGreaterThanBalance
TimestampBeforeLastUpdate
Quoting at a timestamp before the pool’s last update (e.g. backfill / reorg)
ReClammNegativeAmountOut
reCLAMM computed a negative amount out (invariant inconsistency)
BufferWrapAmountTooSmall
ERC4626 buffer wrap amount below the minimum safe threshold
Erc4626ExceededMaxDeposit
ERC4626 deposit exceeds the vault’s maxDeposit limit
Erc4626ExceededMaxMint
ERC4626 mint exceeds the vault’s maxMint limit
Trait Implementations§
Source§impl Error for PoolError
impl Error for PoolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()