Query editor
-- fusi.ng: creator fees per day. Credited = earned into the escrow, Claimed = paid out.-- ETH only (Credited/Claimed); token-denominated credits (CreditedToken/ClaimedToken) are-- counted as rows in `token_claims` so they are visible without pretending to price them.with escrows as (select * from (values(0xB04B1e2d2782738287c21ab7AccB3ECed9546D0F, 'v1'),(0xaF5d6C1573fA8F7f662dc288321D5975f1c83DF6, 'v2'),(0x58BF4846D583f10b4aC62edC35Fd8F5a931d2B74, 'v3a'),(0xBB935800c64DAA1B00bf50bB8D097972f8022EA8, 'v3b'),(0x92F381E9AD5B72b5b7Fb56dAA465b75777074f4a, 'v3c')) as t(addr, release)),ev as (select l.block_time, e.release,case l.topic0when 0x9c9e0cdb1670e88302408e5b941dc636f63a3293204694bb68910fcf3d9305f3 then 'credited'when 0xd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a then 'claimed'when 0x2ad02ae08ced0d667a621b3a5a2bd7d9574d95a1567d5caca94845c7c03f5639 then 'credited_token'when 0xdbc1ea3a8459e4c7e11fb385b52bbb5cc8c8ab85eec5d883ac9aa78c171f5141 then 'claimed_token'end as kind,bytearray_substring(l.topic1, 13, 20) as recipient,cast(bytearray_to_uint256(bytearray_substring(l.data, 1, 32)) as double) / 1e18 as amountfrom ethereum.logs ljoin escrows e on e.addr = l.contract_addresswhere l.topic0 in (0x9c9e0cdb1670e88302408e5b941dc636f63a3293204694bb68910fcf3d9305f3,0xd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a,0x2ad02ae08ced0d667a621b3a5a2bd7d9574d95a1567d5caca94845c7c03f5639,0xdbc1ea3a8459e4c7e11fb385b52bbb5cc8c8ab85eec5d883ac9aa78c171f5141)),prices as (select date_trunc('hour', minute) as hour, avg(price) as eth_usdfrom prices.usd where blockchain = 'ethereum' and symbol = 'WETH' and minute >= timestamp '2026-09-01'group by 1)selectdate_trunc('day', ev.block_time) as day,sum(case when kind = 'credited' then amount else 0 end) as creator_fees_earned_eth,sum(case when kind = 'credited' then amount * p.eth_usd else 0 end) as creator_fees_earned_usd,sum(case when kind = 'claimed' then amount else 0 end) as creator_fees_claimed_eth,count(distinct case when kind = 'claimed' then recipient end) as creators_paid,count(case when kind in ('credited_token', 'claimed_token') then 1 end) as token_claimsfrom evleft join prices p on p.hour = date_trunc('hour', ev.block_time)group by 1order by 1