Skip to main content
Solana venue integration zerofi under svm/venues/zerofi.
Generated from the type declarations shipped in @eco-incorp/sauce 0.99.4. Each entry shows the package authors’ JSDoc and declaration for this SDK version. For runtime compatibility and deployed addresses, see architecture and deployments.

ZEROFI_PROGRAM_ID

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_POOL_ACCOUNT_SIZE

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_ORACLE_ACCOUNT_SIZE

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_MINT_A

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_MINT_B

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_VAULT_A

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_COMPANION_A

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_VAULT_B

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_COMPANION_B

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_OFF_ORACLE

Variable · sdk/dist/svm/venues/zerofi/index.d.ts

ZEROFI_PRICE_OFFSET

Variable · sdk/dist/svm/venues/zerofi/index.d.ts IEEE-754 f64 LE price word inside the oracle account (mintB per whole mintA).

ZEROFI_SWAP_DISCRIMINATOR

Variable · sdk/dist/svm/venues/zerofi/index.d.ts swap_v4’s single-byte discriminator (NOT an 8-byte Anchor sighash).

ZEROFI_POOL_FEE_PPM

Variable · sdk/dist/svm/venues/zerofi/index.d.ts 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 · sdk/dist/svm/venues/zerofi/index.d.ts 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 · sdk/dist/svm/venues/zerofi/index.d.ts Conservative quotable-capacity divisor: the ladder never quotes more than liveReserveOut / CAP_DIVISOR output (see ladder.ts). 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 · sdk/dist/svm/venues/zerofi/index.d.ts

zerofiSwapAccounts

Function · sdk/dist/svm/venues/zerofi/index.d.ts 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 · sdk/dist/svm/venues/zerofi/index.d.ts

zerofiIeee754ScaleParams

Function · sdk/dist/svm/venues/zerofi/ieee754.d.ts 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 *// (see ladder.ts’s module doc for why that matters).