Query editor
with trade as (selectcase when lower(project) in ('','') then 'propAMM'else 'other DEX'end as segment,project,block_time as ts,token_pair,token_bought_symbol,token_bought_amount,token_sold_symbol,token_sold_amount,amount_usd as volume_usd,casewhen token_bought_symbol like '%BTC' then 'buy btc'else 'sell_btc'end as operation,casewhen token_bought_symbol like '%BTC' then token_sold_amount/token_bought_amountelse token_bought_amount/token_sold_amountend as price_stablecoin,tx_hash,tx_from,tx_tofrom dex.tradeswhereblockchain = 'ethereum' and block_date >= timestamp '2024-01-01' and(token_pair in ('USDC-cbBTC', 'USDT-cbBTC', 'USDC-WBTC', 'USDT-WBTC')or token_pair in ('cbBTC-USDC', 'cbBTC-USDT', 'USDC-WBTC', 'USDT-WBTC')))select*from tradelimit 10