Query editor
-- Module Mode on Robinhood Chain, source version module-native-v1.-- Official launch identity is independent of module IDs and payout wallets.-- Source: https://programmable.market/api/module-mode/indexer/v1-- Dune stores history. One RPC batch fills its recent indexing gap.-- The overlap is deduplicated. All records stop at the returned finalized block.-- Volume is gross native ETH, counted once per swap, including opening buys.-- Creator Rewards counts coin creator and module author ledger credits.-- Withdrawals, donations, LP principal and module budgets are not fee income.-- The no-module allocation is separate from creator and protocol earnings.-- New launcher/engine versions require an additional authenticated source adapter.WITH dune_head AS (SELECT greatest(BIGINT '56160214', coalesce(max(number) - 20000, BIGINT '56160214')) AS rpc_fromFROM robinhood.blocksWHERE time >= current_timestamp - INTERVAL '2' DAY), batch AS (SELECT documentsFROM dune_headCROSS JOIN UNNEST(ARRAY[CAST(json_parse(http_post('https://rpc.mainnet.chain.robinhood.com',concat('[{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]},','{"jsonrpc":"2.0","id":2,"method":"eth_getBlockByNumber","params":["finalized",false]},','{"jsonrpc":"2.0","id":3,"method":"eth_getLogs","params":[{"fromBlock":"0x',to_base(rpc_from, 16), '","toBlock":"finalized",','"address":["0x351cb006f7aaf61374be4be4de8572d62d89fd83","0x72b206dbff61ed0f4c1a75205fddc9e9d0a720cc","0x8e40080836af89952071d241684c7a848a485ac4"],','"topics":[["0x6570caeda0af26be073c30ae27c5f864331d28dab3bf14b31aa3e5bf64793e85","0xd4d0f5055e2337ff5463933dff69d06a57f6cc89503aed6e89d23c1bda23c94c","0xa37d4813811ac0bdda76a71c5ca8a52d9a581eca97c99f2bb49a3778ff0faf2a","0xf61ea4cc67e8df652b03ad30421a9d1816aa54168c256c0f38f0eda989c66955"]]}]}]'),ARRAY['Content-Type: application/json'])) AS ARRAY(JSON))]) AS r(documents)), replies AS (SELECTelement_at(filter(documents, d -> json_extract_scalar(d, '$.id') = '1'), 1) AS chain_reply,element_at(filter(documents, d -> json_extract_scalar(d, '$.id') = '2'), 1) AS head_reply,element_at(filter(documents, d -> json_extract_scalar(d, '$.id') = '3'), 1) AS logs_replyFROM batch), rpc_response AS (SELECTCASE WHEN json_extract_scalar(chain_reply, '$.result') = '0x1237'AND json_extract_scalar(head_reply, '$.result.number') IS NOT NULLTHEN from_base(substr(json_extract_scalar(head_reply, '$.result.number'), 3), 16)ELSE CAST('FINALIZED_ROBINHOOD_HEAD_UNAVAILABLE' AS BIGINT) END AS final_block,from_base(substr(json_extract_scalar(head_reply, '$.result.timestamp'), 3), 16) AS final_timestamp,CAST(json_parse(CASE WHEN substr(json_format(json_extract(logs_reply, '$.result')), 1, 1) = '['THEN json_format(json_extract(logs_reply, '$.result'))ELSE concat('RPC_LOGS_ERROR: ', json_format(logs_reply)) END) AS ARRAY(JSON)) AS recordsFROM replies), rpc_logs AS (-- The null sentinel keeps the finality boundary available even with no recent logs.SELECTfrom_base(substr(json_extract_scalar(document, '$.blockNumber'), 3), 16) AS block_number,from_hex(substr(json_extract_scalar(document, '$.blockHash'), 3)) AS block_hash,from_hex(substr(json_extract_scalar(document, '$.transactionHash'), 3)) AS tx_hash,from_base(substr(json_extract_scalar(document, '$.logIndex'), 3), 16) AS log_index,from_hex(substr(json_extract_scalar(document, '$.address'), 3)) AS contract_address,from_hex(substr(json_extract_scalar(document, '$.topics[0]'), 3)) AS topic0,from_hex(substr(json_extract_scalar(document, '$.topics[1]'), 3)) AS topic1,from_hex(substr(json_extract_scalar(document, '$.data'), 3)) AS data,final_block, final_timestampFROM rpc_responseCROSS JOIN UNNEST(concat(records, ARRAY[CAST(NULL AS JSON)])) AS r(document)WHERE coalesce(json_extract_scalar(document, '$.removed'), 'false') = 'false'), stored_logs AS (