Archived documentation for
@eco-incorp/sauce@0.99.16. Install this release with npm install --save-exact @eco-incorp/sauce@0.99.16. Links to guides outside this tab open current documentation.metric, exported from @eco-incorp/sauce/svm.
Generated from the type declarations of @eco-incorp/sauce.
METRIC_PROGRAM_ID
Variable · @eco-incorp/sauce/svm
METRIC_ORACLE_PROGRAM_ID
Variable · @eco-incorp/sauce/svm
METRIC_OFF_MINT_A
Variable · @eco-incorp/sauce/svm
METRIC_OFF_VAULT_A
Variable · @eco-incorp/sauce/svm
METRIC_OFF_MINT_B
Variable · @eco-incorp/sauce/svm
METRIC_OFF_VAULT_B
Variable · @eco-incorp/sauce/svm
METRIC_OFF_ORACLE_CONFIG
Variable · @eco-incorp/sauce/svm
METRIC_PRICE_ACCOUNT_OFFSET_IN_ORACLE_CONFIG
Variable · @eco-incorp/sauce/svm
Byte offset of the paired price account’s pubkey inside the oracle config account.
METRIC_SWAP_DISCRIMINATOR
Variable · @eco-incorp/sauce/svm
swap’s single-byte discriminator.
METRIC_CAP_DIVISOR
Variable · @eco-incorp/sauce/svm
Conservative quotable-capacity divisor (see module doc) - the ladder never quotes more than
liveReserveOut / CAP_DIVISOR output. Mirrors zerofi’s own CAP_DIVISOR precedent and rationale:
the venue’s real depth model (the pool’s own variable-length bin tail) is unrecovered, so an
unbounded flat-price quote would be unsafe; this is a deliberately conservative substitute, not a
measured true capacity.
metricScaleParams
Function · @eco-incorp/sauce/svm
Fold a Q64.64 price (quote-per-base atoms-agnostic) plus the two mints’ decimals into a
gcd-reduced (num, den) atoms-to-atoms scale: outAtoms = inAtoms * num / den.
reciprocal computes the OTHER direction’s scale from the SAME price (division, not a second
baked value) - mirrors zerofi’s ieee754ScaleParams direction-flip (swap num<->den AND which side
carries the decimals adjustment).
A METRIC_QUOTE_HAIRCUT_PPM haircut is folded in (num scaled down by (1e6 - haircut)/1e6) so
the result is a lower bound on the realized fill - see that constant’s doc for the measurement
that sized it. The haircut rides in the exact (num, den) pair, so referenceQuote stays lamport-
exact against the SAME params the emitted fragment uses.
metric
Variable · @eco-incorp/sauce/svm
metricSwapAccounts
Function · @eco-incorp/sauce/svm
The 15-account order for Metric’s swap (disc 0x01) - see module doc. userAtaA/userAtaB
ride FIXED slots 6/7 regardless of direction (always mintA’s / mintB’s side respectively); the
direction BYTE in the instruction data (not account order) tells the program which way to move
value.
MetricPoolConfig
Interface · @eco-incorp/sauce/svm
