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

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

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

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

### `HUMIDIFI_PROGRAM_ID`

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

The swap-settlement program (NOT the `AubCGUt9...` route/setup program).

```typescript theme={null}
HUMIDIFI_PROGRAM_ID: Address<"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp">
```

### `HUMIDIFI_XOR_KEY`

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

The 8-byte XOR key: the program's on-chain obfuscation constant.

```typescript theme={null}
HUMIDIFI_XOR_KEY: readonly number[]
```

### `HUMIDIFI_AMOUNT_XOR_MASK`

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

The keystream of chunk 1 (bytes 8-15, amountIn) as a little-endian u64: XORing a runtime LE
amount with it is byte for byte XORing that chunk with its keystream (`patchXorMaskIn`).

```typescript theme={null}
HUMIDIFI_AMOUNT_XOR_MASK: bigint
```

### `HUMIDIFI_POOL_REGISTRY`

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

Hand-verified HumidiFi pools: for each, a real mainnet swap transaction was
decoded (obfuscation removed, account order matched) and the vault/mint
addresses were cross-checked against `preTokenBalances`/`postTokenBalances`
on that transaction. Ranked by observed activity in the sampled window;
extend by repeating the same verification (see docs/humidifi-evidence.md).

```typescript theme={null}
HUMIDIFI_POOL_REGISTRY: Record<string, HumidiFiRegistryEntry>
```

### `HUMIDIFI_SAFETY_FEE_PPM`

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

Safety haircut on the INPUT before a plain constant-product curve - NOT a
claim about HumidiFi's real fee (unknown, see file header item 6). Only
300,000 (of 1,000,000) = 30% of the input counts (a 70% haircut). Chosen
so the model stays below every one of 22 real sampled trades' realized
output ACROSS TWO DIFFERENT POOLS (worst-case margin 28.8%, on the
memecoin/USDC pool) - a 50% haircut passes the 21-trade SOL/USDC sample
but over-promises the second pool by 18.6%, so this constant is
calibrated against the worst pool sampled, not the best-sampled one.

```typescript theme={null}
HUMIDIFI_SAFETY_FEE_PPM = 300000n
```

### `humidifiKeystream`

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

The 8-byte keystream for the 8-byte chunk at 0-based index `pos`: the key XORed with the chunk's
position mask, `pos * 0x0001_0001_0001_0001` written little-endian (pos's low byte at even
offsets, its high byte at odd ones).

```typescript theme={null}
export declare function humidifiKeystream(pos: number): Uint8Array;
```

### `humidifiDeobfuscate`

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

Deobfuscate a captured 25-byte HumidiFi swap instruction (test/verification use). Each byte is
XORed with its chunk's keystream; a final partial chunk takes the leading keystream bytes. XOR
undoes itself, so the same call also obfuscates. The input is left unchanged.

```typescript theme={null}
export declare function humidifiDeobfuscate(data: Uint8Array): Uint8Array;
```

### `fetchHumidifiConfig`

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

Registry lookup + liveness check ONLY - this family's pool account carries
no plaintext structure we can decode (file header item 5), so there is
nothing further to read off it. `load(pool)` still runs once so a pool
whose account has since closed/reallocated (a stale registry entry) is
dropped like any other vanished pool, never silently misquoted.

```typescript theme={null}
export declare function fetchHumidifiConfig(owned: OwnedAccountLoader, pool: Address): Promise<HumidiFiPoolConfig>;
```

### `HumidiFiRegistryEntry`

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

```typescript theme={null}
export interface HumidiFiRegistryEntry {
    baseVault: Address;
    quoteVault: Address;
    baseMint: Address;
    quoteMint: Address;
    baseDecimals: number;
    quoteDecimals: number;
}
```

### `HumidiFiPoolConfig`

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

```typescript theme={null}
export interface HumidiFiPoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: "baseToQuote" | "quoteToBase";
    baseVault: Address;
    quoteVault: Address;
    baseMint: Address;
    quoteMint: Address;
    baseDecimals: number;
    quoteDecimals: number;
}
```


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