Query editor
-- Fixed-work computation scenarios, not forecasts of volume, bids, or total gas savings.-- Successful non-system transaction blocks, deduplicated across all covered venues.-- Whole blocks containing quote/cancel events take precedence over swap/fill-only blocks.-- Computation units proxy = observed computation_cost / gas_price; storage is unchanged.WITH touches AS (SELECT block_date day, transaction_digest,0 maintenance, CASE WHEN project = 'deepbook' THEN 1 ELSE 0 END deepbook,0 perpsFROM dex_sui.tradesWHERE block_month >= TIMESTAMP '2026-01-01'AND block_date >= DATE '2026-01-01' AND block_date < current_dateAND project IN ('cetus','bluefin','deepbook','aftermath','momentum','flowx','kriya','obric')UNION ALLSELECT date day, transaction_digest,CASE WHEN event_type LIKE '%::OrderPlaced' OR event_type LIKE '%::PostedOrder'OR event_type LIKE '%::OrderCanceled' OR event_type LIKE '%::CanceledOrder'THEN 1 ELSE 0 END maintenance,CASE WHEN event_type LIKE '0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::%' THEN 1 ELSE 0 END deepbook,CASE WHEN split_part(event_type,'::',1) IN ('0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7','0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068') THEN 1 ELSE 0 END perpsFROM sui.eventsWHERE date >= DATE '2026-01-01' AND date < current_dateAND (event_type IN ('0x5664f9d3fd82c84023870cfbda8ea84e14c8dd56ce557ad2116e0668581a682b::pool::SwapEvent','0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::pool::SwapEvent','0xc895342d87127c9c67b76c8ad7f9a22b8bfe1dcdc2c5af82bd85266783115e31::pool::SwapEvent','0x5a5c1d10e4782dbbdec3eb8327ede04bd078b294b97cfdba447b11b846b383ac::lb_pair::SwapEvent')OR (split_part(event_type,'::',1) IN ('0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809','0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7','0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068')AND (event_type LIKE '%::OrderPlaced' OR event_type LIKE '%::PostedOrder'OR event_type LIKE '%::OrderCanceled' OR event_type LIKE '%::CanceledOrder'OR event_type LIKE '%::OrderFilled' OR event_type LIKE '%::FilledTakerOrder')))), unique_blocks AS (SELECT day, transaction_digest, max(maintenance) maintenance, max(deepbook) deepbook, max(perps) perpsFROM touches GROUP BY 1,2), eligible AS (SELECT b.day, b.transaction_digest, b.deepbook, b.perps,CASE WHEN b.maintenance = 1 THEN 'Quote/cancel blocks' ELSE 'Swap/fill blocks' END workload,cast(t.computation_cost AS double) computation_mist,cast(t.gas_price AS double) gas_price,cast(t.computation_cost AS double) / cast(t.gas_price AS double) billed_units_proxy,cast(t.storage_cost AS double) storage_cost_mist,cast(t.storage_rebate AS double) storage_rebate_mist,cast(t.non_refundable_storage_fee AS double) retained_mistFROM unique_blocks b JOIN sui.transactions t ON t.date = b.day AND t.transaction_digest = b.transaction_digestWHERE t.date >= DATE '2026-01-01' AND t.date < current_dateAND t.execution_success = true AND t.is_system_txn = falseAND t.gas_price > 0 AND t.computation_cost > 0), daily AS (SELECT day, coalesce(workload,'All covered trading blocks') workload,count(*) successful_blocks,sum(computation_mist) / 1e9 observed_computation_sui,sum(billed_units_proxy) billed_units_proxy,sum(storage_cost_mist) / 1e9 storage_deposits_sui,sum(storage_rebate_mist) / 1e9 storage_rebates_sui,sum(retained_mist) / 1e9 permanently_retained_sui,sum(storage_cost_mist - storage_rebate_mist) / 1e9 net_storage_flow_sui,