Query editor
WITH-- many trades have a null sent_amount or received_amount since prices.usd does not have data-- pick the trade size as the largest amountget_trade_size AS (SELECT*,volume as trade_sizeFROMquery_2972580),bucketize AS (SELECT*,CASEWHEN trade_size < 1000 THEN '1: <1k'WHEN trade_size < 10000 THEN '2: 1-10k'WHEN trade_size < 100000 THEN '3: 10-100k'WHEN trade_size < 1000000 THEN '4: 100k-1M'ELSE '5: >1M'END as rangeFROMget_trade_size)SELECTb.entry_point,b.range,SUM(b.trade_size) AS volume,COUNT(*) AS num_transactions,COUNT(distinct b.tx_from) as walletsFROMbucketize bGROUP BY1,2