Query editor
with trade_sol as (selectcase when lower(project) in ('bisonfi','humidifi','solfi','tessera','alphaq','goonfi','zerofi','obric','aquifer') 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,casewhen token_bought_symbol like '%SOL' then 'buy sol'else 'sell_sell'end as operation,casewhen token_bought_symbol like '%SOL' then token_sold_amount/token_bought_amountelse token_bought_amount/token_sold_amountend as price_stablecoin,tx_id,trader_id,trade_sourcefrom dex_solana.tradeswhereblock_date >= timestamp '2024-01-01' and(token_pair in ('USDC-SOL', 'USDT-SOL', 'USDC-WSOL', 'USDT-WSOL')or token_pair in ('SOL-USDC', 'SOL-USDT', 'WSOL-USDC', 'WSOL-USDT')))select*from trade_sol