Skip to content

DEX discovery and indexing

Build a grapl pool and trade catalog for independent analytics platforms, including DEX Screener and GMGN integrations.

An analytics platform needs a decoder for the grapl program and its deployment. Solana provides account scans, logs and transaction subscriptions; it does not define one shared pool layout for every AMM. Discovering a token mint, indexing its grapl pool, and offering an executable trade route are separate capabilities.

Bootstrap an independent integration

  1. Pin the deployment's genesis hash and program ID. The current implementation and fixtures support development/Sandbox verification; this guide does not announce a mainnet deployment.
  2. Scan finalized Pool6 accounts using SDK discovery. Verify the owner, discriminator, PDA and bump rather than trusting a pool address supplied by a third party.
  3. Store pool identity, mint/vault bindings, mode, configuration and hook program. Fetch SPL mint decimals and token metadata separately; metadata is not proof of authenticity.
  4. Observe program activity, fetch successful finalized receipts and decode core events. Include CPI invocations; a router transaction is not necessarily a top-level grapl instruction.
  5. Recover missed history after reconnects, deduplicate by signature/log index, and rescan current pool accounts periodically. Mark history gaps explicitly.

Indexer storage and recovery

The grapl indexer runs separately from the API. logsSubscribe wakes it up, while polling and paginated getSignaturesForAddress recover retained history. Each receipt, checkpoint, transaction-status observation and protocol-event batch is persisted atomically.

StoragePurpose
indexer_poolLatest validated account snapshot, scoped by genesis/program and address
indexer_transactionRetained raw receipt, including failed transactions
indexer_event_batchDecode status and reason for each receipt; gaps remain visible
indexer_protocol_eventTyped events keyed by stream, signature and original log index; indexed by pool and event name

Wide values in JSON storage are decimal strings. Pools can be discovered even when historical RPC retention is insufficient. That current catalog does not imply complete volume, price candles, user activity or APY history.

The indexer's event replay utility reprocesses retained receipts with the pinned decoder without moving the chain cursor. It is idempotent. Replay cannot recover logs absent from the retained receipt, nor manufacture events that an older program never emitted. A provider retaining the missing receipts is needed to repair that coverage.

The public SSE API currently streams transaction status. It does not expose the internal typed swap/liquidity tables as a public pool-event stream.

Prepare the integration handoff

For DEX Screener, GMGN or another indexer, provide the deployment identity, program source and pinned IDL; Pool6 filters and PDA seeds; event schema and settled-amount semantics; mint/vault ordering; curve graduation behavior; and representative successful/failed direct and CPI receipts. Include the decoder's truncation and replay behavior. Executable routing additionally requires hook-aware quotes and execution support; discovery alone does not bypass hook rules.

DEX Screener describes automatic token listing once its platform tracks a liquidity pool and a transaction. This is not a promise to decode every new Solana AMM. GMGN's contact page is the coordination entry point for discussing a new integration. Each platform must confirm support for the grapl deployment and format. These local implementation tests do not establish indexing, listing, or trading support on either platform.

See Metis integration for the independent quote/execution path.