equanetwork-math 0.0.4

The Equa Network program math library
Documentation
#[cfg(feature = "wasm")]
use equanetwork_macros::wasm_expose;

pub type CoreError = &'static str;

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const ARITHMETIC_OVERFLOW: CoreError = "Arithmetic over- or underflow";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const AMOUNT_EXCEEDS_MAX_U64: CoreError = "Amount exceeds max u64";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const AMOUNT_EXCEEDS_MAX_I32: CoreError = "Amount exceeds max i32";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const DIVISION_BY_ZERO: CoreError = "Division by zero";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const INVALID_PRICE: CoreError = "Invalid price";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const INVALID_FEE: CoreError = "Invalid swap fee";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const INVALID_MARGIN: CoreError = "Price outside configured margin";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const INVALID_SKEW: CoreError = "Invalid skew parameters";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const INSUFFICIENT_LIQUIDITY: CoreError = "Insufficient vault liquidity";

#[cfg_attr(feature = "wasm", wasm_expose)]
pub const MAX_SWAP_EXCEEDED: CoreError = "Swap exceeds max_swap_amount";