> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# svm venue: zerofi

> 19 exports of the zerofi venue integration in @eco-incorp/sauce/svm, including ZEROFI_PROGRAM_ID, ZEROFI_POOL_ACCOUNT_SIZE, ZEROFI_ORACLE_ACCOUNT_SIZE, ZEROFI_OFF_MINT_A, ZEROFI_OFF_MINT_B, ZEROFI_OFF_VAULT_A.

Solana venue integration `zerofi` under `svm/venues/zerofi`.

<Note>
  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](/programmable-transactions/sauce/architecture-and-deployments).
</Note>

### `ZEROFI_PROGRAM_ID`

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

```typescript theme={null}
ZEROFI_PROGRAM_ID: Address<"ZERor4xhbUycZ6gb9ntrhqscUcZmAbQDjEAtCf4hbZY">
```

### `ZEROFI_POOL_ACCOUNT_SIZE`

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

```typescript theme={null}
POOL_ACCOUNT_SIZE = 38176
```

### `ZEROFI_ORACLE_ACCOUNT_SIZE`

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

```typescript theme={null}
ORACLE_ACCOUNT_SIZE = 128
```

### `ZEROFI_OFF_MINT_A`

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

```typescript theme={null}
OFF_MINT_A = 72
```

### `ZEROFI_OFF_MINT_B`

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

```typescript theme={null}
OFF_MINT_B = 104
```

### `ZEROFI_OFF_VAULT_A`

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

```typescript theme={null}
OFF_VAULT_A = 136
```

### `ZEROFI_OFF_COMPANION_A`

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

```typescript theme={null}
OFF_COMPANION_A = 168
```

### `ZEROFI_OFF_VAULT_B`

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

```typescript theme={null}
OFF_VAULT_B = 200
```

### `ZEROFI_OFF_COMPANION_B`

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

```typescript theme={null}
OFF_COMPANION_B = 232
```

### `ZEROFI_OFF_ORACLE`

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

```typescript theme={null}
OFF_ORACLE = 2184
```

### `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).

```typescript theme={null}
PRICE_OFFSET = 48
```

### `ZEROFI_SWAP_DISCRIMINATOR`

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

`swap_v4`'s single-byte discriminator (NOT an 8-byte Anchor sighash).

```typescript theme={null}
ZEROFI_SWAP_DISCRIMINATOR = 16
```

### `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.

```typescript theme={null}
ZEROFI_POOL_FEE_PPM: Readonly<Record<string, bigint>>
```

### `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.

```typescript theme={null}
ZEROFI_POOL_AUTHORITY: Readonly<Record<string, {
    authority: Address;
    authorityAtaA: Address;
    authorityAtaB: Address;
}>>
```

### `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).

```typescript theme={null}
CAP_DIVISOR = 20n
```

### `zerofi`

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

```typescript theme={null}
zerofi: {
    slug: string;
    kind: "constant-product";
    programId: Address<"ZERor4xhbUycZ6gb9ntrhqscUcZmAbQDjEAtCf4hbZY">;
    fetchPoolConfig(load: AccountLoader, pool: Address, direction?: 0 | 1): Promise<ZeroFiPoolConfig>;
    quoteAccounts(cfg: PoolConfig): VenueAccount[];
    buildSwap(cfg: PoolConfig, user: SwapUser, amountIn: bigint): VenueSwap;
}
```

### `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.

```typescript theme={null}
export declare function zerofiSwapAccounts(c: ZeroFiPoolConfig, make: (ref: string, addr: Address, writable?: boolean) => VenueAccount, refFor?: (role: string) => string): VenueAccount[];
```

### `ZeroFiPoolConfig`

*Interface* · `sdk/dist/svm/venues/zerofi/index.d.ts`

```typescript theme={null}
export interface ZeroFiPoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: 0 | 1;
    mintA: Address;
    mintB: Address;
    vaultA: Address;
    vaultB: Address;
    companionA: Address;
    companionB: Address;
    oracle: Address;
    tokenProgramA: Address;
    tokenProgramB: Address;
    decimalsA: number;
    decimalsB: number;
    authority: Address;
    authorityAtaA: Address;
    authorityAtaB: Address;
    feePpm: bigint;
    scaleBakedTop: bigint;
    scaleShiftPre: bigint;
    scaleNum: bigint;
    scaleDen: bigint;
}
```

### `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).

```typescript theme={null}
export declare function ieee754ScaleParams(rawBits: bigint, decimalsA: number, decimalsB: number): {
    bakedTop: bigint;
    shiftPre: bigint;
    num: bigint;
    den: bigint;
};
```
