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

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

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

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

### `CREMA_PROGRAM_ID`

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

```typescript theme={null}
CREMA_PROGRAM_ID: Address<"CLMM9tUoggJu2wagPkkqs9eFG4BWhVBZWkP1qv3Sp7tR">
```

### `CLMMPOOL_ACCOUNT_SIZE`

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

```typescript theme={null}
CLMMPOOL_ACCOUNT_SIZE = 748
```

### `CLMMPOOL_DISCRIMINATOR`

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

sha256('account:Clmmpool')\[0..8].

```typescript theme={null}
CLMMPOOL_DISCRIMINATOR: number[]
```

### `CREMA_TICK_ARRAY_ACCOUNT_SIZE`

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

```typescript theme={null}
CREMA_TICK_ARRAY_ACCOUNT_SIZE = 8556
```

### `CREMA_TICK_ARRAY_DISCRIMINATOR`

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

sha256('account:TickArray')\[0..8] - byte-identical to orca-whirlpool's own (name-derived, not program-derived).

```typescript theme={null}
CREMA_TICK_ARRAY_DISCRIMINATOR: number[]
```

### `TICK_ARRAY_MAP_ACCOUNT_SIZE`

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

```typescript theme={null}
TICK_ARRAY_MAP_ACCOUNT_SIZE = 876
```

### `TICK_ARRAY_MAP_DISCRIMINATOR`

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

sha256('account:TickArrayMap')\[0..8].

```typescript theme={null}
TICK_ARRAY_MAP_DISCRIMINATOR: number[]
```

### `CREMA_TICK_ARRAY_SIZE`

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

```typescript theme={null}
CREMA_TICK_ARRAY_SIZE = 64
```

### `CREMA_OFF_TICK_SPACING`

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

```typescript theme={null}
CREMA_OFF_TICK_SPACING = 168
```

### `CREMA_OFF_FEE_RATE`

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

```typescript theme={null}
CREMA_OFF_FEE_RATE = 172
```

### `CREMA_OFF_LIQUIDITY`

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

```typescript theme={null}
CREMA_OFF_LIQUIDITY = 174
```

### `CREMA_OFF_SQRT_PRICE`

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

```typescript theme={null}
CREMA_OFF_SQRT_PRICE = 190
```

### `CREMA_OFF_TICK_CURRENT`

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

```typescript theme={null}
CREMA_OFF_TICK_CURRENT = 206
```

### `OFF_TA_ARRAY_INDEX`

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

```typescript theme={null}
OFF_TA_ARRAY_INDEX = 8
```

### `CREMA_OFF_TA_TICKS`

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

```typescript theme={null}
CREMA_OFF_TA_TICKS = 44
```

### `CREMA_TICK_LEN`

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

```typescript theme={null}
CREMA_TICK_LEN = 133
```

### `CREMA_MAX_BOUNDARIES`

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

Shipped initialized-tick boundaries per direction - same budget class as orca-whirlpool/raydium-clmm.

```typescript theme={null}
CREMA_MAX_BOUNDARIES = 4
```

### `crema`

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

The Crema Finance venue: a concentrated-liquidity AMM with Orca Whirlpool's layout and math.

```typescript theme={null}
crema: {
    slug: string;
    programId: Address<"CLMM9tUoggJu2wagPkkqs9eFG4BWhVBZWkP1qv3Sp7tR">;
    tokenProgram: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
    fetchPoolConfig: typeof fetchCremaPoolConfig;
}
```

### `fetchCremaPoolConfig`

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

Fetch + decode one Clmmpool and freeze both directions' boundary windows. Read-only against the loader.

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

### `CREMA_MAX_TICK_INDEX`

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

```typescript theme={null}
CREMA_MAX_TICK_INDEX = 443636
```

### `CREMA_MIN_TICK_INDEX`

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

Orca Whirlpools tick math - exact transcription of
`programs/whirlpool/src/math/tick_math.rs` `sqrt_price_from_tick_index` in
orca-so/whirlpools ([https://github.com/orca-so/whirlpools](https://github.com/orca-so/whirlpools)) at commit
8ab2e923138badb2fcb1069cc9947f44df3e48eb, Copyright (c) 2022 Orca Foundation, licensed under
the Apache License, Version 2.0 (see THIRD\_PARTY\_NOTICES.md):
positive ticks accumulate in Q96 with `(r * C) >> 96` steps and a final `>> 32`,
negative ticks accumulate in Q64 with `(r * C) >> 64` steps. Verified against
the source's own pinned bit-value test table (see the unit suite).

Shared by fetchPoolConfig (deriving the shipped boundary sqrt prices), the
ladder mirror and the test fixtures. sqrt\_price\_from\_tick\_index is a pure
function of the tick, which is why a prepare-shipped sqrt price is exact
by construction - the engine-side fragment never recomputes it (an in-VM
bit ladder costs \~54k CU per call on the interpreter).

```typescript theme={null}
CREMA_MIN_TICK_INDEX = -443636
```

### `CremaBoundary`

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

```typescript theme={null}
export interface CremaBoundary {
    arrayIndex: number;
    offset: number;
    tick: number;
    sqrtPrice: bigint;
}
```

### `CremaWindow`

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

```typescript theme={null}
export interface CremaWindow {
    tickArrays: [
        Address,
        Address,
        Address
    ];
    arrayIndices: [
        number,
        number,
        number
    ];
    startTicks: [
        number,
        number,
        number
    ];
    boundaries: CremaBoundary[];
    edge: {
        tick: number;
        sqrtPrice: bigint;
    } | null;
    readable: number;
}
```

### `CremaPoolConfig`

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

```typescript theme={null}
export interface CremaPoolConfig extends PoolConfig {
    venue: typeof SLUG;
    direction: "aToB" | "bToA";
    tokenMintA: Address;
    tokenMintB: Address;
    tokenVaultA: Address;
    tokenVaultB: Address;
    clmmConfig: Address;
    tickArrayMap: Address;
    tickSpacing: number;
    feeRate: number;
    liquidity: bigint;
    sqrtPrice: bigint;
    tickCurrentIndex: number;
    windows: {
        aToB: CremaWindow;
        bToA: CremaWindow;
    };
}
```


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