Structs§
- Price
Band - Inclusive Q64.64 interval.
- Swap
Quote - Vault
Swap Limits
Enums§
- Skew
Exponent - Polynomial degree for inventory skew outside the dead zone.
Constants§
- AMOUNT_
EXCEEDS_ MAX_ I32 - AMOUNT_
EXCEEDS_ MAX_ U64 - ARITHMETIC_
OVERFLOW - BPS_
DENOMINATOR - Basis-point denominator retained for wasm API compatibility.
- DIVISION_
BY_ ZERO - INSUFFICIENT_
LIQUIDITY - INVALID_
FEE - INVALID_
MARGIN - INVALID_
PRICE - INVALID_
SKEW - MAX_
PRICE_ MARGIN_ PER_ 1M - Max oracle margin vs peg (10%).
- MAX_
SWAP_ EXCEEDED - MAX_
SWAP_ FEE_ PER_ 1M - Max swap fee per vault (10%).
- MAX_
TOTAL_ SKEW_ PER_ 1M - Max combined skew applied to a quote (10%).
- MAX_
VAULT_ SKEW_ PER_ 1M - Max positive or negative skew contribution per vault (5%).
- PER_
1M_ DENOMINATOR - Parts-per-million denominator (100% = 1_000_000).
- Q64_ONE
- Q64.64 one (= 2^64), used for prices and exchange rates.
Functions§
- apply_
swap_ fee_ per_ 1m - Retain
fee_per_1mppm ofamountin the vault (returns the swapped portion). - apply_
total_ skew_ per_ 1m - Apply combined skew (ppm) to fair output.
- assert_
synthetic_ oracle_ within_ execution - Combined synthetic oracle band must lie inside the combined execution-price band.
- average_
skew_ per_ m - Path-average skew (ppm) over
[balance_pre, balance_post]. - base_
out_ 1_ to_ 1 - Decimal-aware 1:1 conversion (UI-unit parity).
- bitmap_
contains - bitmap_
set - bitmap_
unset - combine_
feed_ band - Combined feed band from two
[mid ± conf]observations. - combine_
price_ band - Combined band from two price intervals:
lo = in_lo / out_hi,hi = in_hi / out_lo. - combine_
prices_ q64 - Combined pair rate
price_in / price_outin Q64.64. - compute_
skew_ per_ m - Instantaneous vault skew contribution (ppm) at
balancefor a move inincreasingdirection. - default_
price_ q64 - Identity Q64.64 price (1.0) used when no price source or feed is configured.
- deviation_
per_ m - Map inventory balance to signed deviation in ppm (−1e6..=+1e6). Dead zone → 0; outer limits → ±1e6.
- div_q64
- Convert amount / Q64.64 price → amount (floor or ceil).
- fair_
out_ with_ prices - Fair output from Q64.64 prices (no skew, no fee).
- mul_q64
- Convert amount · Q64.64 price → amount (floor or ceil).
- one_q64
- Identity price (1.0 in Q64.64).
- price_
band_ with_ margin [price * (1 − margin), price * (1 + margin)]in Q64.64.- quote_
network_ swap - Quote a network swap (prices + fees + skew). No oracle input.
- ratio_
to_ q64 - Q64.64 ratio
numerator / denominator. - vault_
skew_ contribution_ per_ 1m - Inventory skew contribution for one vault (signed ppm): path-average over the fill.