Query editor
-- Whose quote is stored on CoW-flagged eligible fills, per period, pair class and size; wallets of the two-way rule apart.-- CoW's ORDER dataset (the quote table for 11-30 / 12-01 is not posted). 2026-12-01.with t as (select order_uid, tx_hash, block_time, usd_value,if(sell_token_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, sell_token_address) st,if(buy_token_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, buy_token_address) bt,lower(to_hex(trader)) in ('98ac5b90e4562baee0ed3989fc587dfe3ca7d9b5', 'e84353dbcf2a71890aa069a432198f84166045e6', 'ebef2aed95a5219ad2da2942ad27df26c68620df', '8d4dbe6dfcd42015e58d8856109f579f27e76a31', 'b777c453b8a3e47df03de4d36408a5014f74f3ba', '57281d1045b459e738393bfdfc17b8e961965474', 'e29771d17e879beae9be4b7127f3d5c7bbd50a36', '1074526386cf34da62ffe4b06b47f0f560d58f17', '1298a8d46931c2920e3dcf358d415f91ab79e3ab', 'd35d7fb17ee3061ee6ef5f6856a3cef70d5a1cf1', 'e3c0c6cad89a83c9424d5c21abcc380ceee3ac0f', 'a4ad63e9b5967474b620adfd8e73e0e978e964a7', '8eb3efea8a3e46c145a13b5873c6e5c129e5d787', '364acb22141089ba72d3e7de4fdde4af1b242b58', '7249c6f7434dd3d884a2e1eb19b57076d5af6f67', 'b5378cf59f35e6e8bf5679ec6c22d1c5ff912433') two_wayfrom cow_protocol_ethereum.tradeswhere block_time >= timestamp '2026-11-28 00:00' and block_time < timestamp '2026-12-02 00:00' and not partial_fill),od as (select order_uid, tx_hash, bool_or(el0) el, max(qs0) qs, max(sv0) svfrom (select order_uid, tx_hash, is_eligible_for_quote_reward el0, lower(to_hex(cast(quote_solver as varbinary))) qs0,lower(to_hex(cast(solver as varbinary))) sv0 from dune.cowprotocol.dataset_prod_order_data_mainnet_2026_11union allselect order_uid, tx_hash, is_eligible_for_quote_reward el0, lower(to_hex(cast(quote_solver as varbinary))) qs0,lower(to_hex(cast(solver as varbinary))) sv0 from dune.cowprotocol.dataset_prod_order_data_mainnet_2026_12) xgroup by 1, 2),j as (select case when t.block_time < timestamp '2026-11-29 00:00' then 'a 11-28'when t.block_time < timestamp '2026-11-30 00:00' then 'b 11-29'when t.block_time < timestamp '2026-11-30 18:14' then 'c 11-30 to 18:14'when t.block_time < timestamp '2026-12-01 00:00' then 'd 11-30 from 18:14'when t.block_time < timestamp '2026-12-01 09:00' then 'e 12-01 00-09'else 'f 12-01 from 09' end period,case when t.st in (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x6b175474e89094c44da98b954eedeac495271d0f, 0xdc035d45d973e3ec169d2276ddab16f1e407384f, 0x6c3ea9036406852006290770bedfcaba0e23a0e8) and t.bt in (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x6b175474e89094c44da98b954eedeac495271d0f, 0xdc035d45d973e3ec169d2276ddab16f1e407384f, 0x6c3ea9036406852006290770bedfcaba0e23a0e8) then 'stable/stable'when (t.st in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599) and t.bt in (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x6b175474e89094c44da98b954eedeac495271d0f, 0xdc035d45d973e3ec169d2276ddab16f1e407384f, 0x6c3ea9036406852006290770bedfcaba0e23a0e8)) or (t.bt in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599) and t.st in (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x6b175474e89094c44da98b954eedeac495271d0f, 0xdc035d45d973e3ec169d2276ddab16f1e407384f, 0x6c3ea9036406852006290770bedfcaba0e23a0e8)) or (t.st in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599) and t.bt in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599)) then 'ETH,BTC/stable'else 'other' end pc,case when t.usd_value < 100 then 'a<100' when t.usd_value < 1000 then 'b100-1k' when t.usd_value < 10000 then 'c1k-10k' else 'd>=10k' end band,od.qs, od.svfrom t join od on od.order_uid = t.order_uid and od.tx_hash = t.tx_hashwhere od.el and not t.two_way)select 'Q' k, period, pc, band, qs who, count(*) n from j group by 2, 3, 4, 5union allselect 'V', period, pc, band, sv, count(*) from j group by 2, 3, 4, 5