pub enum Error {
Show 33 variants
Solana(Error),
Market(MarketError),
Unimplemented,
InvalidArgument(&'static str),
EmptyDeposit,
EmptyWithdrawal,
EmptySwap,
InvalidPrices,
Computation(&'static str),
PoolComputation(PoolKind, &'static str),
PowComputation,
Overflow,
DividedByZero,
InvalidPoolValue(&'static str),
Convert,
BuildParams(&'static str),
MissingPoolKind(PoolKind),
MissingClockKind(ClockKind),
MintReceiverNotSet,
WithdrawalVaultNotSet,
InsufficientFundsToPayForCosts(InsolventCloseStep),
InvalidPosition(&'static str),
Liquidatable(LiquidatableReason),
NotLiquidatable,
UnableToGetBorrowingFactorEmptyPoolValue,
InsufficientReserve(String, String),
InsufficientReserveForOpenInterest(String, String),
PnlFactorExceeded(PnlFactorKind, &'static str),
MaxPoolAmountExceeded(&'static str),
MaxPoolValueExceeded(&'static str),
MaxOpenInterestExceeded,
InvalidTokenBalance(&'static str, String, String),
UnableToGetFundingFactorEmptyOpenInterest,
}
Expand description
Error type.
Variants§
Solana(Error)
Anchor error.
Market(MarketError)
Market errors from [gmsol-utils
].
Unimplemented
Unimplemented.
InvalidArgument(&'static str)
Invalid Argument.
EmptyDeposit
Empty deposit.
EmptyWithdrawal
Empty withdrawal.
EmptySwap
Empty swap.
InvalidPrices
Invalid prices.
Computation(&'static str)
Unknown computation error.
PoolComputation(PoolKind, &'static str)
Computation error in pool
PowComputation
Power computation error.
Overflow
Overflow.
DividedByZero
Divided by zero.
InvalidPoolValue(&'static str)
Invalid pool value.
Convert
Convert error.
BuildParams(&'static str)
Build params error.
MissingPoolKind(PoolKind)
Missing pool of kind.
MissingClockKind(ClockKind)
Missing clock of kind.
MintReceiverNotSet
Mint receiver not set.
WithdrawalVaultNotSet
Withdrawal vault not set.
InsufficientFundsToPayForCosts(InsolventCloseStep)
Insufficient funds to pay for cost.
InvalidPosition(&'static str)
Invalid position state.
Liquidatable(LiquidatableReason)
Liquidatable Position.
NotLiquidatable
Not liquidatable.
UnableToGetBorrowingFactorEmptyPoolValue
Unable to get borrowing factor for empty pool value.
InsufficientReserve(String, String)
Insufficient reserve.
InsufficientReserveForOpenInterest(String, String)
Insufficient reserve for open interest.
PnlFactorExceeded(PnlFactorKind, &'static str)
Pnl Factor Exceeded.
MaxPoolAmountExceeded(&'static str)
Max pool amount exceeded.
MaxPoolValueExceeded(&'static str)
Max pool value for deposit exceeded.
MaxOpenInterestExceeded
Max open interest exceeded.
InvalidTokenBalance(&'static str, String, String)
Invalid token balance.
UnableToGetFundingFactorEmptyOpenInterest
Unable to get funding factor when the open interest is empty.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
Source§impl From<MarketError> for Error
impl From<MarketError> for Error
Source§fn from(source: MarketError) -> Self
fn from(source: MarketError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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> 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