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

> 14 exports of the metric venue integration in @eco-incorp/sauce/svm, including METRIC_PROGRAM_ID, METRIC_ORACLE_PROGRAM_ID, METRIC_OFF_MINT_A, METRIC_OFF_VAULT_A, METRIC_OFF_MINT_B, METRIC_OFF_VAULT_B.

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

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

### `METRIC_PROGRAM_ID`

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

```typescript theme={null}
METRIC_PROGRAM_ID: Address<"Bvs46DPFxiFE6YHxLDLD6QAUcmy51FyRVPZJusPxLk3j">
```

### `METRIC_ORACLE_PROGRAM_ID`

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

```typescript theme={null}
METRIC_ORACLE_PROGRAM_ID: Address<"CvGnk4HouriGypBTZhYc76esyN5kWBepWueYVeSpR1L1">
```

### `METRIC_OFF_MINT_A`

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

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

### `METRIC_OFF_VAULT_A`

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

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

### `METRIC_OFF_MINT_B`

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

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

### `METRIC_OFF_VAULT_B`

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

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

### `METRIC_OFF_ORACLE_CONFIG`

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

```typescript theme={null}
OFF_ORACLE_CONFIG = 234
```

### `METRIC_PRICE_ACCOUNT_OFFSET_IN_ORACLE_CONFIG`

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

Byte offset of the paired price account's pubkey inside the oracle config account.

```typescript theme={null}
PRICE_ACCOUNT_OFFSET_IN_ORACLE_CONFIG = 103
```

### `METRIC_SWAP_DISCRIMINATOR`

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

`swap`'s single-byte discriminator.

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

### `METRIC_CAP_DIVISOR`

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

Conservative quotable-capacity divisor (see module doc) - the ladder never quotes more than
`liveReserveOut / CAP_DIVISOR` output. Mirrors zerofi's own CAP\_DIVISOR precedent and rationale:
the venue's real depth model (the pool's own variable-length bin tail) is unrecovered, so an
unbounded flat-price quote would be unsafe; this is a deliberately conservative substitute, not a
measured true capacity.

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

### `metricScaleParams`

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

Fold a Q64.64 price (quote-per-base atoms-agnostic) plus the two mints' decimals into a
gcd-reduced (num, den) atoms-to-atoms scale: `outAtoms = inAtoms * num / den`.
`reciprocal` computes the OTHER direction's scale from the SAME price (division, not a second
baked value) - mirrors zerofi's ieee754ScaleParams direction-flip (swap num\<->den AND which side
carries the decimals adjustment).

A `METRIC_QUOTE_HAIRCUT_PPM` haircut is folded in (num scaled down by `(1e6 - haircut)/1e6`) so
the result is a lower bound on the realized fill - see that constant's doc for the measurement
that sized it. The haircut rides in the exact (num, den) pair, so `referenceQuote` stays lamport-
exact against the SAME params the emitted fragment uses.

```typescript theme={null}
export declare function metricScaleParams(priceQ64: bigint, decimalsIn: number, decimalsOut: number, reciprocal: boolean): {
    num: bigint;
    den: bigint;
};
```

### `metric`

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

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

### `metricSwapAccounts`

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

The 15-account order for Metric's `swap` (disc 0x01) - see module doc. `userAtaA`/`userAtaB`
ride FIXED slots 6/7 regardless of direction (always mintA's / mintB's side respectively); the
direction BYTE in the instruction data (not account order) tells the program which way to move
value.

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

### `MetricPoolConfig`

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

```typescript theme={null}
export interface MetricPoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: 0 | 1;
    mintA: Address;
    mintB: Address;
    vaultA: Address;
    vaultB: Address;
    oracleConfig: Address;
    priceAccount: Address;
    tokenProgramA: Address;
    tokenProgramB: Address;
    decimalsA: number;
    decimalsB: number;
    bidQ64: bigint;
    askQ64: bigint;
    scaleNum: bigint;
    scaleDen: bigint;
    bakedPrice: bigint;
}
```
