Query editor
with bought as (select sum(bytearray_to_uint256(bytearray_substring(data, 1, 32))) as boxes,sum(bytearray_to_uint256(bytearray_substring(data, 65, 32))) / 1e6 as volume_usdc,count(distinct topic1) as buyersfrom base.logs where contract_address = 0x515a693fc474b2344a9a07f4962ef33ffc253447 and topic0 = 0x793212bc54a93b64ad49d45a9d02304eb16c908134ea23af900d90d8bffb8783 and block_number >= 51277954), opened as (select count(*) as boxes, sum(bytearray_to_uint256(bytearray_substring(data, 33, 32))) / 1e6 as paid_usdc,max(bytearray_to_uint256(bytearray_substring(data, 33, 32))) / 1e6 as biggest_win_usdc,count(distinct topic1) as openersfrom base.logs where contract_address = 0x515a693fc474b2344a9a07f4962ef33ffc253447 and topic0 = 0xa0cb6ac2b5758d2e75f6f3fb20c12c440bc095a6ed084f08bc2633b3593b8501 and block_number >= 51277954), gifts as (select count(*) as boxes_giftedfrom base.logs where contract_address = 0x515a693fc474b2344a9a07f4962ef33ffc253447 and topic0 = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef and block_number >= 51277954and topic1 <> 0x0000000000000000000000000000000000000000000000000000000000000000and topic2 <> 0x0000000000000000000000000000000000000000000000000000000000000000)selectbought.boxes as boxes_sold,opened.boxes as boxes_opened,bought.boxes - opened.boxes as boxes_sealed,bought.volume_usdc,opened.paid_usdc,case when opened.boxes > 0 then round(100.0 * opened.paid_usdc / (opened.boxes * 0.10), 1) else null end as rtp_pct,bought.buyers as unique_buyers,opened.openers as unique_openers,opened.biggest_win_usdc,gifts.boxes_giftedfrom bought, opened, gifts