One of FiRM’s most innovative, and perhaps least talked about, features is the implementation of a new price oracle methodology called a Pessimistic Price Oracle, or "PPO." We are unaware of other oracle implementations like it, and it’s a useful tool for DeFi protocol safety that will benefit FiRM users and Inverse Finance DAO.
What was the motivation to build a PPO?
During 2022, Inverse Finance endured two price manipulation exploits which led to bad debt accumulating in the old lending market, Frontier. One of the exploits was sophisticated, requiring a large amount of funds at risk for the attacker, and led us to explore better oracle designs in FiRM. What came of this is the PPO, which is made to extend protection against these and other types of attacks.
2. What is a PPO?
This new approach to price oracles for borrows and liquidations in FiRM uses the lower of two recorded prices: either a) the current collateral price on Chainlink, or b) the 48-hour low price as observed by the PPO on Chainlink, divided by the collateral factor.
For example, if the current Chainlink price for wETH is $1,500, the 48-hour low was $1,000 and the collateral factor is 80%, the PPO returns $1,250. ($1,000 / .80 = $1,250)
3. What is the logic behind the design of the PPO?
Attackers who rely on flash loans and other short-term techniques will be frustrated by the implementation of PPO’s.
First, using the 48-hour low price minimizes the risk of FiRM allowing borrows against a rapidly and artificially inflated collateral asset price.
Second, dividing the 48-hour low price by the collateral factor creates a bias for more conservatism with volatile collateral and more freedom for less volatile collateral like stablecoins.
Finally, the PPO provides greater protection for FiRM along with its other security features such as preventing users from borrowing against more than the lowest recorded value of their collateral over the prior two days. Daily borrow limits curtail the amount of funds at risk and user collateral is not pooled but held separately in an entirely non-custodial way.
4. Why are PPO’s better?
Protocol Safety
The PPO reduces the probability of short-term and flash-loan type oracle price manipulation attacks.
Many oracle price manipulations occur due to low liquidity in a market. For tokens with low liquidity, we believe PPO’s offer a useful tool for lenders and borrowers.
Healthier Borrowing
For those engaged in high-frequency arbitrage or impulse trading, especially with volatile assets, PPO’s may not be ideal. However for long-term borrowers, the target market for FiRM, PPO’s provide added safety for both borrowers and Inverse Finance.
Flexible
The PPO’s observation window can be adjusted over time in either direction, as can collateral factors.
5. How can we expand the use of PPO’s in the future?
PPO’s may provide part of a solution to the volatility issue inherent in many – if not most – tokens in the marketplace today, in particular for tokens without a Chainlink oracle. Lenders who are unwilling to lend against an asset without a Chainlink oracle today may find that PPO’s provide an additional safety tool.
We may implement PPO’s using different parameters as we add new collateral assets. Today, the PPO is adhering to a 48-hour observation window but for more volatile assets it may be prudent to expand that window. Similarly we can consider a shorter window for “blue chip” assets.