Query editor
WITH trsf AS (SELECTfrom_owner,to_owner,amount / 10e8 AS amount,block_timeFROM tokens_solana.transfersWHERE action = 'transfer'AND token_version = 'native'AND token_mint_address = 'So11111111111111111111111111111111111111112'AND ('{{address}}' IN (from_owner, to_owner))AND block_time > NOW() - INTERVAL '90' DAYAND amount / 10e8 > 0.01LIMIT 10000),------------------------------------------------------------------t_in AS (SELECTfrom_owner AS address,SUM(amount) AS inflow,COUNT(*) AS inflow_count,MIN(block_time) AS first_FROM trsfWHERE to_owner = '{{address}}'GROUP BY from_owner),------------------------------------------------------------------t_out AS (SELECTto_owner AS address,SUM(amount) AS outflow,COUNT(*) AS outflow_count,MIN(block_time) AS first_FROM trsfWHERE from_owner = '{{address}}'GROUP BY to_owner)------------------------------------------------------------------------------------------------------------------------------------SELECTROW_NUMBER() OVER (ORDER BY (COALESCE(t_in.inflow, 0) + COALESCE(t_out.outflow, 0)) DESC) AS RK_,COALESCE(t_in.address, t_out.address) AS address,ROUND(COALESCE(t_in.inflow, 0), 2) AS inflow,ROUND(COALESCE(t_out.outflow, 0), 2) AS outflow,COALESCE(t_in.inflow_count, 0) AS inflow_count,COALESCE(t_out.outflow_count, 0) AS outflow_count,LEAST(COALESCE(t_in.first_, TIMESTAMP '9999-12-31'),COALESCE(t_out.first_, TIMESTAMP '9999-12-31')) AS first_,COALESCE(ex.CEX,CONCAT('<a href="https://solscan.io/account/', COALESCE(t_in.address, t_out.address), '?value=100&value=#transfers" target="_blank">SCAN</a>')) AS mark,CONCAT('<a href="https://gmgn.ai/sol/address/', COALESCE(t_in.address, t_out.address), '" target="_blank">GMGN</a>') AS GMGNFROM t_inFULL OUTER JOIN t_out ON t_in.address = t_out.addressLEFT JOIN dune.raccoonrich.dataset_exchange exON COALESCE(t_in.address, t_out.address) = ex.address