Query editor
with reward_wallets as (select distinct wallet from dune_user_generated."alcx_transactions"where rewards > 0), monthly as (selectdate_trunc('month', evt_time)::DATE as month--t.wallet--, wallet_label--, sum(amt) as alcx_bal, sum(rewards) as rewards, sum(trades) as trades, case when sum(rewards) > 0 then sum(trades) / sum(rewards) * - 1 end as "% sold"--, sum(staking) as staking--, sum(amt_slp) as slp--, sum(other) as otherfrom dune_user_generated."alcx_transactions" tjoin reward_wallets rwon rw.wallet = t.walletwhere wallet_label ISNULL --exclude project walletsgroup by 1order by 1)selectm.*, mp.price_change as alcx_price_changefrom monthly mleft join dune_user_generated.alcx_monthly_prices mpon m.month = mp.monthwhere m.month <= '2021-6-1'