Query editor
WITH parameters AS (SELECTdate_add('month', -2, current_date) AS start_date),known_usdc AS (SELECT *FROM (VALUES('base', 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913),('polygon', 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359),('avalanche_c', 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e)) AS t(chain, token_contract)),x402_addresses AS (SELECT DISTINCTaddress,project AS facilitator,CASEWHEN blockchain = 'polgyon' THEN 'polygon'ELSE blockchainEND AS chainFROM query_6054244),selector_txs AS (SELECTet.blockchain AS chain,xa.facilitator,et.hash AS tx_hash,et.block_time,et."to" AS called_contract,-- First address argument:-- wallet authorizing the USDC transfersubstr(et.data, 17, 20) AS payment_authorizer,-- Second address argument:-- immediate recipient of the USDCsubstr(et.data, 49, 20) AS payment_destination,-- Third argument:-- raw token amountvarbinary_to_uint256(substr(et.data, 69, 32)) AS authorized_amount_rawFROM evms.transactions etINNER JOIN x402_addresses xaON xa.address = et."from"AND xa.chain = et.blockchainINNER JOIN known_usdc uON u.chain = et.blockchainAND u.token_contract = et."to"CROSS JOIN parameters p