Query editor
-- ========================================-- QUERY 2: pumpswap PROJECT-- ========================================WITH-- Define the 6-month perioddate_range AS (SELECTCURRENT_DATE - INTERVAL '180' DAY AS start_date,CURRENT_DATE AS end_date),-- Get all tokens from the specified project from the 180-day periodproject_tokens AS (SELECT DISTINCTCOALESCE(token_sold_mint_address, token_bought_mint_address) AS token_addressFROMdex_solana.trades,date_rangeWHEREproject = 'pumpswap'AND block_time >= date_range.start_dateAND block_time <= date_range.end_date),-- Get all trades for the specified project in the 180-day periodall_project_trades AS (-- Buy transactionsSELECTblock_time,DATE_TRUNC('month', block_time) AS trade_month,tx_id,trader_id AS wallet,token_bought_mint_address AS token_address,COALESCE(token_bought_symbol, token_bought_mint_address) AS asset,token_bought_amount AS amount,amount_usd,-amount_usd AS usd_volume, -- Negative for buy (money spent)'buy' AS actionFROMdex_solana.trades,date_rangeWHEREproject = 'pumpswap'AND token_bought_mint_address IN (SELECT token_address FROM project_tokens)AND token_bought_mint_address NOT IN ('So11111111111111111111111111111111111111112','DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263')AND COALESCE(token_bought_symbol, '') NOT IN ('WETH', 'USDT', 'USDC')AND block_time >= date_range.start_dateAND block_time <= date_range.end_dateAND amount_usd > 20 -- Each buy must be >$20UNION ALL-- Sell transactionsSELECTblock_time,DATE_TRUNC('month', block_time) AS trade_month,