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

> 9 exports of the alphaq venue integration in @eco-incorp/sauce/svm, including ALPHAQ_PROGRAM_ID, primeAlphaqStatsAccounts, __setAlphaqStatsAccountsForTest, __resetAlphaqStatsAccountsForTest, fetchAlphaqPoolConfig, __alphaqCpQuoteForTest.

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

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

### `ALPHAQ_PROGRAM_ID`

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

```typescript theme={null}
ALPHAQ_PROGRAM_ID: Address<"ALPHAQmeA7bjrVuccPsYPiCvsi428SNwte66Srvs4pHA">
```

### `primeAlphaqStatsAccounts`

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

One-time (idempotent, memoized) live join for markets not yet in
`ALPHAQ_STATS_ACCOUNTS`. Safe to call repeatedly/concurrently - every
call after the first returns the SAME in-flight/completed promise. A
failure here never throws past the caller that awaits it losing anything
beyond "no new markets discovered this run" - the static table still
serves every market known at integration time.

NOT auto-wired into `the consuming app SVM discovery module`'s gPA sweep (deliberately - it would add one extra getProgramAccounts call to EVERY discovery sweep for
a table that is already complete for every market that exists today). A
caller with its own boot sequence (the api, a CLI, a future cron) should
invoke this once with a live `getProgramAccounts` transport to pick up any
AlphaQ market added after this file was captured.

```typescript theme={null}
export declare function primeAlphaqStatsAccounts(rpc: AlphaqStatsRpc): Promise<void>;
```

### `__setAlphaqStatsAccountsForTest`

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

Test-only: seed the runtime overlay without a real RPC (LiteSVM/jest fixtures).

```typescript theme={null}
export declare function __setAlphaqStatsAccountsForTest(entries: Readonly<Record<string, Address>>): void;
```

### `__resetAlphaqStatsAccountsForTest`

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

Test-only: undo `__setAlphaqStatsAccountsForTest` / a completed prime.

```typescript theme={null}
export declare function __resetAlphaqStatsAccountsForTest(): void;
```

### `fetchAlphaqPoolConfig`

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

Decode a market (672-byte) account. Throws (caller self-drops, per
`resolveSvmPoolSpec`'s existing try/catch) on: a size mismatch; a blank
symbol; either mint outside the curated `STABLE_MINTS` set (the "SCOPE
GATE" - this ladder's quote model is only safe for a genuine stablecoin
pair); mismatched decimals (the raw-unit depth comparison's precondition);
or a stats account this integration has neither the static table nor a
live prime for. A genuinely unknown/out-of-scope/future market is
dropped, never crashed on.

```typescript theme={null}
export declare function fetchAlphaqPoolConfig(load: AccountLoader, pool: Address, now?: bigint): Promise<AlphaqPoolConfig>;
```

### `__alphaqCpQuoteForTest`

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

The symmetric constant-product model - see the module doc's "THE ACTUAL
MODEL". `D = min(rawA, rawB)` (raw units; safe because
`fetchAlphaqPoolConfig` gates decimalsA === decimalsB) is the conservative
shared depth, pinning the spot price at parity (minus the haircut) rather
than at the market's possibly-skewed raw reserve RATIO - the fix for the
favourable-mispricing bug this file's own test caught (see the module
doc's "REJECTED FIRST ATTEMPT").

```typescript theme={null}
declare function cpQuote(x: bigint, rawA: bigint, rawB: bigint): bigint;
```

### `__alphaqDecodeSymbolForTest`

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

```typescript theme={null}
declare function decodeSymbol(data: Uint8Array): string;
```

### `AlphaqStatsRpc`

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

Minimal getProgramAccounts transport for the stats-account join (data included, unlike the
pubkey-only `GetProgramAccountsRpc` discovery.ts uses for candidate scans).

```typescript theme={null}
export interface AlphaqStatsRpc {
    getProgramAccounts(program: Address, config: {
        encoding: "base64";
        filters: {
            dataSize: bigint;
        }[];
    }): {
        send(): Promise<readonly {
            pubkey: Address;
            account: {
                data: [
                    string,
                    string
                ];
            };
        }[]>;
    };
}
```

### `AlphaqPoolConfig`

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

```typescript theme={null}
export interface AlphaqPoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: "AtoB" | "BtoA";
    symbol: string;
    mintA: Address;
    mintB: Address;
    vaultA: Address;
    vaultB: Address;
    decimalsA: number;
    decimalsB: number;
    statsAccount: Address;
    priceRaw: bigint;
    priceTimestamp: bigint;
    isStablePair: boolean;
}
```
