Query editor
-- One row per token leg of a CCIP v1.5 message, USD-priced at day granularity.-- NOTE: tokenAmounts elements are DOUBLE-ENCODED JSON strings (json_parse each element).-- v1.6 CCIPMessageSent token legs carry sourcePoolAddress (not token) and need a-- pool->token mapping; they are intentionally excluded here.SELECTe.chain,e.evt_block_date AS block_date,lower(to_hex(e.evt_tx_hash)) AS tx_hash,lower(to_hex(e.contract_address)) AS onramp,json_extract_scalar(e.message, '$.messageId') AS message_id,lower(json_extract_scalar(json_parse(t), '$.token')) AS token,coalesce(p.symbol, 'UNPRICED') AS symbol,try_cast(json_extract_scalar(json_parse(t), '$.amount') AS double) AS raw_amount,try_cast(json_extract_scalar(json_parse(t), '$.amount') AS double) / pow(10, p.decimals) * p.price AS usd_valueFROM chainlink_multichain.onramp_evt_ccipsendrequested eCROSS JOIN UNNEST(cast(json_extract(e.message, '$.tokenAmounts') AS array(varchar))) AS x(t)LEFT JOIN prices.usd_daily pON p.blockchain = e.chainAND p.contract_address = from_hex(substr(json_extract_scalar(json_parse(t), '$.token'), 3))AND p.day = e.evt_block_date