Query editor
-- Dune Query: https://dune.com/queries/9152595-- Publishes: query result only-- BEGIN DUNE RELEASE HISTORY-- Previous Dune version: 4-- Previous normalized token count: 219-- Source development commit: 00f0d05503a2f0aeb47fd6ae37944d882a6795ae-- Change document: changes/2026-11-20-tsv-compass-production.md-- -- Dune Query: https://dune.com/queries/9152595-- -- Publishes: query result only---- -- BEGIN DUNE RELEASE HISTORY-- -- Previous Dune version: 3-- -- Previous normalized token count: 172-- -- Source data commit: 6dc1c0c0a3723941a4e277e78346cdf875cf5db7-- -- Change document: changes/2026-11-17-tsv-v2-dbt.md (step 53)-- -- -- Dune Query: https://dune.com/queries/9152595-- -- -- Publishes: query result only-- ---- -- -- BEGIN DUNE RELEASE HISTORY-- -- -- Previous Dune version: 1-- -- -- Source data commit: 0a77cf0472211366f79ec94b3ab3e3dc41375cc9-- -- -- Change document: changes/2026-11-17-tsv-v2-dbt.md (step 47)-- -- -- SELECT *,COUNT(*) OVER () AS matching_event_count FROM dune.okxweb3wallet.rpt_tsv_trades WHERE '{{flow_type}}'='ALL' OR flow_type='{{flow_type}}' ORDER BY block_number DESC,evt_index DESC LIMIT 500-- -- -- END DUNE RELEASE HISTORY-- ---- -- SELECT CAST(block_time AT TIME ZONE 'America/New_York' AS TIMESTAMP) AS block_time_et,ticker,-- -- GET_HREF('https://www.oklink.com/xlayer/address/'||CAST(trader AS VARCHAR),SUBSTR(CAST(trader AS VARCHAR),1,6)||'…'||SUBSTR(CAST(trader AS VARCHAR),-4)) AS trader_link,-- -- side,stock_amount,usdc_amount,exec_price,lp_fee_stock,lp_fee_usdc,ui_fee_usdc AS tsv_revenue_usdc,block_number,-- -- GET_HREF('https://www.oklink.com/xlayer/tx/'||CAST(tx_hash AS VARCHAR),SUBSTR(CAST(tx_hash AS VARCHAR),1,6)||'…'||SUBSTR(CAST(tx_hash AS VARCHAR),-4)) AS tx_link,trader,tx_hash-- -- FROM (SELECT * FROM dune.okxweb3wallet__tmp_tsv_phase2_1119.rpt_tsv_trades WHERE '{{environment}}'='prod' UNION ALL SELECT * FROM dune.okxweb3wallet__tmp_tsv_phase2_1119__pre.rpt_tsv_trades WHERE '{{environment}}'='dev') s-- -- WHERE ('{{flow_type}}'='ALL' OR flow_type=LOWER('{{flow_type}}'))-- -- ORDER BY block_time DESC,evt_index DESC-- -- END DUNE RELEASE HISTORY---- SELECT-- CAST(AT_TIMEZONE(block_time, 'America/New_York') AS TIMESTAMP) AS block_time_et,-- ticker,-- GET_HREF(-- 'https://www.oklink.com/xlayer/address/' || CAST(trader AS VARCHAR),-- SUBSTR(CAST(trader AS VARCHAR), 1, 6) || '…' || SUBSTR(CAST(trader AS VARCHAR), -4)-- ) AS trader_link,-- side,-- CAST(stock_amount AS DECIMAL(38, 4)) AS stock_amount,-- CAST(usdc_amount AS DECIMAL(38, 4)) AS usdc_amount,-- CAST(exec_price AS DECIMAL(38, 4)) AS exec_price,-- CAST(lp_fee_stock AS DECIMAL(38, 4)) AS lp_fee_stock,-- CAST(lp_fee_usdc AS DECIMAL(38, 4)) AS lp_fee_usdc,-- CAST(ui_fee_usdc AS DECIMAL(38, 4)) AS tsv_revenue_usdc,-- block_number,-- GET_HREF(-- 'https://www.oklink.com/xlayer/tx/' || CAST(tx_hash AS VARCHAR),-- SUBSTR(CAST(tx_hash AS VARCHAR), 1, 6) || '…' || SUBSTR(CAST(tx_hash AS VARCHAR), -4)-- ) AS tx_link,-- trader,-- tx_hash-- FROM dune.okxweb3wallet__tmp_tsv_launch2_1119.rpt_tsv_trades-- WHERE-- (-- '{{flow_type}}' = 'ALL' OR flow_type = LOWER('{{flow_type}}')