Query editor
with token_addresses as (select address, symbol, name, 'ethereum' as blockchainfrom dune.ondo_team.result_ondo_assetswhere symbol != 'USDon'union allselect address_bnb as address, symbol, name, 'bnb' as blockchainfrom dune.ondo_team.result_ondo_assetswhere symbol != 'USDon'),chains as (SELECT addressFROM UNNEST(split('{{chains}}', ',')) AS t(address)),logs as(select block_time, contract_address, topic0, topic1, topic2, topic3, data,tx_hash,tx_from, tx_to, 'ethereum' as blockchainfrom ethereum.logswhere 'ethereum' in (select * from chains)and block_date >= date '2025-07-01'union allselect block_time, contract_address, topic0, topic1, topic2, topic3, data,tx_hash,tx_from, tx_to, 'bnb' as blockchainfrom bnb.logswhere 'bnb' in (select * from chains)and block_date >= date '2025-10-01'),data as (select block_time, tx_from as user, blockchain,casewhen varbinary_to_uint256(varbinary_substring(data, 129, 32)) = 0 then 'Mint'when varbinary_to_uint256(varbinary_substring(data, 129, 32)) = 1 then 'Redeem'end as action,varbinary_ltrim(varbinary_substring(data, 161, 32)) as asset,varbinary_to_uint256(varbinary_substring(data, 193, 32))/1e18 as price,varbinary_to_uint256(varbinary_substring(data, 225, 32))/1e18 as quantity,(varbinary_to_uint256(varbinary_substring(data, 193, 32))/1e18) * (varbinary_to_uint256(varbinary_substring(data, 225, 32))/1e18) as volume, tx_hashfrom logswhere topic0 = 0xdfe4debbd7bc491e9db43820916e30a4ef9490863fc22b1e79e2f76013901035)select date_trunc('day', block_time) as day, d.blockchain, user, action, symbol, quantity, d.price, volume, tx_hash,SUM(volume) OVER (ORDER BY block_time) AS cumulative_volume_usdfrom data dleft join token_addresses qon d.blockchain = q.blockchain and d.asset = q.addresswhere q.symbol is not nullorder by block_time desc