Query editor
-- Sum of all token transfers to a specific contract address multiplied by 0.05 for revenue calculationSELECTCOUNT(*) AS total_transfers,SUM(amount) AS total_amount_raw,SUM(amount * 0.05) AS total_revenue_raw,SUM((amount / POWER(10, COALESCE(t.decimals, 18))) * 0.05) AS total_revenue_normalized,COUNT(DISTINCT token_address) AS distinct_tokens_receivedFROM (-- ERC20 transfersSELECTevt_tx_hash,contract_address AS token_address,"from","to",value AS amount,evt_block_timeFROM erc20_arbitrum.evt_TransferWHERE "to" = 0x21568459854adcda462f6d9c11ce4f157dc70f93UNION ALL-- ERC1155 batch transfersSELECTevt_tx_hash,contract_address AS token_address,"from","to",SUM(value) AS amount,MIN(evt_block_time) AS evt_block_timeFROM erc1155_arbitrum.evt_TransferBatchCROSS JOIN UNNEST(ids, "values") AS t(id, value)WHERE "to" = 0x21568459854adcda462f6d9c11ce4f157dc70f93GROUP BY evt_tx_hash, contract_address, "from", "to") AS transfersLEFT JOIN tokens.erc20 AS t ON transfers.token_address = t.contract_address