Query editor
-- frxUSD Custodians — Daily Native Mint/Redeem Volume (all custodians combined)-- Native primary-market volume only (ERC-4626 Deposit/Withdraw on the custodians).-- Secondary-market frxUSD transfers are excluded by construction.-- 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 (SELECTl.block_time,-- shares = frxUSD amount (2nd 32-byte word of data, 18 decimals)bytearray_to_uint256(bytearray_substring(l.data, 33, 32)) / 1e18 AS frxusd_amount,CASEWHEN l.topic0 = 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7THEN 'mint' -- Deposit(address,address,uint256,uint256)ELSE 'redeem' -- Withdraw(address,address,address,uint256,uint256)END AS directionFROM ethereum.logs lJOIN custodians c ON l.contract_address = c.custodianWHERE l.topic0 IN (0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7,0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db)),daily AS (SELECTDATE_TRUNC('day', block_time) AS day,SUM(CASE WHEN direction = 'mint' THEN frxusd_amount ELSE 0 END) AS mint_volume,SUM(CASE WHEN direction = 'redeem' THEN frxusd_amount ELSE 0 END) AS redeem_volume,COUNT(CASE WHEN direction = 'mint' THEN 1 END) AS mint_count,COUNT(CASE WHEN direction = 'redeem' THEN 1 END) AS redeem_countFROM eventsGROUP BY 1)SELECTday,mint_volume,-redeem_volume AS redeem_volume,mint_volume + redeem_volume AS total_volume,mint_volume - redeem_volume AS net_flow,mint_count,redeem_count,mint_count + redeem_count AS total_txns,-- CumulativeSUM(mint_volume) OVER (ORDER BY day) AS cumulative_mint_volume,-SUM(redeem_volume) OVER (ORDER BY day) AS cumulative_redeem_volume,SUM(mint_volume - redeem_volume) OVER (ORDER BY day) AS cumulative_net_flowFROM dailyORDER BY day DESC