Query editor
-- sfrxUSD — LayerZero OFT Bridge Flow, Observed Per Chain (monthly)---- WHAT CHANGED: the old version read only the Ethereum adapter, so it saw a bridge flow only when-- Ethereum was one leg of it. Frax OFT is hub-and-spoke through Fraxtal, so a Sei<->Fraxtal loop-- (or Sei<->Katana, etc.) never touches Ethereum and was completely invisible.---- This version observes the OFT contract ON EACH Dune-indexed chain and reports bridge flow from-- that chain's own point of view:-- bridged_out = OFTSent (tokens burned/locked here, sent to another chain) -> supply here falls-- bridged_in = OFTReceived (tokens minted/unlocked here, arrived from elsewhere) -> supply here rises-- net_flow = bridged_in - bridged_out (net tokens that accumulated on this chain via bridge)---- Because it's hub-and-spoke, the counterparty EID on almost every leg is Fraxtal (30255) — that is-- expected and not very informative, so it's dropped. The story is each chain's net accumulation.-- FRAXTAL ITSELF IS NOT ON DUNE, so the hub's internal leg is unobservable; we see the spoke legs-- (Ethereum, Sei, Katana, Sonic, Base) and infer Fraxtal as the counterparty.---- Standard LayerZero OFT v2 events (same topic0 on every chain):-- OFTSent(bytes32 indexed guid, uint32 dstEid, address indexed from, uint256 sentLD, uint256 recvLD)-- topic0 0x85496b76… data = [dstEid][sentLD][recvLD]-- OFTReceived(bytes32 indexed guid, uint32 srcEid, address indexed to, uint256 recvLD)-- topic0 0xefed6d35… data = [srcEid][recvLD]-- In both, the amount we want is data word 2 (bytes 33..64) and the counterparty EID is word 1.-- >>> Verify these offsets against one real tx on any chain before trusting magnitudes. <<<-- Shows the last 12 months.-- Chart type: stacked bar of net_flow by chain, monthlyWITH events AS (-- Ethereum: the OFT is a lockbox ADAPTER, separate from the tokenSELECT 'Ethereum' AS chain, block_time, topic0, data FROM ethereum.logsWHERE contract_address = 0x7311CEA93ccf5f4F7b789eE31eBA5D9B9290E126AND topic0 IN (0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a,0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c)UNION ALL-- Sei: remote chains are native mint/burn OFTs, so the OFT IS the tokenSELECT 'Sei', block_time, topic0, data FROM sei.logsWHERE contract_address = 0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0AND topic0 IN (0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a,0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c)UNION ALLSELECT 'Katana', block_time, topic0, data FROM katana.logsWHERE contract_address = 0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0AND topic0 IN (0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a,0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c)UNION ALLSELECT 'Sonic', block_time, topic0, data FROM sonic.logsWHERE contract_address = 0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0AND topic0 IN (0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a,0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c)UNION ALL-- Base uses a different OFT address than the other remote chainsSELECT 'Base', block_time, topic0, data FROM base.logsWHERE contract_address = 0x91A3f8a8d7a881fBDfcfEcd7A2Dc92a46DCfa14eAND topic0 IN (0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a,0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c)),