Query editor
with wl(w) as (values('7FoXJZXD6KxRT2rDeAoNMfRCX8QRWNdiaN7MPdffEbvA'),('BAssygMcMh6bfBRTo7nCGhGABM3th35PfEHqVpCprJx5')),net as (select wallet, mint, net_qty, net_usdfrom dune.crypto_edgar.result_fomo_sol_net_2026_08where wallet in (select w from wl)),trade_px as (select mint, block_date, sum(usd) / nullif(sum(qty), 0) as pricefrom (select token_bought_mint_address as mint, block_date,token_bought_amount as qty, amount_usd as usdfrom dex_solana.tradeswhere block_month in (date '2026-07-01', date '2026-08-01')and block_date >= date '2026-07-19'and amount_usd > 0 and token_bought_amount > 0union allselect token_sold_mint_address, block_date, token_sold_amount, amount_usdfrom dex_solana.tradeswhere block_month in (date '2026-07-01', date '2026-08-01')and block_date >= date '2026-07-19'and amount_usd > 0 and token_sold_amount > 0) sgroup by 1, 2),px as (select mint, price, block_date as price_datefrom (select mint, block_date, price,row_number() over (partition by mint order by block_date desc) as rnfrom trade_px) r where rn = 1),quotes(qmint) as (values('So11111111111111111111111111111111111111112'),('So11111111111111111111111111111111111111111'),('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'))select n.wallet,n.mint,(n.mint in (select qmint from quotes)) as is_quote,round(n.net_qty, 6) as net_qty,round(n.net_usd, 2) as net_usd_flow,round(p.price, 10) as mark_price,p.price_date as mark_date,round(case when n.mint in (select qmint from quotes)then n.net_usdelse n.net_qty * coalesce(p.price, 0) end, 2) as value_usdfrom net nleft join px p on p.mint = n.mintorder by n.wallet, is_quote desc, abs(coalesce(n.net_qty * p.price, n.net_usd)) desc