equanetwork-math 0.0.4

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

/// Parts-per-million denominator (100% = 1_000_000).
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const PER_1M_DENOMINATOR: u64 = 1_000_000;

/// Q64.64 one (= 2^64), used for prices and exchange rates.
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const Q64_ONE: u128 = 0x1_0000_0000_0000_0000;

/// Basis-point denominator retained for wasm API compatibility.
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const BPS_DENOMINATOR: u64 = 10_000;

/// Max swap fee per vault (10%).
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const MAX_SWAP_FEE_PER_1M: u32 = 100_000;

/// Max oracle margin vs peg (10%).
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const MAX_PRICE_MARGIN_PER_1M: u32 = 100_000;

/// Max positive or negative skew contribution per vault (5%).
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const MAX_VAULT_SKEW_PER_1M: u32 = 50_000;

/// Max combined skew applied to a quote (10%).
#[cfg_attr(feature = "wasm", wasm_expose)]
pub const MAX_TOTAL_SKEW_PER_1M: i64 = 100_000;