Query editor
with tab as (select a.datetime, a.blockchain, 100 * uni_volume / dex_volume as uni_marketsharefrom (select date_trunc(lower('{{Time Granularity}}'), block_time) as datetime,blockchain, sum(amount_usd) as uni_volumefrom dex.tradeswhere project = 'uniswap'and (not {{Show V3 Only}} or version = '3')and block_time >= cast('{{Start Date}}' as timestamp)and token_bought_address not in (0xc5b3d3231001a776123194cf1290068e8b0c783b, 0xfb5453340c03db5ade474b27e68b6a9c6b2823eb, 0xe7f58a92476056627f9fdb92286778abd83b285f)and token_sold_address not in (0xc5b3d3231001a776123194cf1290068e8b0c783b, 0xfb5453340c03db5ade474b27e68b6a9c6b2823eb, 0xe7f58a92476056627f9fdb92286778abd83b285f)group by 1, 2) aleft join (select date_trunc(lower('{{Time Granularity}}'), block_time) as datetime,blockchain, sum(amount_usd) as dex_volumefrom dex.tradeswhere block_time >= cast('{{Start Date}}' as timestamp)and token_bought_address not in (0xc5b3d3231001a776123194cf1290068e8b0c783b, 0xfb5453340c03db5ade474b27e68b6a9c6b2823eb, 0xe7f58a92476056627f9fdb92286778abd83b285f)and token_sold_address not in (0xc5b3d3231001a776123194cf1290068e8b0c783b, 0xfb5453340c03db5ade474b27e68b6a9c6b2823eb, 0xe7f58a92476056627f9fdb92286778abd83b285f)group by 1, 2) bon a.datetime = b.datetimeand a.blockchain = b.blockchain)select * from taborder by datetime desc, blockchain