Query editor
-- Arc launch tracker · 04 · Cross-chain USDC flows by chain (time series)---- One row per {{granularity}} × rail × counterparty chain: USDC arriving on-- Arc (minted here after a burn elsewhere) and leaving Arc (burned here to be-- minted elsewhere). Stack net_flow_usdc by chain for "where is capital-- coming from". 05_crosschain_flows_by_chain.sql shares the same transfers CTE,-- so edit both together.---- Method (all amounts are USDC at 6 decimals, one row per transfer)-- * CCTP in: MessageReceived on MessageTransmitterV2. sourceDomain is word 0.-- amount is decoded from the BurnMessageV2 body (body starts at-- data byte 129, amount sits at body offset 68). The gross amount-- is minted on Arc: recipient amount plus the fast-transfer fee.-- Reconciles exactly with MintAndWithdraw (amount + feeCollected)-- on TokenMessengerV2: 31,376 transfers, 106,564,658.55 USDC-- as of 2026-09-16 16:00 UTC.-- * CCTP out: DepositForBurn on TokenMessengerV2 (burnToken = USDC).-- destinationDomain is word 2.-- * Gateway in: AttestationUsed on GatewayMinter (token = USDC). sourceDomain-- is word 0, value is word 3.-- * Gateway out: GatewayBurned on GatewayWallet (token = USDC).-- destinationDomain is word 0, value is word 3. The Gateway fee-- (word 4) goes to Circle's fee recipient and is not burned.-- * Domain IDs follow Circle's CCTP domain list. Arc is domain 26, so rows-- labelled "Arc" are same-chain Gateway withdrawals.WITH domains (domain, chain) AS (VALUES(0, 'Ethereum'), (1, 'Avalanche'), (2, 'OP Mainnet'), (3, 'Arbitrum'),(4, 'Noble'), (5, 'Solana'), (6, 'Base'), (7, 'Polygon PoS'), (8, 'Sui'),(9, 'Aptos'), (10, 'Unichain'), (11, 'Linea'), (12, 'Codex'), (13, 'Sonic'),(14, 'World Chain'), (15, 'Monad'), (16, 'Sei'), (17, 'BNB Smart Chain'),(18, 'XDC'), (19, 'HyperEVM'), (21, 'Ink'), (22, 'Plume'), (25, 'Starknet'),(26, 'Arc'), (27, 'Stellar'), (28, 'EDGE'), (29, 'Injective'), (30, 'Morph'),(31, 'Pharos'), (32, 'Cronos'), (33, 'Plasma'), (37, 'X Layer')),transfers AS (SELECTblock_time,'CCTP' AS rail,'in' AS direction,CAST(varbinary_to_uint256(varbinary_substring(data, 1, 32)) AS bigint) AS domain,CAST(varbinary_to_uint256(varbinary_substring(data, 197, 32)) AS double) / 1e6 AS amount_usdcFROM arc.logsWHERE contract_address = 0x81d40f21f12a8f0e3252bccb954d722d4c464b64 -- CCTP MessageTransmitterV2AND topic0 = 0xff48c13eda96b1cceacc6b9edeedc9e9db9d6226afbc30146b720c19d3addb1c -- MessageReceived-- token transfers only: body version 1 and at least 128-byte head + 228-byte-- BurnMessageV2. Generic CCTP messages carry other bodies.AND length(data) >= 356AND varbinary_substring(data, 129, 4) = 0x00000001UNION ALLSELECTblock_time,'CCTP','out',CAST(varbinary_to_uint256(varbinary_substring(data, 65, 32)) AS bigint),CAST(varbinary_to_uint256(varbinary_substring(data, 1, 32)) AS double) / 1e6