Query editor
-- Omniston · the shape of a day, UTC---- Averaged over days rather than summed. A raw count per hour answers "when-- did swaps happen" with a number that grows for no reason other than the-- dashboard getting older; the average answers "what does an ordinary hour-- look like", which is the question anyone planning around this actually has.---- Median beside average because the two disagree, and the disagreement is the-- finding: where the average sits well above the median, that hour is carried-- by a few busy days rather than being reliably busy.---- Hours with no swaps are zeros, not absences. Left out, an hour that is dead-- six days in seven would report the average of its one busy day and rank-- among the busiest of the clock.---- Bucketed by order_create_time. The service's own daily aggregates bucket by-- creation, verified by comparing a month of daily counts both ways -- create-- matched exactly, finalize was off by sixteen orders -- so anything charted-- beside a cube-derived series has to agree with it.with jettons as (select address, symbol, decimalsfrom (select address, symbol, decimals,row_number() over (partition by address order by _updated_at desc) as rnfrom ton.jetton_metadatawhere symbol is not null) where rn = 1),priced as (selectfrom_unixtime(o.order_create_time) as ts,o.src_trader_address as trader,case when coalesce(t.symbol, j.symbol)in ('USDT', 'USDC', 'USDG', 'pUSD', 'USD₮', 'USD₮0', 'USDe', 'DAI')then cast(o.actual_input_units as double)/ power(10, coalesce(t.decimals, j.decimals)) end as usdfrom dune.elsvv.omniston_orders oleft join tokens.erc20 ton t.blockchain = o.input_asset_chainand t.contract_address = try(from_hex(replace(o.input_asset_address, '0x', '')))left join jettons j-- Guarded on chain: the TON conversion is meaningless on an EVM address-- and from_base64 rejects one outright.on o.input_asset_chain = 'ton'and j.address = '0:' || upper(to_hex(substr(from_base64(replace(replace(o.input_asset_address, '-', '+'), '_', '/')), 3, 32)))where o.status = 'TRADE_STATUS_FULLY_FILLED'and o.src_chain_id != o.dst_chain_id),-- The last eight whole weeks. Averaging over all history would describe a-- protocol that no longer exists: cross-chain barely traded before June, and-- those dead weeks drag every hour toward zero, so the chart would answer-- "what did an hour look like on average since launch" when the question is-- what one looks like now. Eight weeks is long enough to give each weekday-- eight samples and each hour fifty-six.---- Whole days only. The first and the current day are both partial, and a-- partial day dragged into an average of days makes every hour it does not-- cover look quieter than it is.bounds as (