CoolerLtvOracle.sol
CoolerLtvOracle controls how much USDS can be borrowed against gOHM. Rather than using external market prices, it uses two key thresholds:
Origination LTV: Maximum borrow amount for new loans
Liquidation LTV: Higher threshold amount that triggers liquidations
The Origination LTV can only increase over time through a linear "drip" system - this means each increase must specify a target value and the time period to reach it. The Liquidation LTV is set as a premium above the Origination LTV.
Functions
View Functions
currentLtvs()
Returns current origination and liquidation LTVs
Calculates origination LTV based on drip progress
Adds premium to get liquidation LTV
currentOriginationLtv()
Returns current max borrow amount
If before target time: calculates based on slope
If after target time: returns target value
currentLiquidationLtv()
Returns current liquidation threshold
Calculated as origination LTV + premium
Admin Functions
setOriginationLtvAt(uint96 targetValue, uint32 targetTime)
Sets new origination LTV target and time to reach it
Must increase or stay same (cannot decrease)
Checks against max delta and rate of change limits
setLiquidationLtvPremiumBps(uint16 premiumBps)
Sets premium above origination LTV for liquidations
Cannot exceed max premium
Cannot decrease current premium
Safety Bounds
setMaxOriginationLtvDelta(uint96 maxDelta)
Maximum allowed increase in origination LTV
setMinOriginationLtvTargetTimeDelta(uint32 minTargetTimeDelta)
Minimum time period for LTV changes
setMaxOriginationLtvRateOfChange(uint96 originationLtvDelta, uint32 timeDelta)
Maximum speed of LTV increases
Last updated