Query editor
-- Omniston · most traded assets by volume sold---- Volume is measured on the input side of a trade, which is the only side the-- protocol prices, so this reads as "what people sold" rather than what they-- bought. Symbols come from Dune's own token metadata rather than a hand list.---- TON addresses need converting first. Omniston reports jettons in the-- user-friendly base64 form (EQCxE6mU…) while ton.jetton_metadata stores the-- raw form (0:B113A9…). The friendly form is 36 bytes of base64url — one flag-- byte, one workchain byte, the 32-byte hash, then a checksum — so the hash is-- bytes 3 through 34. jetton_metadata also carries several rows per address as-- metadata is revised, hence the dedupe.with jettons as (select address, symbolfrom (select address, symbol,row_number() over (partition by address order by _updated_at desc) as rnfrom ton.jetton_metadatawhere symbol is not null) where rn = 1),assets as (selectinput_asset_chain as chain,input_asset_kind as kind,input_asset_address as address,case when input_asset_chain = 'ton' and input_asset_address is not nullthen '0:' || upper(to_hex(substr(from_base64(replace(replace(input_asset_address, '-', '+'), '_', '/')), 3, 32)))end as ton_raw,sum(filled_orders_volume_usd) as volume_usd,sum(finalized_orders_count) as ordersfrom dune.elsvv.omniston_daily_input_assetgroup by 1, 2, 3, 4)selecta.chain,coalesce(case when a.kind = 'native' then upper(a.chain) end,t.symbol, j.symbol,substr(a.address, 1, 10) || '…') as asset,sum(a.volume_usd) as volume_usd,sum(a.orders) as ordersfrom assets aleft join tokens.erc20 ton t.blockchain = a.chainand t.contract_address = try(from_hex(replace(a.address, '0x', '')))left join jettons j on j.address = a.ton_rawgroup by 1, 2having sum(a.volume_usd) > 0order by volume_usd desclimit 20