Skip to content
Pool Manager

Discover pools

Find grapl pools directly from RPC by mint or pair, without an API key, wallet, or indexer.

Use findPools to discover the current pool accounts owned by a configured grapl deployment. It accepts a mint, an optional paired mint, or no mint filter. The scan targets Pool6; older account versions are excluded by an explicit version filter. Pools with hooks, direct CLMM pools, and virtual-reserve curve pools share the same discovery path.

Query a mint or pair

Use deployment configuration from a trusted source. The expected genesis hash pins the network independently of the RPC URL. The SDK is currently a source package; follow Getting started for package availability.

import { createKitRpcPort, findPools } from "@grapl/sdk";
import type { Address } from "@solana/kit";

export async function discoverPair(
  rpcUrl: string,
  programAddress: Address,
  genesisHash: string,
  mint: Address,
  pairedMint: Address,
) {
  return findPools({
    rpc: createKitRpcPort(rpcUrl),
    programAddress,
    genesisHash,
    mint,
    pairedMint,
  });
}

Omit pairedMint to find every pair containing mint. Omit both to scan all pools. An existing GraplClient also exposes client.findPools({ mint, pairedMint }); a fee payer is not required by the standalone function.

Each result contains address, slot: bigint, and decoded state. The state includes mints, vaults, creator, configuration, hook program, mode, current tick, square-root price and active liquidity. Wide quantities remain bigint.

Understand the result

The default RPC adapter reads at finalized commitment. A mint search queries both mint fields, validates every returned account, filters the other mint if supplied, and deduplicates by pool address. If the two scans observe different slots, the newest observation wins for duplicate addresses. Each result retains its own slot; the result is not an atomic cross-pool snapshot.

The decoder verifies owner, discriminator, Pool6 size/version, canonical PDA and bump. A custom RPC adapter must implement getPoolAccounts, supply matching account/context slots, and report whether its scan is complete. Incomplete scans and responses below minContextSlot reject; the SDK never silently labels a truncated provider response as complete. Standard RPC has no portable GPA pagination, so providers must support the complete filtered request.

Discovery returns candidates, not executable quotes. A pool may have zero active liquidity, out-of-range liquidity, curve inventory constraints, or a hook requiring additional context. Refresh state and evaluate the requested amount and direction before choosing a route. Active liquidity alone is not TVL, and vault balances can include accrued fees or curve reserves.

Keep a catalog current

Bootstrap with a finalized account scan, then consume the on-chain events and periodically rescan. Use subscriptions as wake-up hints and recover missed receipts with paginated history. The grapl indexer uses the same SDK pool filters and PDA decoder.

For a service-backed catalog, use HTTP pool discovery. For an independent analytics integration, follow DEX discovery and indexing.