Skip to content
OnchainQueries

OQ — D21 · DEX & Trading

16 typed tables generated from the OKX DEX IDL — 2 event tables and 14 instruction tables. Every column name comes from the program's own interface definition.

Tables
16
Event tables
2
Instruction tables
14
Account types
0

Program ID

6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBma
OQ — D21·1Event tables

One table per event declared in the IDL. The fully qualified name is on the left, the short alias on the right — both resolve to the same physical table.

  • okx_okx_solana.okx_okx_evt_swap_eventokx_okx.swap_event
  • okx_okx_solana.okx_okx_evt_swap_with_fees_cpi_eventokx_okx.swap_with_fees_cpi_event
OQ — D21·2Instruction tables

One table per instruction. OnchainQueries also exposes verified account_<name> aliases for instruction account columns when the bundled IDL and the live schema agree.

14/14
  • okx_okx_solana.okx_okx_call_claimokx_okx.call_claim
  • okx_okx_solana.okx_okx_call_claim_cashback_pumpfunokx_okx.call_claim_cashback_pumpfun
  • okx_okx_solana.okx_okx_call_claim_cashback_pumpswapokx_okx.call_claim_cashback_pumpswap
  • okx_okx_solana.okx_okx_call_create_token_accountokx_okx.call_create_token_account
  • okx_okx_solana.okx_okx_call_create_token_account_with_seedokx_okx.call_create_token_account_with_seed
  • okx_okx_solana.okx_okx_call_proxy_swapokx_okx.call_proxy_swap
  • okx_okx_solana.okx_okx_call_swapokx_okx.call_swap
  • okx_okx_solana.okx_okx_call_swap_tob_v3okx_okx.call_swap_tob_v3
  • okx_okx_solana.okx_okx_call_swap_tob_v3_enhancedokx_okx.call_swap_tob_v3_enhanced
  • okx_okx_solana.okx_okx_call_swap_tob_v3_with_receiverokx_okx.call_swap_tob_v3_with_receiver
  • okx_okx_solana.okx_okx_call_swap_v3okx_okx.call_swap_v3
  • okx_okx_solana.okx_okx_call_swap_v3_with_cpi_eventokx_okx.call_swap_v3_with_cpi_event
  • okx_okx_solana.okx_okx_call_wrap_unwrap_v3okx_okx.call_wrap_unwrap_v3
  • okx_okx_solana.okx_okx_call_wrap_unwrap_v3_with_receiverokx_okx.call_wrap_unwrap_v3_with_receiver
OQ — D21·3Example

Typed parameters keep values out of the SQL text. Save the file, then pass each value with its type.

okx_okx.sql
SELECT  date_trunc('hour', ts) AS hour,  count(*) AS eventsFROM okx_okx_solana.okx_okx_evt_swap_eventWHERE ts >= {{start_time}}GROUP BY hourORDER BY hour;
shell
query sql \  --file okx_okx.sql \  --param 'start_time:timestamp=2026-08-01 00:00:00' \  --output ./results

OnchainQueries selects an engine, queues the query, and downloads checksum-verified Parquet parts plus a manifest. See the CLI guide.

Pro includes every engine class and 50,000 query credits a month.