Query editor
-- frxUSD Custodians — All-Time Native Mint/Redeem Breakdown Per Custodian-- One row per custodian with lifetime mint/redeem volume, net, counts, and activity window.-- Volume denominated in frxUSD via the `shares` field (18 decimals).WITH custodians AS (SELECT * FROM (VALUES(0x4F95C5bA0C7c69FB2f9340E190cCeE890B3bd87c, 'USDC', 'Circle'),(0xe827abf9f462ac4f147753d86bc5f91e186e4e9c, 'BUIDL', 'Securitize (BlackRock)'),(0x5fbAa3A3B489199338fbD85F7E3D444dc0504F33, 'USTB', 'Superstate'),(0x860Cc723935FC9A15fF8b1A94237a711DFeF7857, 'WTGXX', 'WisdomTree')-- Add when live: USCC (FIP-420), AUSD (FIP-425), JTRSY (FIP-426)) AS t(custodian, asset, issuer)),events AS (SELECTc.asset,c.issuer,c.custodian,l.block_time,bytearray_to_uint256(bytearray_substring(l.data, 33, 32)) / 1e18 AS frxusd_amount,CASEWHEN l.topic0 = 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7THEN 'mint'ELSE 'redeem'END AS directionFROM ethereum.logs lJOIN custodians c ON l.contract_address = c.custodianWHERE l.topic0 IN (0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7,0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db))SELECTasset,issuer,custodian,SUM(CASE WHEN direction = 'mint' THEN frxusd_amount ELSE 0 END) AS total_mint_volume,SUM(CASE WHEN direction = 'redeem' THEN frxusd_amount ELSE 0 END) AS total_redeem_volume,SUM(CASE WHEN direction = 'mint' THEN frxusd_amount ELSE -frxusd_amount END) AS net_frxusd_minted,SUM(CASE WHEN direction = 'mint' THEN frxusd_amount ELSE frxusd_amount END) AS total_volume,COUNT(CASE WHEN direction = 'mint' THEN 1 END) AS mint_count,COUNT(CASE WHEN direction = 'redeem' THEN 1 END) AS redeem_count,MIN(block_time) AS first_activity,MAX(block_time) AS last_activityFROM eventsGROUP BY 1, 2, 3ORDER BY total_volume DESC