Query editor
withallTrades as (selectblock_time,varbinary_starts_with (data, 0x9a10cc32) as is1CT,hash,"from",'arbitrum' as chainfromarbitrum.transactionswhere(to = 0x2c7e82641f03fa077f88833213210a86027f15dcor to = 0x4899fefbf0a5c9881f1dffe6d13f758257298121or to = 0x5E5BfDA2345218c9Ee92B6d60794Dab5A4706342)and (varbinary_position (data, 0xfb4b71bb) > 0or varbinary_position (data, 0x9aa7c0e5) > 0)and success = trueunionselectblock_time,varbinary_starts_with (data, 0x9a10cc32) as is1CT,hash,"from",'polygon' as chainfrompolygon.transactionswhere(to = 0xb0901FEaD3112f6CaF9353ec5c36DC3DdE111F61or to = 0x90d13bb4633CA76337411B94Fe93793a6485c1dcor to = 0x6d91EDb04166251345071998Cf0Ce546Ae810E17)and (varbinary_position (data, 0xfb4b71bb) > 0or varbinary_position (data, 0x9aa7c0e5) > 0)and success = true)select*,100 - is1CTPct as invIs1CTPctfrom(selectdate_trunc('day', block_time) as day,sum(if(is1CT, 1, 0)) as is1CT,sum(if(is1CT, 0, 1)) as not1CT,sum(if(is1CT AND chain = 'polygon', 1, 0)) as polygonIs1CT,sum(if(is1CT AND chain = 'polygon', 0 , 1)) as polygonNot1CT,sum(if(is1CT AND chain = 'arbitrum', 1, 0)) as arbitrumIs1CT,sum(if(is1CT AND chain = 'arbitrum', 0 , 1)) as arbitrumNot1CT,cast(sum(if(is1CT,1, 0)) as double) * 100 / count(*) as is1CTPct,avg( cast(sum(if(is1CT,1, 0)) as double) * 100 / count(*)) over (order bydate_trunc('day', block_time) ROWS BETWEEN 29 PRECEDINGAND 0 FOLLOWING) as ma30_is1CTPctfrom