Query editor
-- Dune Query: https://dune.com/queries/9152597-- Publishes: query result only-- BEGIN DUNE RELEASE HISTORY-- Previous Dune version: 4-- Previous normalized token count: 50-- Source development commit: 00f0d05503a2f0aeb47fd6ae37944d882a6795ae-- Change document: changes/2026-11-20-tsv-compass-production.md-- -- Dune Query: https://dune.com/queries/9152597-- -- Publishes: query result only---- -- BEGIN DUNE RELEASE HISTORY-- -- Previous Dune version: 3-- -- Previous normalized token count: 64-- -- Source data commit: 6dc1c0c0a3723941a4e277e78346cdf875cf5db7-- -- Change document: changes/2026-11-17-tsv-v2-dbt.md (step 53)-- -- -- Dune Query: https://dune.com/queries/9152597-- -- -- 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)-- -- -- WITH selected AS (-- -- -- SELECT * FROM dune.okxweb3wallet.rpt_tsv_trading_daily_by_ticker-- -- -- WHERE '{{flow_type}}'='ALL' OR flow_type='{{flow_type}}'-- -- -- ), sides AS (-- -- -- SELECT business_date,'BUY' AS side,buy_volume_usdc AS volume_usdc FROM selected-- -- -- UNION ALL SELECT business_date,'SELL',sell_volume_usdc FROM selected-- -- -- )-- -- -- SELECT business_date,side,SUM(volume_usdc) AS volume_usdc FROM sides GROUP BY business_date,side ORDER BY business_date,side-- -- -- END DUNE RELEASE HISTORY-- ---- -- SELECT business_date AS est_date,ticker,SUM(volume_usdc) AS total_volume_usdc-- -- FROM (SELECT * FROM dune.okxweb3wallet__tmp_tsv_phase2_1119.rpt_tsv_trading_daily_by_ticker WHERE '{{environment}}'='prod' UNION ALL SELECT * FROM dune.okxweb3wallet__tmp_tsv_phase2_1119__pre.rpt_tsv_trading_daily_by_ticker WHERE '{{environment}}'='dev') s-- -- WHERE ('{{flow_type}}'='ALL' OR flow_type=LOWER('{{flow_type}}'))-- -- GROUP BY business_date,ticker ORDER BY business_date,ticker-- -- END DUNE RELEASE HISTORY---- SELECT-- business_date AS est_date,-- ticker,-- CAST(SUM(volume_usdc) AS DECIMAL(38, 4)) AS total_volume_usdc-- FROM dune.okxweb3wallet__tmp_tsv_launch2_1119.rpt_tsv_trading_daily_by_ticker-- WHERE-- (-- '{{flow_type}}' = 'ALL' OR flow_type = LOWER('{{flow_type}}')-- )-- GROUP BY-- business_date,-- ticker-- ORDER BY-- business_date,-- ticker-- END DUNE RELEASE HISTORYSELECTbusiness_date AS est_date,ticker,CAST(SUM(volume_usdc) AS DECIMAL(38, 4)) AS total_volume_usdc