> For the complete documentation index, see [llms.txt](https://docs.rpcfast.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rpcfast.com/rpc-fast-saas-solana/solana-rpc-methods/defi-queries-acceleration.md).

# Quark: DeFi Queries Acceleration

{% hint style="info" %}
**Quark** is our in-house developed solution to speed up RPC for traders & searchers.
{% endhint %}

## How it Works

Mainnet DeFi `getProgramAccounts` queries **get accelerated** by RPC Fast's custom-built accounts engine, including eligible programs, commitments, and filter shapes.

RPC Fast automatically routes eligible Mainnet Beta `getProgramAccounts` and `getProgramAccountsPaginated` requests through a custom-built accounts engine. It replaces broad program scans with bounded account-type, mint, or account-key indexes for selected DeFi protocols. You keep the same RPC endpoint and the standard Solana account response shape.

Queries that do not match the shapes below continue through the normal RPC path. Acceleration is therefore additive; no client-side routing or protocol-specific API is required.

## Common Requirements

An accelerated request must:

* use one of the program IDs listed below;
* set `encoding` explicitly to `base64`;
* include a non-empty `filters` array;
* use `processed`, `confirmed`, or `finalized` commitment (omitting `commitment` uses `finalized`);
* use standard `dataSize` and `memcmp` filters. Mint and account-key filters must decode to exactly 32 bytes; `memcmp.bytes` may be base58 or base64.

`processed` and `finalized` requests are served from separate views at their own commitment. `confirmed` requests are served from the `finalized` view; use `processed` when you need the freshest state.

All supplied filters are applied to the returned accounts. `dataSlice`, `withContext`, and `minContextSlot` are supported.

For `getProgramAccountsPaginated`, `limit` must be a positive integer and `paginationKey`, when present, must be the opaque string returned by the previous page. Accelerated compact index queries support up to 1,000 accounts per page; PumpSwap, Raydium AMM v4, Jupiter v6, HumidiFi, and Kamino Lending support up to 10,000. See [getProgramAccountsPaginated](/rpc-fast-saas-solana/solana-rpc-methods.md#getprogramaccountspaginated) for the complete pagination contract.

## Eligible Programs and Filter Shapes

All entries below support `processed`, `confirmed`, and `finalized`, except Meteora DAMM v1, which supports `confirmed` and `finalized` only.

| Protocol and account type                                    | Program ID                                     | Required accelerated filter shape                                                                                                                                                                                                                                                                    | Official query or account example                                                                                                                                                                                                                            |
| ------------------------------------------------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Pump.fun PumpSwap `Pool`                                     | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`  | One or both 32-byte mint `memcmp` filters: base mint at offset `43`, quote mint at `75`. Optional account selectors: `dataSize: 301` (current layout) or `300` (pools created before the 301-byte layout), discriminator `hQrXeCntzbV` at offset `0`. Without `dataSize`, both layouts are returned. | [PumpSwap Pool account](https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_SWAP_README.md#pool)                                                                                                                                                |
| Orca Whirlpools `Whirlpool`                                  | `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc`  | One or both 32-byte mint filters: token A at offset `101`, token B at `181`. Optional selectors: `dataSize: 653`, discriminator `BdrfaPg3xM6` at offset `0`.                                                                                                                                         | [Fetch pools by token pair](https://docs.orca.so/developers/sdks/pools/monitor-pools#fetching-pools-by-token-pairs)                                                                                                                                          |
| Orca Whirlpools `TickArray` and `DynamicTickArray`           | `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc`  | 32-byte whirlpool filter at offset `9956` for `TickArray` (optional selectors: `dataSize: 9988`, discriminator `Cc6F4MyvbgN`), or at offset `12` for `DynamicTickArray` (optional selector: discriminator `3z9JotG6VfM`).                                                                            | [`fetchAllTickArrayWithFilter` and whirlpool filters](https://github.com/orca-so/whirlpools/blob/main/ts-sdk/client/src/gpa/tickArray.ts)                                                                                                                    |
| Meteora DAMM v1 `Pool`                                       | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | One or both 32-byte mint filters: token A at offset `40`, token B at `72`. Optional selector: discriminator `hQrXeCntzbV` at offset `0`. `confirmed` and `finalized` only.                                                                                                                           | [`searchPoolsByToken`](https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/amm/index.ts)                                                                                                                                                        |
| Meteora DAMM v2 `Pool`                                       | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG`  | One or both 32-byte mint filters: token A at offset `168`, token B at `200`; or a 32-byte filter on token A vault at `232`, token B vault at `264`, or whitelisted vault at `296`. Optional selectors: `dataSize: 1112`, discriminator `hQrXeCntzbV` at offset `0`.                                  | [Fetch DAMM v2 pools by token mint](https://github.com/MeteoraAg/meteora-sdk-skill/blob/main/meteora-sdks/references/damm-v2.md#pool-state)                                                                                                                  |
| Meteora DLMM `LbPair`                                        | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo`  | One or both 32-byte mint filters: token X at offset `88`, token Y at `120`. Optional selectors: `dataSize: 904`, discriminator `6XZoLajBWVJ` at offset `0`.                                                                                                                                          | [DLMM pool discovery methods](https://github.com/MeteoraAg/docs/blob/main/developer-guides/dlmm/typescript-sdk/reference.mdx#static-discovery-methods)                                                                                                       |
| Meteora DLMM `PositionV2`                                    | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo`  | 32-byte owner filter at offset `40`. Optional selector: discriminator `LgkNAEYaVX3` at offset `0`.                                                                                                                                                                                                   | [DLMM position queries](https://github.com/MeteoraAg/docs/blob/main/developer-guides/dlmm/typescript-sdk/reference.mdx#querying-positions)                                                                                                                   |
| Meteora DBC `VirtualPool`                                    | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`  | 32-byte base mint filter at offset `136`.                                                                                                                                                                                                                                                            | [DBC `VirtualPool` account](https://github.com/MeteoraAg/dynamic-bonding-curve/blob/main/programs/dynamic-bonding-curve/src/state/virtual_pool.rs)                                                                                                           |
| Raydium AMM v4 `LiquidityStateV4`                            | `675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8` | One or both 32-byte mint filters: base mint at offset `400`, quote mint at `432`. Optional selector: `dataSize: 752`.                                                                                                                                                                                | [Official `getProgramAccounts` all-pools example](https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/pool/fetchAllPools.ts)                                                                                                                   |
| Raydium CLMM `PoolState`                                     | `CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK` | One or both 32-byte mint filters: mint 0 at offset `73`, mint 1 at `105`. Optional selector: `dataSize: 1544`.                                                                                                                                                                                       | [Official `getProgramAccounts` all-pools example](https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/pool/fetchAllPools.ts)                                                                                                                   |
| Raydium CLMM `TickArrayState` and `TickArrayBitmapExtension` | `CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK` | 32-byte pool ID filter at offset `8`. Optional selectors: `dataSize: 10240` and discriminator `ZDXZt35PxpR` for `TickArrayState`; `dataSize: 1832` and discriminator `B8mNGVuGQv4` for `TickArrayBitmapExtension`. Without a selector, both types are returned.                                      | [`TickArrayState`](https://github.com/raydium-io/raydium-clmm/blob/master/programs/amm/src/states/tick_array.rs), [`TickArrayBitmapExtension`](https://github.com/raydium-io/raydium-clmm/blob/master/programs/amm/src/states/tickarray_bitmap_extension.rs) |
| Raydium CPMM `PoolState`                                     | `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` | One or both 32-byte mint filters: token 0 at offset `168`, token 1 at `200`. Optional selectors: `dataSize: 637`, discriminator `iUE1qg7KXeV` at offset `0`.                                                                                                                                         | [Official `getProgramAccounts` all-pools example](https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/pool/fetchAllPools.ts)                                                                                                                   |
| Raydium LaunchLab `PoolState`                                | `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj`  | One or both 32-byte mint filters: base mint at offset `205`, quote mint at `237`.                                                                                                                                                                                                                    | [LaunchLab pool layout](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/layout.ts)                                                                                                                                            |
| Jupiter v6 `TokenLedger`                                     | `JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4`  | `dataSize: 48` and a `memcmp` at offset `0` beginning with discriminator `TFkui5QKQvG`. Additional filters are allowed.                                                                                                                                                                              | [Jupiter Token Ledger flow](https://developers.jup.ag/docs/swap/v1/build-swap-transaction) — this flow does not discover ledgers with `getProgramAccounts`.                                                                                                  |
| HumidiFi pool accounts                                       | `9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp` | `dataSize: 1728`. Additional filters are allowed.                                                                                                                                                                                                                                                    | [Public HumidiFi litepaper](https://dtf.jup.ag/file/wet-litepaper.pdf) — no official public account-query example is currently available.                                                                                                                    |
| Kamino Lending `Obligation`                                  | `KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD`  | `dataSize: 3344`. Additional filters are allowed.                                                                                                                                                                                                                                                    | [Print all obligation accounts](https://github.com/Kamino-Finance/klend-sdk#printing-all-obligations)                                                                                                                                                        |

The optional account selectors shown for indexed layouts are recommended when your integration already knows the account type, but they are not required for acceleration. The mint or account-key filters are required exactly as listed.

When a program has several accelerated account types and your filters do not pin one with `dataSize` or the discriminator, every type that can serve the filter shape is queried and the results are combined. For example, a Raydium CLMM request with only a pool ID filter at offset `8` returns both `TickArrayState` and `TickArrayBitmapExtension` accounts.

{% hint style="warning" %}
Raydium AMM v4 requests with a 32-byte `memcmp` at offset `384` or `416` are rejected with error `-32602`. These offsets are 16 bytes before the base and quote mints; use `400` and `432` instead.
{% endhint %}

### How protocol SDK queries map to acceleration

Protocol documentation may show an SDK helper rather than the raw RPC request it generates. Acceleration applies only when the client actually sends `getProgramAccounts` or `getProgramAccountsPaginated` with an eligible shape.

| Protocol | RPC behavior in the official example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Current acceleration coverage                                                                                                                                                                                                                                                                |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Orca     | [`fetchWhirlpoolsByTokenPair`](https://docs.orca.so/developers/sdks/pools/monitor-pools#fetching-pools-by-token-pairs) first uses `getProgramAccounts` to read `FeeTier` accounts for a Whirlpools config. It then derives pool addresses and reads them with `getMultipleAccounts`. Orca's lower-level [`fetchAllWhirlpoolWithFilter`](https://github.com/orca-so/whirlpools/blob/main/ts-sdk/client/src/gpa/whirlpool.ts) and [`fetchAllTickArrayWithFilter`](https://github.com/orca-so/whirlpools/blob/main/ts-sdk/client/src/gpa/tickArray.ts) issue account GPAs with a discriminator and caller-selected filters. | Whirlpool-account GPA is accelerated when it includes a mint filter at offset `101` or `181`. Tick-array GPA is accelerated with the whirlpool filter. Config-only, tick-spacing, fee-rate, vault, reward, and other Orca account-type queries do not currently match the accelerated shape. |
| Raydium  | The official [`fetchAllPools` example](https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/pool/fetchAllPools.ts) issues `dataSize`-only GPA requests for AMM v4, CLMM, and CPMM.                                                                                                                                                                                                                                                                                                                                                                                                                          | Size-only all-pools scans are not accelerated. GPA requests containing the required one-mint or two-mint filters listed above are accelerated, as are CLMM tick-array lookups by pool ID.                                                                                                    |
| Meteora  | DAMM v1 [`searchPoolsByToken`](https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/amm/index.ts) issues two pool GPAs, one per mint offset. DLMM [position queries](https://github.com/MeteoraAg/docs/blob/main/developer-guides/dlmm/typescript-sdk/reference.mdx#querying-positions) read `PositionV2` accounts by owner.                                                                                                                                                                                                                                                                                 | DAMM v1 single-mint pool GPAs are accelerated at `finalized` and `confirmed`. DLMM `PositionV2` GPAs are accelerated when they include the owner filter at offset `40`.                                                                                                                      |
| Pump.fun | The public PumpSwap documentation describes the Pool layout and PDA/SDK flows, but does not publish a `getProgramAccounts` pool-discovery example.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Raw GPA integrations with a base-mint or quote-mint filter are accelerated.                                                                                                                                                                                                                  |
| Jupiter  | The official [Token Ledger flow](https://developers.jup.ag/docs/swap/v1/build-swap-transaction) creates and uses a known ledger account; it does not discover Token Ledger accounts with GPA.                                                                                                                                                                                                                                                                                                                                                                                                                            | Custom raw GPA queries for `TokenLedger` are accelerated when they include the required size and discriminator. Additional standard filters are reapplied.                                                                                                                                   |

Other methods such as `getAccountInfo` and `getMultipleAccounts` do not use this GPA acceleration path.

### Pair lookup example

The official Orca helper linked above does not send this Whirlpool GPA: it scans fee tiers, derives pool PDAs, and reads the derived addresses. The request below is the accelerated raw-RPC shape for discovering initialized Whirlpool accounts by both mints. It uses the same SOL/devUSDC pair as Orca's [official pool-monitoring example](https://docs.orca.so/developers/sdks/pools/monitor-pools#fetching-pools-by-token-pairs). Replace the mints with the pair you need.

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getProgramAccounts",
  "params": [
    "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc",
    {
      "commitment": "processed",
      "encoding": "base64",
      "filters": [
        { "dataSize": 653 },
        {
          "memcmp": {
            "offset": 101,
            "bytes": "So11111111111111111111111111111111111111112"
          }
        },
        {
          "memcmp": {
            "offset": 181,
            "bytes": "BRjpCHtyQLNCo8gqRUr8jtdAj5AjPYQaoqbvcZiHok1k"
          }
        }
      ]
    }
  ]
}
```

Every mint-indexed pool layout above also accepts a single mint filter at either listed offset; Meteora DBC requires its base mint filter.

### Bounded account-type example

Jupiter v6 Token Ledger acceleration requires both its exact account size and discriminator.

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getProgramAccountsPaginated",
  "params": [
    "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
    {
      "commitment": "finalized",
      "encoding": "base64",
      "filters": [
        { "dataSize": 48 },
        {
          "memcmp": {
            "offset": 0,
            "bytes": "TFkui5QKQvG"
          }
        }
      ],
      "limit": 1000,
      "paginationKey": null
    }
  ]
}
```

HumidiFi and Kamino Lending use the same request shape with only their required `dataSize` filter. Additional standard filters can narrow the result further.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rpcfast.com/rpc-fast-saas-solana/solana-rpc-methods/defi-queries-acceleration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
