FEI is pegged to $1 USD and needs to have the most robust and accurate access to the value of its peg. This post aims to kick off a discussion about transitioning our primary oracle to Chainlink ETH/USD from the existing Uniswap ETH-USDC TWAP.
At present, Fei Protocol utilizes the UniV2 ETH-USDC TWAP oracle as the reference mechanism. This is a reliable and effective deployment, but with an ever-evolving DeFi ecosystem, it would be worthwhile to evaluate available options and consider upgrading to a more robust approach. As part of an in-process audit, we wanted to help diversify the idiosyncratic risk of our current oracle by introducing support for Chainlink oracles, and the ability for including a backup oracle. For increased manipulation resistance and faster response to sharp market moves, in addition to improving on some drawbacks of the current TWAP, we propose using Chainlink as the primary oracle.
The current implementation requires UniV2 swaps on the FEI token every 10 minutes to keep an up-to-date oracle value. Fei Labs has been manually maintaining the oracle outside of these automatic updates. This is not a scalable solution, and subject to failure if our relayer runs out of gas or encounters an error. This periodic update also increases user gas costs for those transactions where the update is triggered.
The most important reason to consider switching oracles is security. The current oracle relies on USDC, which makes USDC risk a central point of failure for Fei protocol, and goes against the protocol’s efforts to remain as decentralized as possible. Another consideration is that, as liquidity drops from UniV2 and transitions to UniV3, it could subject the existing oracle to cheaper price manipulation.
The design of robust oracles is a challenging undertaking, as many high-profile oracle attacks have shown in the last year. Ensuring that our oracle is resistant to manipulation is a technical challenge we as a community need to address.
Chainlink has a robust oracle network, which leverages data from both on- and off-chain sources. Many other Ethereum projects collectively support the Chainlink ETH/USD oracle, including Synthetix, Aave, Set Protocol, Loopring, and many more. Chainlink serves as a sustainable service for the Ethereum ecosystem, and has become the de facto oracle provider across DeFi.
We recognize the decentralization trade-off due to the fact that Chainlink has an admin multisig, which determines which oracles are included in the aggregation. For this reason, we propose to include Uniswap TWAPs as a fallback oracle that can be triggered by the Guardian. This distributes risks between the two sources, while simultaneously aligning us more closely with the Chainlink ecosystem.
We want to hear from the Tribe with regard to moving in this direction, so we can act accordingly.