Query editor
-- =====================================================================-- REAH — TVL per vault, as of 1 July 2026 (snapshot)-- Same 13 OAV contracts as before. Changes vs. previous version:-- 1. Output pinned to 1 July 2026 (see WHERE at bottom).-- 2. Dropped the `tvl_per_vault > 0.01` dust filter so ALL 13 vaults-- show, including the ~0.0007 WETH vault.-- 3. Added `oav_addr` and `report_name` to the output so each row maps-- straight to your reporting sheet.---- Note on naming: `report_name` matches your sheet ("Prime Vault",-- "Prime Vault 2/3/4", ...). The eth and base legs of a vault share the-- same report_name, so if your sheet wants one line per logical vault,-- sum the two chain rows. `vault_name` stays chain-unique because the-- balance window functions PARTITION on it — collapsing the names would-- merge two OAVs' balances and corrupt the running total.---- gt* Morpho vault tokens have no prices.usd feed, so their price is-- derived as pps (from the gateway vault's own ERC4626 events) ×-- underlying token price.-- =====================================================================WITH vaults AS (SELECT * FROM (VALUES-- report_name, vault_name (unique key), oav_addr, gateway_token, token_decimals, underlying_addr, needs_pps, chain('Reah Gauntlet USDC Prime Vault', 'Reah Gauntlet USDC Prime Vault (eth)', 0xae63325DF4c27376f9D46059fd1C36019c8ad5ac, 0x8c106eedad96553e64287a5a6839c3cc78afa3d0, 18, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, true, 'ethereum'),('Reah Gauntlet USDC Prime Vault', 'Reah Gauntlet USDC Prime Vault (base)', 0x0BeAE7EfC6C7C83eab05dB38b2313d81B46059B3, 0x050ce30b927da55177a4914ec73480238bad56f0, 18, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, true, 'base'),('Reah Gauntlet USDC Prime Vault 2', 'Reah Gauntlet USDC Prime Vault 2 (base)', 0xF809FcCC48dF108d92dF4c1Dd3610bA9FEFF47f6, 0x050ce30b927da55177a4914ec73480238bad56f0, 18, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, true, 'base'),('Reah Gauntlet USDC Prime Vault 2', 'Reah Gauntlet USDC Prime Vault 2 (eth)', 0x0e6caCC905de5117e131D610B178B28Ef4e84aDc, 0x8c106eedad96553e64287a5a6839c3cc78afa3d0, 18, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, true, 'ethereum'),('Reah Gauntlet USDC Vault', 'Reah Gauntlet USDC Vault', 0xe9915E300407CA84910AD976406A0053cABffF6e, 0xdd0f28e19c1780eb6396170735d45153d261490d, 18, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, true, 'ethereum'),('Reah Gauntlet USDC Prime Vault 3', 'Reah Gauntlet USDC Prime Vault (base 2)', 0x9Fa299522e0075250b94b3e45F0BB769A0560246, 0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61, 18, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, true, 'base'),('Reah Gauntlet WETH Vault', 'Reah Gauntlet WETH Vault', 0x764b5F3616745c38AF9dbCE2E907e7DA41C1D45e, 0x2371e134e3455e0593363cbf89d3b6cf53740618, 18, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, true, 'ethereum'),('Reah Gauntlet USDC Vault 2', 'Reah Gauntlet USDC Vault 2', 0x87426F2020a0400c40B742363051b3466b0c3DdB, 0xdd0f28e19c1780eb6396170735d45153d261490d, 18, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, true, 'ethereum'),('Reah Gauntlet USDC Prime Vault 4', 'Reah Gauntlet USDC Prime Vault 2 (base 2)',0x985b9fbFEA318Ee0962e7e591288e6423C401142, 0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61, 18, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, true, 'base'),('Reah Gauntlet WETH Vault 2', 'Reah Gauntlet WETH Vault 2', 0x51a7E70D85668Cb3D9F31b6994920eBf0D15F93f, 0x2371e134e3455e0593363cbf89d3b6cf53740618, 18, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, true, 'ethereum'),('Reah Savings USDS 2', 'Reah Savings USDS 2', 0xc112341441D7197E908e38296b1457d8C7ce064B, 0x3132e002cd82eb33f120b627e0f49ef5f97c7b90, 18, 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD, false, 'ethereum'), -- sUSDSg priced straight off sUSDS('Reah Spark Savings USDT 2', 'Reah Spark Savings USDT 2', 0xA360E844790Be3A13e72bEabb8Bb3e94198207bf, 0x583156ff3bb63a70a6a5bb311754fd0d6cb327ba, 6, 0xdAC17F958D2ee523a2206206994597C13D831ec7, false, 'ethereum'),('Reah Spark Savings USDC 2', 'Reah Spark Savings USDC 2', 0x8eaD252e5fc3eC2386DFA860F21ABf70b4967a75, 0xcde73fadeb398b5d307db0ddef7f37f23459cc87, 6, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, false, 'ethereum'),('Reah Spark Savings USDC', 'Reah Spark Savings USDC', 0xAdcabae264A690a2ECc456e08e26C491Ef055557, 0xcde73fadeb398b5d307db0ddef7f37f23459cc87, 6, 0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, false, 'ethereum'),('Reah Spark Savings USDT', 'Reah Spark Savings USDT', 0x0856e899Dc180c7a9a0d0372852b896800b2a6aD, 0x583156ff3bb63a70a6a5bb311754fd0d6cb327ba, 6, 0xdAC17F958D2ee523a2206206994597C13D831ec7, false, 'ethereum'),('Reah Savings USDS', 'Reah Savings USDS', 0x762611701A9E5400aF570b85fEa05D617F07a268, 0x3132e002cd82eb33f120b627e0f49ef5f97c7b90, 18, 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD, false, 'ethereum')) AS t(report_name, vault_name, oav_addr, gateway_token, token_decimals, underlying_addr, needs_pps, chain)),-- -------------------------------------------------------------------- OAV balance tracking: gateway-token transfers in/out of the OAV-- ------------------------------------------------------------------transfers AS (SELECT v.vault_name, v.chain, v.underlying_addr, v.token_decimals,tr.evt_block_time AS block_time,CASE WHEN tr."to" = v.oav_addr THEN CAST(tr.value AS DOUBLE)ELSE -CAST(tr.value AS DOUBLE) END AS raw_deltaFROM erc20_ethereum.evt_Transfer trJOIN vaults v ON v.chain = 'ethereum'AND tr.contract_address = v.gateway_tokenAND (tr."to" = v.oav_addr OR tr."from" = v.oav_addr)UNION ALLSELECT v.vault_name, v.chain, v.underlying_addr, v.token_decimals,tr.evt_block_time,CASE WHEN tr."to" = v.oav_addr THEN CAST(tr.value AS DOUBLE)ELSE -CAST(tr.value AS DOUBLE) END