Query editor
-- Lido V3 stVault: Health Factor (UI-parity using the same 3.5% reserve gross-up you already use)-- Health Factor (%) = Total Value / (stETH Liability / (1 - reserve_ratio)) * 100WITHparams AS (SELECT 0.035 AS reserve_ratio),r AS (SELECTreportTotalValue / 1e18 AS total_value_eth,reportInOutDelta / 1e18 AS unstaked_balance_eth,reportLiabilityShares,reportCumulativeLidoFees,reportSlashingReserve,evt_block_timeFROM lido_ethereum.vaulthub_evt_vaultreportappliedWHERE vault = 0x62e0d92cf7b8752b5292b9bcbbace4cfa1633428ORDER BY evt_block_time DESCLIMIT 1),rebased AS (SELECT(posttotalether * 1.0) / NULLIF(posttotalshares, 0) AS steth_per_shareFROM lido_ethereum.steth_evt_tokenrebasedWHERE evt_block_time <= (SELECT evt_block_time FROM r)ORDER BY evt_block_time DESCLIMIT 1),calc AS (SELECTr.total_value_eth,r.unstaked_balance_eth,-- stETH liability valued in ETH terms at the latest rebase <= report time(r.reportLiabilityShares * rebased.steth_per_share) / 1e18 AS steth_liability,(r.reportCumulativeLidoFees + r.reportSlashingReserve) / 1e18 AS fee_obligations_ethFROM rCROSS JOIN rebased),final AS (SELECTc.total_value_eth,c.steth_liability,-- Locked by collateral (gross-up by reserve ratio)c.steth_liability / (1 - p.reserve_ratio) AS eth_locked_by_collateral,-- Health factor (ratio + percent)c.total_value_eth/ NULLIF(c.steth_liability / (1 - p.reserve_ratio), 0) AS health_factor,100 * (c.total_value_eth/ NULLIF(c.steth_liability / (1 - p.reserve_ratio), 0)) AS health_factor_pct,