Skip to main content

equanetwork_math/
error.rs

1#[cfg(feature = "wasm")]
2use equanetwork_macros::wasm_expose;
3
4pub type CoreError = &'static str;
5
6#[cfg_attr(feature = "wasm", wasm_expose)]
7pub const ARITHMETIC_OVERFLOW: CoreError = "Arithmetic over- or underflow";
8
9#[cfg_attr(feature = "wasm", wasm_expose)]
10pub const AMOUNT_EXCEEDS_MAX_U64: CoreError = "Amount exceeds max u64";
11
12#[cfg_attr(feature = "wasm", wasm_expose)]
13pub const AMOUNT_EXCEEDS_MAX_I32: CoreError = "Amount exceeds max i32";
14
15#[cfg_attr(feature = "wasm", wasm_expose)]
16pub const DIVISION_BY_ZERO: CoreError = "Division by zero";
17
18#[cfg_attr(feature = "wasm", wasm_expose)]
19pub const INVALID_PRICE: CoreError = "Invalid price";
20
21#[cfg_attr(feature = "wasm", wasm_expose)]
22pub const INVALID_FEE: CoreError = "Invalid swap fee";
23
24#[cfg_attr(feature = "wasm", wasm_expose)]
25pub const INVALID_MARGIN: CoreError = "Price outside configured margin";
26
27#[cfg_attr(feature = "wasm", wasm_expose)]
28pub const INVALID_SKEW: CoreError = "Invalid skew parameters";
29
30#[cfg_attr(feature = "wasm", wasm_expose)]
31pub const INSUFFICIENT_LIQUIDITY: CoreError = "Insufficient vault liquidity";
32
33#[cfg_attr(feature = "wasm", wasm_expose)]
34pub const MAX_SWAP_EXCEEDED: CoreError = "Swap exceeds max_swap_amount";