Query editor
with r as (select *, to_unixtime(block_time) ts, case when rsym='TTWO' and fam='Backpack' then 'TTWO' else fam end famg, (ptype='RWA-其他' or venue='launch') ismeme from dune.okxweb3wallet.result_sol_rwa_trades_enr2_1109_1123),k as (select * from dune.okxweb3wallet.result_sol_rwa_txkind3_1109_1123),fe as (select tx_id, max(platform) platform from dune.okxweb3wallet.result_sol_rwa_txfe2_1109_1123 group by 1),hpt as (select tx_id, hp from dune.okxweb3wallet.result_sol_rwa_hidden_pump_1109_1123 where hp),jupoff as (select * from (values '69yhtoJR4JYPPABZcSNkzuqbaFbwHsCkja1sP1Q2aVT5','GP8StUXNYSZjPikyRsvkTbvRV1GBxMErb59cpeCJnDf1','3CgvbiM3op4vjrrjH2zcrQUwsqh5veNVRjFCB9N6sRoD','HFqp6ErWHY6Uzhj8rFyjYuDya2mXUpYEk8VW75K9PSiY','3LoAYHuSd7Gh8d7RTFnhvYtiTiefdZ5ByamU42vkzd76','7iWnBRRhBCiNXXPhqiGzvvBkKrvFSWqqmxRyu9VyYBxE','DSN3j1ykL3obAVNv7ZX49VsFCPe4LqzxHnmtLiPwY6xg','HU23r7UoZbqTUuh3vA7emAGztFtqwTeVips789vqxxBw') as v(a)),jf0 as (select tx_id,case when to_owner in (select a from jupoff) then 'Jupiter 官网/Ultra' when to_owner='69xpHRvBFzG5UooTszUEEcNvdEvKZeUdbxLE2wXUbLar' then 'BK Swap' else '经 Jupiter 的其他收费集成方' end platform,case when to_owner in (select a from jupoff) then 2 else 1 end prifrom dune.okxweb3wallet.result_sol_rwa_jup_fee_cand_1109_1123where to_owner in (select a from jupoff) or to_owner in ('69xpHRvBFzG5UooTszUEEcNvdEvKZeUdbxLE2wXUbLar','6ooVBXhnqAXaF91cu49YmWhoFuE6WLdZWTwNYvTuhyBd','8ZCzZnSxhbZp2oBGYYUeXMwqHCsAweXdgvyqNrAzGHWV','Gzm9sVa1bKeLfa3Qz8E1GXS8TeakPRT37nL8w9pSqQvd','HmRxxm42Ej2sqP9fC9mbGYixZt37fMFGBmEMw65gW55a','Aes35rP7kHZepsXrLkLkFGvqporpkHMDe9DsVoMTwJST','4cLUBQKZgCv2AqGXbh8ncGhrDRcicUe3WSDzjgPY2oTA')),jf as (select tx_id, min_by(platform, pri) platform from jf0 group by 1),rr as (select * from r where venue='AMM' and famg in ('TTWO','Backpack','xStocks')),ms0 as (select tx_hash, competitor, platform_type from dune.okxweb3wallet.fct_ms_trades_part1 where chain='solana' and block_time >= timestamp '2026-11-08 00:00' and block_time < timestamp '2026-11-25 00:00'union all select tx_hash, competitor, platform_type from dune.okxweb3wallet.fct_ms_trades_part2 where chain='solana' and block_time >= timestamp '2026-11-08 00:00' and block_time < timestamp '2026-11-25 00:00'),ms as (select tx_hash, max(case when platform_type in ('C_End','ALL') then competitor end) c_comp, max(case when platform_type='B_End' then competitor end) b_compfrom ms0 where tx_hash in (select distinct tx_id from rr) group by 1),ss as (select trade_source, count(distinct trader_id) nt from r where trade_source is not null and trade_source<>'direct' group by 1),txs as (select tx_id, max_by(trade_source, usd) src, bool_or(ismeme) memetx from r where tx_id in (select distinct tx_id from rr) group by 1),z as (select tx_id, bool_or((project in ('pumpdotfun','pumpswap','raydium_launchlab') or version_name='dbc') and (amt_s=0 or amt_b=0) and fam_b is null and fam_s is null) zq from dune.okxweb3wallet.result_sol_rwa_tx_trades_1109_1123 group by 1),ch as (select t.tx_id, t.memetx, coalesce(z.zq,false) zq, (hpt.tx_id is not null) hp,case when coalesce(fe.platform, jf.platform) is not null or ms.c_comp is not null then 'C'when ms.b_comp is not null or t.src like 'JUP6Lkb%' or t.src like 'DF1ow4ts%' or t.src like 'T1TANpTe%' or t.src like 'proVF4pM%' then 'B'else 'D' end cls3,case when coalesce(fe.platform, jf.platform) is not null then coalesce(fe.platform, jf.platform)when ms.c_comp is not null then (case when ms.c_comp in ('Jupiter','JupiterZ') then 'Jupiter 官网/Ultra' when ms.c_comp='Fomo' then 'FOMO' when ms.c_comp='Gmgn' then 'GMGN' else ms.c_comp end)when ms.b_comp in ('Jupiter','JupiterZ') or t.src like 'JUP6Lkb%' then 'Jupiter API'when t.src like 'proVF4pM%' then 'OKX B端' when t.src like 'DF1ow4ts%' then 'DFlow API' when t.src like 'T1TANpTe%' then 'Titan'when ms.b_comp is not null then ms.b_comp||' API'when t.src is null or t.src='direct' then '直连 DEX'when t.src like '6Vo3245e%' or t.src like 'routeUGW%' or t.src like 'zapvX9M3%' or t.src like 'FLASHX8Dr%' or t.src like 'GMgnVFR8%' or t.src like 'GMGNreQc%' or t.src like 'GMGN6bvJ%' or t.src like 'term9YPb%' or t.src like 'b1oomGGq%' or t.src like 'MaestroAAe%' or t.src like 'BBRouter1%' or t.src like 'BANANAjs%' or t.src like 'BSfD6SHZ%' or t.src like 'AveaiuA1%' or t.src like 'B3111yJC%' or t.src like 's7SunwrP%' or t.src like 'BinAnceLh%' then '前端程序(未见收费)'when ss.nt>=200 then '前端程序(未见收费)'when ss.nt<=20 then '自建程序' else '其他程序' end channelfrom txs t left join fe on fe.tx_id=t.tx_id left join jf on jf.tx_id=t.tx_id left join ms on ms.tx_hash=t.tx_id left join ss on ss.trade_source=t.src left join z on z.tx_id=t.tx_id left join hpt on hpt.tx_id=t.tx_id),e0 as (select r.trader_id, count(distinct r.tx_id) txs, sum(r.usd) usd, sum(case when r.trade_source is null or r.trade_source='direct' then r.usd else 0 end) usd_dir, sum(case when ss.nt<=20 then r.usd else 0 end) usd_privfrom r left join ss on ss.trade_source=r.trade_source group by 1),e as (select trader_id, case when txs<280 then 'low' when usd_priv>=0.5*usd then 'HF_priv' when usd_priv+usd_dir>=0.5*usd then 'HF_direct' else 'HF_public' end cls from e0),pm as (select pool, max(rmint) rmint from r group by 1),lp0 as (select l.signer, l.uo, l.pool, coalesce(l.rmint, pm.rmint) rmint, to_unixtime(l.bt) ts, l.kind from dune.okxweb3wallet.result_sol_rwa_lp_ops2_1109_1123 l left join pm on pm.pool=l.poolwhere l.kind in ('add','remove','mixed') and coalesce(l.usd_r_in,0)+coalesce(l.usd_r_out,0)+coalesce(l.usd_c_in,0)+coalesce(l.usd_c_out,0)>=10 and not (l.project='meteora' and l.ver='amm') and l.project<>'stabble'),lpset as (select signer ent from lp0 where kind<>'mixed' union select uo from lp0 where kind<>'mixed'),lpo as (select distinct ent, pool, rmint, ts from (select signer ent, pool, rmint, ts from lp0 union all select uo, pool, rmint, ts from lp0) where ent in (select ent from lpset)),lpb as (select ent, pool, rmint, ts, floor(ts/600)+d bk from lpo cross join unnest(array[-1,0,1]) as b(d)),rt as (select distinct trader_id, pool, rmint, ts from r where trader_id in (select ent from lpset)),fl_pool as (select rt.trader_id, rt.pool, rt.ts, bool_or(abs(rt.ts-lpb.ts)<=600) f0 from rt join lpb on lpb.ent=rt.trader_id and lpb.pool=rt.pool and lpb.bk=floor(rt.ts/600) group by 1,2,3),fl_tok as (select rt.trader_id, rt.rmint, rt.ts, bool_or(abs(rt.ts-lpb.ts)<=600) g0 from (select distinct trader_id, rmint, ts from rt) rt join lpb on lpb.ent=rt.trader_id and lpb.rmint=rt.rmint and lpb.bk=floor(rt.ts/600) group by 1,2,3),b as (select r.trader_id, r.rmint, r.pool, r.ts, r.famg, r.side, r.usd, r.tx_id, e.cls, ch.cls3, ch.channel,case when ch.zq then 'pump' when ch.memetx then 'othermeme'when k.kind='B' and k.open_other>0 then 'othermeme' when ch.hp then 'pump'when k.kind='A' then 'arb' when k.kind='B' then 'route' when k.open_other>0 then 'm4' else 'R' end intent,(coalesce(fp.f0,false) or coalesce(ft.g0,false)) lpfrom rr r join k on k.tx_id=r.tx_id join ch on ch.tx_id=r.tx_id join e on e.trader_id=r.trader_idleft join fl_pool fp on fp.trader_id=r.trader_id and fp.pool=r.pool and fp.ts=r.tsleft join fl_tok ft on ft.trader_id=r.trader_id and ft.rmint=r.rmint and ft.ts=r.ts),p1 as (select 'main' part, cls3, channel, famg, intent, cls, lp, sum(usd)/1e6 usd_m, cast(count(distinct trader_id) as double) v2, cast(count(distinct tx_id) as double) v3 from b group by 2,3,4,5,6,7),pt as (select 'traders' part, cls3, '-' channel, famg, '-' intent, '-' cls, false lp, sum(usd)/1e6 usd_m, cast(count(distinct trader_id) as double) v2, cast(count(distinct tx_id) as double) v3 from b group by 2,4union all select 'traders', cls3, '-', 'ALL', '-', '-', false, sum(usd)/1e6, cast(count(distinct trader_id) as double), cast(count(distinct tx_id) as double) from b group by 2union all select 'traders', 'ALL', '-', famg, '-', '-', false, sum(usd)/1e6, cast(count(distinct trader_id) as double), cast(count(distinct tx_id) as double) from b group by 4union all select 'traders', 'ALL', '-', 'ALL', '-', '-', false, sum(usd)/1e6, cast(count(distinct trader_id) as double), cast(count(distinct tx_id) as double) from b),g as (select cls3, trader_id, rmint, floor(ts/600) bk, pool, famg, max(cls) cls,sum(case when side<>'sell' then usd else 0 end) bu, sum(case when side='sell' then usd else 0 end) su