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
6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBmaOne 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_eventokx_okx_solana.okx_okx_evt_swap_with_fees_cpi_eventokx_okx.swap_with_fees_cpi_event
One table per instruction. OnchainQueries also exposes verified account_<name> aliases for instruction account columns when the bundled IDL and the live schema agree.
okx_okx_solana.okx_okx_call_claimokx_okx.call_claimokx_okx_solana.okx_okx_call_claim_cashback_pumpfunokx_okx.call_claim_cashback_pumpfunokx_okx_solana.okx_okx_call_claim_cashback_pumpswapokx_okx.call_claim_cashback_pumpswapokx_okx_solana.okx_okx_call_create_token_accountokx_okx.call_create_token_accountokx_okx_solana.okx_okx_call_create_token_account_with_seedokx_okx.call_create_token_account_with_seedokx_okx_solana.okx_okx_call_proxy_swapokx_okx.call_proxy_swapokx_okx_solana.okx_okx_call_swapokx_okx.call_swapokx_okx_solana.okx_okx_call_swap_tob_v3okx_okx.call_swap_tob_v3okx_okx_solana.okx_okx_call_swap_tob_v3_enhancedokx_okx.call_swap_tob_v3_enhancedokx_okx_solana.okx_okx_call_swap_tob_v3_with_receiverokx_okx.call_swap_tob_v3_with_receiverokx_okx_solana.okx_okx_call_swap_v3okx_okx.call_swap_v3okx_okx_solana.okx_okx_call_swap_v3_with_cpi_eventokx_okx.call_swap_v3_with_cpi_eventokx_okx_solana.okx_okx_call_wrap_unwrap_v3okx_okx.call_wrap_unwrap_v3okx_okx_solana.okx_okx_call_wrap_unwrap_v3_with_receiverokx_okx.call_wrap_unwrap_v3_with_receiver
Typed parameters keep values out of the SQL text. Save the file, then pass each value with its type.
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;query sql \ --file okx_okx.sql \ --param 'start_time:timestamp=2026-08-01 00:00:00' \ --output ./resultsOnchainQueries 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.