> ## 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: deriverse

> 13 exports of the deriverse venue integration in @eco-incorp/sauce/svm, including conservativeFeePpm, deriverseSwapAccounts, DERIVERSE_PROGRAM_ID, DERIVERSE_AUTH, INSTR_ACCOUNT_HEADER_MIN_SIZE, OFF_MASK.

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

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

### `conservativeFeePpm`

*Function* · `sdk/dist/svm/venues/deriverse/index.d.ts`

Bakes ONE conservative fee-ppm constant from a fetch-time snapshot of the
instrument's fee inputs. `ZeroFees` (mask bit 0x1) is a protocol invariant
that zeros BOTH the AMM fee\_rate and the protocol swap\_fee\_rate (lib.rs's
`quote()`, both branches check it first) - trusted exactly, no margin.
Otherwise: `FixedFees` (0x2) uses the admin-set static `fixed_fee_rate`;
the default case uses the DYNAMIC `day_volatility * spot_fee_rate *
FEE_RATE_STEP`, which can drift between this snapshot and the eventual
cook (it is a live, per-trade-recalculated statistic, not frozen). Either
way the raw ppm is DOUBLED plus a flat +20ppm floor: the margin absorbs
(a) day\_volatility drift and (b) the deployed binary's protocol-level
`swap_fee_rate` (currently the constant 0 in the drv-models crate, but not
independently re-derivable from account state, and a bigger assumed fee
only ever LOWERS the predicted output - the safe direction; assuming it
stays 0 is the unsafe one). This is the ONLY fee derivation this adapter
does off-chain; the ladder never reads day\_volatility/fixed\_fee\_rate live.

```typescript theme={null}
export declare function conservativeFeePpm(mask: number, dayVolatility: number, spotFeeRate: number, fixedFeeRate: number): bigint;
```

### `deriverseSwapAccounts`

*Function* · `sdk/dist/svm/venues/deriverse/index.d.ts`

The 14-account order for Deriverse's `Swap` (disc 26 - SwapInstruction::
MIN\_ACCOUNTS), shared by v1 buildSwap and v2 buildSwapV2: \[signer, asset
mint, crncy mint, asset vault, crncy vault, instrument, \{asks\_tree,
ask\_orders} on buy / \{bids\_tree, bid\_orders} on sell, lines, maps, client
infos, asset-side user ATA, crncy-side user ATA, token program]. User ATAs
are POSITIONAL BY MINT (asset vs crncy), not by direction - the same trap
documented on solfi-v2/quantum.

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

### `DERIVERSE_PROGRAM_ID`

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

```typescript theme={null}
DERIVERSE_PROGRAM_ID: Address
```

### `DERIVERSE_AUTH`

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

`find_program_address([b"ndxnt"], programId)` - ONE PDA for the whole
program (drv-smart-contract-common's `DRVS_SEED`), independent of any
pool. Hardcoded (verified against mainnet via an offline PDA derivation,
not read from any account) exactly like raydium-amm-v4's `AMM_AUTHORITY`.

```typescript theme={null}
DERIVERSE_AUTH: Address
```

### `INSTR_ACCOUNT_HEADER_MIN_SIZE`

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

The front slice of `InstrAccountHeader` this adapter reads (1064 bytes,
drv-smart-contract-common v0.2.68). The LIVE deployed account is larger
(2344 bytes observed on both checked instruments) - the extra bytes are
unread reserved tail space (candle/history buffers not yet promoted to
named fields), exactly the pattern jupiter-deriverse's own
`AccountsHolder::from_account` relies on (`&data[0..size_of::<T>()]`).
fetchPoolConfig accepts anything >= this size, never an exact match.

```typescript theme={null}
INSTR_ACCOUNT_HEADER_MIN_SIZE = 1064
```

### `OFF_MASK`

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

```typescript theme={null}
OFF_MASK = 28
```

### `OFF_LAST_PX`

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

```typescript theme={null}
OFF_LAST_PX = 32
```

### `OFF_ASSET_TOKENS`

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

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

### `OFF_CRNCY_TOKENS`

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

```typescript theme={null}
OFF_CRNCY_TOKENS = 152
```

### `OFF_DEC_FACTOR`

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

```typescript theme={null}
OFF_DEC_FACTOR = 800
```

### `MASK_SUSPENDED`

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

```typescript theme={null}
MASK_SUSPENDED = 32
```

### `DeriversePoolConfig`

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

```typescript theme={null}
export interface DeriversePoolConfig extends PoolConfig {
    venue: typeof SLUG;
    side: "buy" | "sell";
    instrId: number;
    assetTokenId: number;
    crncyTokenId: number;
    assetMint: Address;
    crncyMint: Address;
    assetVault: Address;
    crncyVault: Address;
    asksTree: Address;
    askOrders: Address;
    bidsTree: Address;
    bidOrders: Address;
    lines: Address;
    mapsAddress: Address;
    clientInfos: Address;
    tokenProgram: Address;
    feePpm: bigint;
}
```

### `deriverse`

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

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