pub enum PoolError {
Show 27 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,
}
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
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl StructuralPartialEq for PoolError
Auto Trait Implementations§
impl Freeze for PoolError
impl RefUnwindSafe for PoolError
impl Send for PoolError
impl Sync for PoolError
impl Unpin for PoolError
impl UnwindSafe for PoolError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more