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

> The alphaq Solana venue: the declaration and description of each of the 9 exports of @eco-incorp/sauce/svm.

Solana venue integration `alphaq`, exported from `@eco-incorp/sauce/svm`.

Generated from the type declarations of `@eco-incorp/sauce`.

### `ALPHAQ_PROGRAM_ID`

*Variable* · `@eco-incorp/sauce/svm`

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

### `primeAlphaqStatsAccounts`

*Function* · `@eco-incorp/sauce/svm`

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 failed
prime is not memoized: the next call tries again. A failure here never
costs the caller anything beyond "no new markets discovered this run" - the
static table still serves every market known at integration time.

The RPC is the caller's, so its answer is held to a stats account's shape:
base64 of exactly `STATS_ACCOUNT_SIZE` bytes, of which only the
16-byte symbol prefix is decoded; a symbol of the `MARKET_SYMBOL`
form; never a symbol the static table names (which stays authoritative);
and at most `MAX_RUNTIME_STATS_ACCOUNTS` entries. Anything else is
skipped.

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* · `@eco-incorp/sauce/svm`

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* · `@eco-incorp/sauce/svm`

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

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

### `fetchAlphaqPoolConfig`

*Function* · `@eco-incorp/sauce/svm`

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(owned: OwnedAccountLoader, pool: Address, now?: bigint): Promise<AlphaqPoolConfig>;
```

### `__alphaqCpQuoteForTest`

*Function* · `@eco-incorp/sauce/svm`

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 __alphaqCpQuoteForTest(x: bigint, rawA: bigint, rawB: bigint): bigint;
```

### `__alphaqDecodeSymbolForTest`

*Function* · `@eco-incorp/sauce/svm`

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

### `AlphaqStatsRpc`

*Interface* · `@eco-incorp/sauce/svm`

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* · `@eco-incorp/sauce/svm`

```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;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.