Query editor
----------------------------------------------EVM-----------------------------------------------WITH evm AS (WITH perpetual_trades AS (SELECTblockchain, -- note that Ethereum mainnet is not included in this datasettrader AS user,-- block_time,project,-- virtual_asset,volume_usd-- fee_usd,-- margin_usdFROM perpetual.tradesWHERE 1=1--AND block_time >= DATE_TRUNC('day', NOW() - INTERVAL '3' YEAR)AND volume_usd > 0)SELECTCAST(user AS VARCHAR) as address,'evm' as network,blockchain,project,-- virtual_asset, -- these are the synthetic assets that are being longed or shorted by the trader.-- COUNT(*) AS total_trades,SUM(volume_usd) AS total_volume_usd-- SUM(fee_usd) AS total_fees_usd,-- SUM(margin_usd) AS total_margin_usd,-- SUM(CASE WHEN block_time >= DATE_TRUNC('day', NOW() - INTERVAL '3' MONTH) THEN volume_usd ELSE 0 END) AS volume_usd_last_3_months-- SUM(CASE WHEN block_time >= DATE_TRUNC('day', NOW() - INTERVAL '6' MONTH) THEN volume_usd ELSE 0 END) AS volume_usd_last_6_monthsFROM perpetual_tradesGROUP BY 1, 2, 3, 4)-------------------------------------------Lighter-------------------------------------------------------DEPOSIT ONLY ----------,lighter AS (SELECTCAST(toAddress as VARCHAR) AS address,'evm' as network,'ethereum' AS blockchain,'lighter' AS project,-- NULL AS virtual_asset, -- these are the synthetic assets that are being longed or shorted by the trader.-- COUNT(*) AS total_trades, --technically deposits since can't see trades-- Applying a 25x multiplier to estimate volSUM(COALESCE(amount,baseAmount)/1e6) * 25 AS total_volume_usd-- 0 AS total_fees_usd, --currently running zero fee campaign, need to udpate once changes-- NULL AS total_margin_usd,-- SUM(CASE WHEN evt_block_time >= DATE_TRUNC('day', NOW() - INTERVAL '3' MONTH) THEN amount/1e6 ELSE 0 END) AS volume_usd_last_3_months-- SUM(CASE WHEN evt_block_time >= DATE_TRUNC('day', NOW() - INTERVAL '6' MONTH) THEN amount/1e6 ELSE 0 END) AS volume_usd_last_6_monthsFROM lighter_v2_ethereum.zklighter_evt_depositGROUP BY 1,2,3,4)------------------------------------------Hyperliquid-------------------------------------------