
Euler · Reads onchain state
Reads how an Euler controller vault values an account's collateral against its debt. accountLiquidity prices every collateral the account has enabled at the vault's oracle, weighs each by the LTV the vault grants it (the liquidation LTV when asked at liquidation LTVs, the borrow LTV otherwise), and reports that collateral value beside the value of the account's debt, both in the vault's unit of account at 18 decimals. The account stays liquidation-safe while the first exceeds the second at liquidation LTVs, and can borrow more while it does at borrow LTVs. The vault must be the account's controller. Reach for it to repay or add collateral before the account's margin runs out, holding the gap above a floor with a predicate.