Skip to content
OnchainQueries

OQ — D22 · DEX & Trading

25 typed tables generated from the OKX DEX v3 IDL — 6 event tables and 19 instruction tables. Every column name comes from the program's own interface definition.

Tables
25
Event tables
6
Instruction tables
19
Account types
1

Program ID

proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u
OQ — D22·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_v3_solana.okx_okx_v3_evt_swap_cpi_event2okx_okx_v3.swap_cpi_event2
  • okx_okx_v3_solana.okx_okx_v3_evt_swap_eventokx_okx_v3.swap_event
  • okx_okx_v3_solana.okx_okx_v3_evt_swap_tob_v2_cpi_event2okx_okx_v3.swap_tob_v2_cpi_event2
  • okx_okx_v3_solana.okx_okx_v3_evt_swap_toc_v2_cpi_event2okx_okx_v3.swap_toc_v2_cpi_event2
  • okx_okx_v3_solana.okx_okx_v3_evt_swap_with_fees_cpi_event2okx_okx_v3.swap_with_fees_cpi_event2
  • okx_okx_v3_solana.okx_okx_v3_evt_swap_with_fees_cpi_event_enhanced2okx_okx_v3.swap_with_fees_cpi_event_enhanced2
OQ — D22·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.

19/19
  • okx_okx_v3_solana.okx_okx_v3_call_claimokx_okx_v3.call_claim
  • okx_okx_v3_solana.okx_okx_v3_call_claim_cashback_pumpfunokx_okx_v3.call_claim_cashback_pumpfun
  • okx_okx_v3_solana.okx_okx_v3_call_claim_cashback_pumpswapokx_okx_v3.call_claim_cashback_pumpswap
  • okx_okx_v3_solana.okx_okx_v3_call_create_token_accountokx_okx_v3.call_create_token_account
  • okx_okx_v3_solana.okx_okx_v3_call_create_token_account_with_seedokx_okx_v3.call_create_token_account_with_seed
  • okx_okx_v3_solana.okx_okx_v3_call_init_token_ledgerokx_okx_v3.call_init_token_ledger
  • okx_okx_v3_solana.okx_okx_v3_call_proxy_swapokx_okx_v3.call_proxy_swap
  • okx_okx_v3_solana.okx_okx_v3_call_set_token_ledgerokx_okx_v3.call_set_token_ledger
  • okx_okx_v3_solana.okx_okx_v3_call_swapokx_okx_v3.call_swap
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tobokx_okx_v3.call_swap_tob
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tob_enhancedokx_okx_v3.call_swap_tob_enhanced
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tob_v2okx_okx_v3.call_swap_tob_v2
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tob_with_receiverokx_okx_v3.call_swap_tob_with_receiver
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tob_with_receiver_token_ledgerokx_okx_v3.call_swap_tob_with_receiver_token_ledger
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tob_with_token_ledgerokx_okx_v3.call_swap_tob_with_token_ledger
  • okx_okx_v3_solana.okx_okx_v3_call_swap_tocokx_okx_v3.call_swap_toc
  • okx_okx_v3_solana.okx_okx_v3_call_swap_toc_v2okx_okx_v3.call_swap_toc_v2
  • okx_okx_v3_solana.okx_okx_v3_call_wrap_unwrapokx_okx_v3.call_wrap_unwrap
  • okx_okx_v3_solana.okx_okx_v3_call_wrap_unwrap_with_receiverokx_okx_v3.call_wrap_unwrap_with_receiver
OQ — D22·3Example

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

okx_okx_v3.sql
SELECT  date_trunc('hour', ts) AS hour,  count(*) AS eventsFROM okx_okx_v3_solana.okx_okx_v3_evt_swap_cpi_event2WHERE ts >= {{start_time}}GROUP BY hourORDER BY hour;
shell
query sql \  --file okx_okx_v3.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.