> ## 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: goonfi-v2

> 18 exports of the goonfi-v2 venue integration in @eco-incorp/sauce/svm, including denomAdjustedFor, goonfiSwapAccounts, GOONFI_V2_PROGRAM_ID, GOONFI_GLOBAL_STATE, GOONFI_SWAP_TAG, GOONFI_OFF_MINT_A.

Solana venue integration `goonfi-v2` under `svm/venues/goonfi-v2`.

<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>

### `denomAdjustedFor`

*Function* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

denomAdjusted = ASSUMED\_DENOM \* 10^decimalsA / 10^decimalsB - the single scale constant the
live-price formula divides (xToY) or multiplies (yToX) by. Shared between fetchPoolConfig
(threshold baking) and the ladder (the runtime param) so the two can never diverge.

```typescript theme={null}
export declare function denomAdjustedFor(decimalsA: number, decimalsB: number): bigint;
```

### `goonfiSwapAccounts`

*Function* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

The 14-account order for GoonFi's real `swap` (shared by v1 buildSwap and v2 buildSwapV2) - read
back off a real captured transaction's own writable/signer flags (not guessed):
0 user(signer,w) · 1 pool(w) · 2 user mintA-ATA(w) · 3 user mintB-ATA(w) · 4 vaultA(w) ·
5 vaultB(w) · 6 mintA · 7 mintB · 8 oracle-relay · 9 GOONFI\_GLOBAL\_STATE · 10 ix-sysvar ·
11 token program · 12 token program (again) · 13 GOONFI\_CONST\_ACCOUNT\_13.
User ATA order is FIXED (mintA-ATA, mintB-ATA) regardless of direction - only the tag-1 direction
byte decides which side is pulled from vs paid into, exactly like vaultA/vaultB.

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

### `GOONFI_V2_PROGRAM_ID`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
GOONFI_V2_PROGRAM_ID: Address<"goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE">
```

### `GOONFI_GLOBAL_STATE`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

The 719,000-byte account every sampled pool's swap attaches read-only (account #9) - owned by
the GoonFi program itself, NOT written by swap (confirmed via the real tx's writable-flags
decode), so it is genuine keeper-maintained state the swap only consults. Its internal layout
is >98% zero-padded and not yet decoded; this adapter does not read it directly (the per-pool
oracle-relay account below carries the live price signal instead).

```typescript theme={null}
GOONFI_GLOBAL_STATE: Address<"BNrK9LpEn65QA4TyBLVSMdngW3XHj3xLfFPwGdCBv8wV">
```

### `GOONFI_SWAP_TAG`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

sha256-style single-byte tag observed on all 4 real captured swaps.

```typescript theme={null}
GOONFI_SWAP_TAG = 1
```

### `GOONFI_OFF_MINT_A`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
GOONFI_OFF_MINT_A = 80
```

### `GOONFI_OFF_MINT_B`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
GOONFI_OFF_MINT_B = 112
```

### `GOONFI_OFF_VAULT_A`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
GOONFI_OFF_VAULT_A = 144
```

### `GOONFI_OFF_VAULT_B`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
GOONFI_OFF_VAULT_B = 176
```

### `GOONFI_OFF_ORACLE`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

The per-pool oracle-relay account (swap account #8; see module doc).

```typescript theme={null}
GOONFI_OFF_ORACLE = 208
```

### `OFF_ORACLE_P1`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
OFF_ORACLE_P1 = 0
```

### `OFF_ORACLE_P2`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
OFF_ORACLE_P2 = 8
```

### `OFF_ORACLE_SLOT`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

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

### `OFF_ORACLE_DENOM`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
OFF_ORACLE_DENOM = 20
```

### `GOONFI_ASSUMED_DENOM`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

The denominator observed on all 4 sampled oracle-relay accounts - a fail-closed assumption:
the live denom is still read and gated against this at cook time (see ladder.ts), so a future
pool with a genuinely different denom self-deactivates instead of silently mispricing.

```typescript theme={null}
GOONFI_ASSUMED_DENOM = 1000000n
```

### `GoonfiFeeSchedule`

*Interface* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

The empirically-validated fee schedule (ppm, i.e. parts-per-1e6) - see module doc for the
measurement this pins against (tier 5 = 2200 ppm = 22.00 bps, matching a real Jupiter-quoted
10,000 USDC price impact of \~21.8 bps). Read LIVE from the pool's own bytes (not baked) so a
pool with a genuinely different admin-configured schedule is priced from its own table.

```typescript theme={null}
export interface GoonfiFeeSchedule {
    sizeTiers: readonly bigint[];
    feeTiersPpm: readonly bigint[];
}
```

### `GoonfiV2PoolConfig`

*Interface* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
export interface GoonfiV2PoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: "xToY" | "yToX";
    mintA: Address;
    mintB: Address;
    decimalsA: number;
    decimalsB: number;
    vaultA: Address;
    vaultB: Address;
    oracle: Address;
    tokenProgram: Address;
    feeSchedule: GoonfiFeeSchedule;
}
```

### `goonfiV2`

*Variable* · `sdk/dist/svm/venues/goonfi-v2/index.d.ts`

```typescript theme={null}
goonfiV2: {
    slug: string;
    kind: "constant-product";
    programId: Address<"goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE">;
    fetchPoolConfig(load: AccountLoader, pool: Address): Promise<GoonfiV2PoolConfig>;
    quoteAccounts(cfg: PoolConfig): VenueAccount[];
    buildSwap(cfg: PoolConfig, user: SwapUser, amountIn: bigint): VenueSwap;
}
```
