Skip to main content
Solana venue integration zerofi, exported from @eco-incorp/sauce/svm. Generated from the type declarations of @eco-incorp/sauce.

ZEROFI_PROGRAM_ID

Variable · @eco-incorp/sauce/svm

ZEROFI_POOL_ACCOUNT_SIZE

Variable · @eco-incorp/sauce/svm

ZEROFI_ORACLE_ACCOUNT_SIZE

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_MINT_A

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_MINT_B

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_VAULT_A

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_COMPANION_A

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_VAULT_B

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_COMPANION_B

Variable · @eco-incorp/sauce/svm

ZEROFI_OFF_ORACLE

Variable · @eco-incorp/sauce/svm

ZEROFI_PRICE_OFFSET

Variable · @eco-incorp/sauce/svm IEEE-754 f64 LE price word inside the oracle account (mintB per whole mintA).

ZEROFI_SWAP_DISCRIMINATOR

Variable · @eco-incorp/sauce/svm swap_v4’s single-byte discriminator (NOT an 8-byte Anchor sighash).

ZEROFI_POOL_FEE_PPM

Variable · @eco-incorp/sauce/svm Per-pool, per-direction fee/spread the ladder charges against the raw oracle mid, in parts-per-million, ROUNDED UP from the measured realized ratio (see module doc) so a predicted quote never exceeds the real fill - REFUSE (fetchPoolConfig throws), don’t guess, for any pool not listed here. Keyed by pool account address (the 38,176-byte account), matching solfi-v2’s POOL_K precedent: a pool is never assumed to share its neighbor’s fee.

ZEROFI_POOL_AUTHORITY

Variable · @eco-incorp/sauce/svm The registered authority + its own token-account pair, per pool - see the module doc’s “ACCOUNT 8” note. UNCONFIGURED BY DEFAULT: there is no synthesizable value (a bare PDA does not satisfy the live program’s check, see the module doc), so fetchPoolConfig throws for any pool without an entry here rather than wiring an address guaranteed to fail on-chain. Populate this once ZeroFi (or whatever registry backs the check) recognizes this deployment’s own authority.

ZEROFI_CAP_DIVISOR

Variable · @eco-incorp/sauce/svm Conservative quotable-capacity divisor: the ladder never quotes more than liveReserveOut / CAP_DIVISOR output. 20 == 5% of the live output vault. This is NOT a measured venue depth limit (the true capacity model is unresolved - see the module doc’s “ACCOUNTS 6/7” note); it is a deliberately-conservative ceiling picked so that every measured real fill in this integration’s sample (largest: 262,787,635 raw USDC against a >29B raw USDC vault, ~0.9% of reserve) sat comfortably inside it, while still being far short of “unbounded” - an unbounded linear quote is unsafe on its own (a more-favourable-than-real quote wins merge elections it cannot actually fill).

zerofi

Variable · @eco-incorp/sauce/svm

zerofiSwapAccounts

Function · @eco-incorp/sauce/svm The 14-account order for ZeroFi’s swap_v4 (disc 0x10) - see module doc for the full derivation and the measured fund-flow proof. The pool’s own vaultA/vaultB (slots 3/5, direction-selected) and the registered authority’s own ATA pair (slots 6/7) are the ONLY accounts that carry value; slot 8 is the authority’s signature. There is deliberately no user-token-account parameter - see zerofi.buildSwap’s doc.

ZeroFiPoolConfig

Interface · @eco-incorp/sauce/svm

zerofiIeee754ScaleParams

Function · @eco-incorp/sauce/svm Decode an IEEE-754 binary64 bit pattern into the ladder’s baked constants for ONE pool: bakedTop (compared live on-chain every cook), shiftPre (a mantissa right-shift, FLOOR-only - never inflates the decoded price), and the canonical (num, den) rational such that, for any LIVE bit pattern whose top 12 bits (sign + biased exponent) still equal bakedTop: liveMantissa = (liveBits & MANTISSA_MASK) | IMPLICIT_BIT reduced = liveMantissa >> shiftPre price ≈ reduced * num / den (mintA -> mintB direction) price ≈ num / (reduced * den) (mintB -> mintA direction, exact reciprocal) already folding the 2^(exponent-1075) term AND the mintA/mintB decimals difference, gcd-reduced so the on-chain fragment’s live multiply/divide never needs to carry more than ~53 live mantissa bits through a plain *//.