Query editor
with first_trades as (select block_date, count(tx_from) fresh_walletsfrom (select tx_from, min(block_date) as block_datefrom dex.tradeswhere token_bought_address = {{token_address}}group by tx_from)group by block_date),all_trades as (select tx_from, block_datefrom dex.tradeswhere token_bought_address = {{token_address}}group by tx_from, block_date)select block_date, all_wallets, fresh_wallets, cast(fresh_wallets as double)/cast(all_wallets as double) fresh_wallet_ratiofrom (select block_date, count(tx_from) all_walletsfrom all_tradesgroup by block_date)left join first_tradesusing (block_date)order by block_date