Query editor
-- Actual deliveries, excluding reward funding, credits, rescues and buybacks.WITH legacy_paid AS (SELECT DISTINCT tx_hash,contract_address booster,varbinary_substring(topic3,13,20) recipientFROM robinhood.logs WHERE block_date>=DATE '2026-07-01' AND block_date<current_dateAND contract_address IN (0x038a7f4e4e89448ad74e044337c9ac25c11e726b,0xf9ca5f6d8622c82758914681a12674e2d489259a)AND topic0=keccak(to_utf8('DropPaid(uint256,uint256,address)'))), paid AS (SELECT CAST(t.block_time AS DATE) day,CASE WHEN t."from"=0x038a7f4e4e89448ad74e044337c9ac25c11e726b THEN 'Clock In v1' ELSE 'Overtime' END source,t.contract_address token,CAST(t.amount_raw AS DOUBLE) raw_amount,t."to" recipient,t.tx_hashFROM tokens.transfers t JOIN legacy_paid l ON t.tx_hash=l.tx_hash AND t."from"=l.booster AND t."to"=l.recipientWHERE t.blockchain='robinhood' AND t.block_date>=DATE '2026-07-01' AND t.block_date<current_date AND t.token_standard='erc20'UNION ALLSELECT CAST(block_time AS DATE) day, 'Clock In v2' source,varbinary_substring(topic3,13,20) token,CAST(varbinary_to_uint256(data) AS DOUBLE) raw_amount,varbinary_substring(topic2,13,20) recipient,tx_hashFROM robinhood.logsWHERE block_date>=DATE '2026-08-03' AND block_date<current_dateAND contract_address=0x1f12fe622c11947f93f53d63f68f7f46b6d081c9AND topic0=keccak(to_utf8('Delivered(uint256,address,address,uint256)'))UNION ALLSELECT CAST(block_time AS DATE), 'Safety Deposit Box claims',varbinary_substring(topic1,13,20),CAST(varbinary_to_uint256(varbinary_substring(data,33,32)) AS DOUBLE),varbinary_substring(data,13,20),tx_hashFROM robinhood.logsWHERE block_date>=DATE '2026-07-01' AND block_date<current_dateAND contract_address=0x55642a3f10f1af5145d3d59021b1d6b03bb8692cAND topic0=keccak(to_utf8('ClockedIn(address,uint64,uint256,address,uint256)'))UNION ALLSELECT cast(block_time AS date),CASE WHEN topic0=keccak(to_utf8('DependentDelivered(uint256,address,address,uint256)')) THEN 'Clock In 3.0 - Intern payroll'WHEN contract_address=0xf4129019d8838f2555bdc8ecb3024a02145dbc58 THEN 'Clock In 3.0 - Brokers' ELSE 'Clock In 3.0 - Interns' END,varbinary_substring(topic3,13,20),cast(varbinary_to_uint256(data) AS double),varbinary_substring(topic2,13,20),tx_hashFROM robinhood.logs WHERE block_date>=date '2026-09-19' AND block_date<current_dateAND contract_address IN (0xf4129019d8838f2555bdc8ecb3024a02145dbc58,0xb6573dd536f6268a9d028adec00f08918830f55d,0xf90a384936af8e6fd1c6c0f9ca804da5395bc059)AND topic0 IN (keccak(to_utf8('Delivered(uint256,address,address,uint256)')),keccak(to_utf8('DependentDelivered(uint256,address,address,uint256)')))),daily AS (SELECT day,source,token,sum(raw_amount) raw_amount,count(*) delivery_events,count(distinct recipient) broker_wallets FROM paid GROUP BY 1,2,3),p AS (SELECT CAST(timestamp AS DATE) day,contract_address,max(price) price,max(decimals) decimals,max(symbol) symbol FROM prices.day WHERE blockchain='robinhood' AND timestamp>=TIMESTAMP '2026-07-01' AND timestamp<current_date GROUP BY 1,2),metadata AS (SELECT contract_address,max(decimals) decimals,max(symbol) symbol FROM tokens.erc20 WHERE blockchain='robinhood' GROUP BY 1),e AS (SELECT CAST(timestamp AS DATE) day,max(price) price FROM prices.day WHERE blockchain='ethereum' AND contract_address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AND timestamp>=TIMESTAMP '2026-07-01' AND timestamp<current_date GROUP BY 1)SELECT d.day,d.source,d.token,CASE WHEN token IN (0x0000000000000000000000000000000000000000,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee) THEN 'ETH' ELSE coalesce(p.symbol,m.symbol) END symbol,CASE WHEN token IN (0x0000000000000000000000000000000000000000,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee) THEN raw_amount/1e18 ELSE raw_amount/pow(10,coalesce(p.decimals,m.decimals)) END amount,CASE WHEN token IN (0x0000000000000000000000000000000000000000,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee) THEN raw_amount/1e18*e.price ELSE raw_amount/pow(10,coalesce(p.decimals,m.decimals))*p.price END delivered_usd,delivery_events,broker_wallets,raw_amount FROM daily d LEFT JOIN p ON d.day=p.day AND d.token=p.contract_address LEFT JOIN e ON d.day=e.day LEFT JOIN metadata m ON d.token=m.contract_address ORDER BY d.day,d.source