Query editor
-- ARM (Autonomous Interest Rate Manager, liquity/bold-ir-management) batch managers.-- Trio A deployed 2025-05-29, trio B deployed 2025-05-30, one contract per branch.-- BatchOperation enum (ITroveEvents.sol): 0 registerBatchManager, 1 lowerBatchManagerAnnualFee,-- 2 setBatchManagerAnnualInterestRate, 3 applyBatchInterestAndFee, 4 joinBatch, 5 exitBatch, 6 troveChange.WITH bu AS (SELECT 'WETH' AS branch, _interestBatchManager AS mgr, CAST(_operation AS integer) AS op,CAST(_debt AS double)/1e18 AS bdebt,CAST(_annualInterestRate AS double)/1e16 AS brate,CAST(_annualManagementFee AS double)/1e16 AS mgmt_fee_pct,CAST(_totalDebtShares AS double)/1e18 AS tshares,CAST(_debtIncreaseFromUpfrontFee AS double)/1e18 AS upfront_fee,evt_block_time AS bt, CAST(evt_index AS bigint) AS ei, evt_tx_hash AS txhFROM liquity_v2_ethereum.trovemanager_weth_evt_batchupdatedWHERE evt_block_date >= DATE '2025-01-01'AND _interestBatchManager IN (0x42f38f32ee2d6d62352566656358dfa0a96deffc,0xe507e4d0763851a6287238aadd243948d18ab60a)UNION ALLSELECT 'wstETH', _interestBatchManager, CAST(_operation AS integer),CAST(_debt AS double)/1e18, CAST(_annualInterestRate AS double)/1e16,CAST(_annualManagementFee AS double)/1e16, CAST(_totalDebtShares AS double)/1e18,CAST(_debtIncreaseFromUpfrontFee AS double)/1e18,evt_block_time, CAST(evt_index AS bigint), evt_tx_hashFROM liquity_v2_ethereum.trovemanager_wsteth_evt_batchupdatedWHERE evt_block_date >= DATE '2025-01-01'AND _interestBatchManager IN (0x8069d9cc7ab443a06f7e639d703eb0819cf0a2b9,0x8869a6fb59a8df330f90d9fbf46ebfaff6d4bc14)UNION ALLSELECT 'rETH', _interestBatchManager, CAST(_operation AS integer),CAST(_debt AS double)/1e18, CAST(_annualInterestRate AS double)/1e16,CAST(_annualManagementFee AS double)/1e16, CAST(_totalDebtShares AS double)/1e18,CAST(_debtIncreaseFromUpfrontFee AS double)/1e18,evt_block_time, CAST(evt_index AS bigint), evt_tx_hashFROM liquity_v2_ethereum.trovemanager_reth_evt_batchupdatedWHERE evt_block_date >= DATE '2025-01-01'AND _interestBatchManager IN (0x471d636f6bb50bba23ec1df56c5b4aa2dfa789ba,0x7700b2d305f47ae82e9598bab6d7ccb57299a82b)),-- rate carried by the immediately preceding event of any kind, so we can see what the change moved fromseq AS (SELECT b.*,LAG(brate) OVER (PARTITION BY branch, mgr ORDER BY bt, ei) AS rate_prev_any_eventFROM bu b),-- cadence measured over rate changes onlychg AS (SELECT s.*,LAG(bt) OVER (PARTITION BY branch, mgr ORDER BY bt, ei) AS prev_chg_bt,LAG(brate) OVER (PARTITION BY branch, mgr ORDER BY bt, ei) AS prev_chg_rateFROM seq sWHERE op = 2)SELECT branch,mgr AS arm_contract,bt AS changed_at,prev_chg_rate AS rate_before_pct,