> 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 or mint 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 filters must decode to exactly 32 bytes; `memcmp.bytes` may be base58 or base64.

All supplied filters are applied to the returned accounts. `dataSlice` and `withContext` 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 mint-index queries support up to 1,000 accounts per page; other accelerated layouts 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`.

| 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`, discriminator `hQrXeCntzbV` at offset `0`. | [PumpSwap Pool account](https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_SWAP_README.md#pool)                                               |
| Orca Whirlpools `Whirlpool`       | `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc`  | 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)                                         |
| Meteora DAMM v2 `Pool`            | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG`  | Both 32-byte mint filters: token A at offset `168`, token B at `200`. 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`  | 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)      |
| 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 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)                  |
| 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 mint-indexed layouts are recommended when your integration already knows the account type, but they are not required for acceleration. The mint filters are required exactly as listed.

### 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) does issue a Whirlpool-account GPA with a discriminator and caller-selected filters. | Whirlpool-account GPA is accelerated when it includes both mint filters at offsets `101` and `181`. Single-mint, 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.                                                                                                         |
| 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"
          }
        }
      ]
    }
  ]
}
```

For PumpSwap, Raydium AMM v4, Raydium CLMM, and Raydium CPMM, a single mint filter at either listed offset is also eligible. Orca Whirlpools, Meteora DAMM v2, and Meteora DLMM require both mint filters.

### 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": "confirmed",
      "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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
