pub enum QuoteError {
EmptyReserves,
BaseOutExceedsReserve,
FeesExceedOutput,
DepletedBondingCurve,
MathOverflow,
SlippageExceeded,
}Expand description
Quote failure modes (empty reserves, bad inputs, fee overflow, etc.).
Variants§
EmptyReserves
base_reserve or quote_reserve is zero, so the pool cannot price
any trade.
BaseOutExceedsReserve
Caller asked for base_out >= base_reserve on a buy. Equivalent
to draining the pool; the constant-product denominator would be
<= 0.
FeesExceedOutput
Sum of LP, protocol, and coin-creator fees exceeds the raw quote output — only reachable with a degenerate fee table whose total bps
10_000.
DepletedBondingCurve
Bonding curve degeneracy where real_token_reserves == virtual_token_reserves, which would zero the constant-product
denominator on a token-out buy.
MathOverflow
A u128 intermediate overflowed, or a subtraction would underflow
(e.g. sol_out >= virtual_sol_reserves on the sell_token_quote_with_sol
inverse). Surfaced from the fee-less primitive quote helpers so callers
don’t need to wrap primitive arithmetic.
SlippageExceeded
Observed market cap fell outside the caller’s target ± slippage_bps
envelope. Returned by validate_market_cap on both quote paths.
Trait Implementations§
Source§impl Clone for QuoteError
impl Clone for QuoteError
Source§fn clone(&self) -> QuoteError
fn clone(&self) -> QuoteError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuoteError
impl Debug for QuoteError
Source§impl Display for QuoteError
impl Display for QuoteError
Source§impl Error for QuoteError
impl Error for QuoteError
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()
Source§impl PartialEq for QuoteError
impl PartialEq for QuoteError
Source§fn eq(&self, other: &QuoteError) -> bool
fn eq(&self, other: &QuoteError) -> bool
self and other values to be equal, and is used by ==.impl Copy for QuoteError
impl Eq for QuoteError
impl StructuralPartialEq for QuoteError
Auto Trait Implementations§
impl Freeze for QuoteError
impl RefUnwindSafe for QuoteError
impl Send for QuoteError
impl Sync for QuoteError
impl Unpin for QuoteError
impl UnsafeUnpin for QuoteError
impl UnwindSafe for QuoteError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more