Query editor
selectCASE substring(ts.input from 1 for 4)WHEN '\x74785238' THEN '1inch_RFQ' -- fillOrderRFQ()WHEN '\xf3432b1a' THEN '1inch_LimitOrder' -- fillOrder()WHEN '\xaa77476c' THEN '0x_RFQ' -- fillRfqOrder()WHEN '\x414e4ccf' THEN '0x_v4' -- fillLimitOrder()WHEN '\xf6274f66' THEN '0x_v4' -- _fillLimitOrder()WHEN '\xb4be83d5' THEN '0x_v2.1' -- fillOrder()WHEN '\x9b44d556' THEN '0x_v3' -- fillOrder()END,count(*) as swaps,avg(ts.gas_used) as avg_gas,percentile_cont(0.01) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p01,percentile_cont(0.05) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p05,percentile_cont(0.10) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p10,percentile_cont(0.50) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p50,percentile_cont(0.90) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p90,percentile_cont(0.95) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p95,percentile_cont(0.99) within group (order by ts.gas_used + ts.value / tx.gas_price /*- COALESCE(t1.gas_used) - COALESCE(t2.gas_used)*/) as p99from ethereum.traces tsleft join ethereum.transactions tx on tx.hash = ts.tx_hashwhere ts.success and ts.block_number >= 12965000and substring(ts.input from 1 for 4) in ('\x74785238','\xf3432b1a','\xaa77476c','\x414e4ccf','\xf6274f66','\xb4be83d5','\x9b44d556')and ts."to" in ('\xdef1c0ded9bec7f1a1670819833240f027b25eff', -- 0x v3/v4'\x080bf510fcbf18b91105470639e9561022937712','\x61935cbdd02287b511119ddb11aeb42f1593b7ef','\x3ef51736315f52d568d6d2cf289419b9cfffe782')group by 1