Query editor
WITH creator AS (SELECTsum(bytearray_to_uint256(bytearray_substring(data, 1, 32))) / 1e18 AS creator_eth,count(*) AS eventsFROM robinhood.logsWHERE contract_address = 0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9eAND topic0 = 0x4e45da441832cf53bdaa69235704fc0575e68210f459ee1562911024b12967d5AND topic1 = 0x000000000000000000000000338a3b6b0eabc0efdd1aea33e81e57c102158d8c),creator_24h AS (SELECT sum(bytearray_to_uint256(bytearray_substring(data, 1, 32))) / 1e18 AS creator_eth_24hFROM robinhood.logsWHERE contract_address = 0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9eAND topic0 = 0x4e45da441832cf53bdaa69235704fc0575e68210f459ee1562911024b12967d5AND topic1 = 0x000000000000000000000000338a3b6b0eabc0efdd1aea33e81e57c102158d8cAND block_time > now() - interval '24' hour),px AS (SELECT price AS eth_usdFROM prices.usdWHERE blockchain = 'robinhood'AND contract_address = 0x0bd7d308f8e1639fab988df18a8011f41eacad73ORDER BY minute DESCLIMIT 1),burns AS (SELECT sum(value / 1e18) AS cme_burnedFROM erc20_robinhood.evt_TransferWHERE contract_address = 0xe2324FF2a59F8eCBa8c321c6466e59121C00e795AND "to" = 0x0000000000000000000000000000000000000000)SELECTp.eth_usd,c.creator_eth * p.eth_usd AS creator_profit_usd,c.creator_eth / 0.35 * p.eth_usd AS total_revenue_usd,c.creator_eth / 0.35 * 0.30 * p.eth_usd AS protocol_usd,c.creator_eth / 0.35 * 0.35 * p.eth_usd AS buyback_usd,h.creator_eth_24h * p.eth_usd AS creator_profit_usd_24h,h.creator_eth_24h / 0.35 * p.eth_usd AS total_revenue_usd_24h,b.cme_burned,c.events AS creator_credit_eventsFROM creator c, creator_24h h, px p, burns b