12/26/22
Oracles are a single point of failure and can make or break a DeFi protocol. They are reliable until a black swan event happensâŚ
Unfortunately, crypto is a flock of black swans, so you better be prepared.
There are a plethora of resources to understand the importance of oracles. We recommend this interview if you are interested.
But whatâs the status quo of oracles? We know that no solution is perfect, but we must understand whatâs going on in order to make informed decisions. We must be aware of the risks and act accordingly.
âBut we have Chainlink! A decentralized solution that works like a charmâ
TL;DR:Â Chainlink is the most widely used solution in DeFi. Itâs the most reliable and cheap, but incentives for nodes are centralized and non-scalable, making the whole system permissioned.
Incentives are centralized:Â Right now, incentives for data feeders are not decentralized since they rely on Chainlink, a centralized entity. They are subsidized and paid via LINK emissions from a multi-sig (an additional potential point of failure).
Incentives will keep being centralized: An upgrade is scheduled for decentralizing these payments using a stake/slash mechanism. The Chainlink Node Operator recently paid 30M LINK to bootstrap these mechanisms.
Notice this is still centralized/subsidized, and itâs relying on the assumption that eventually, users will sponsor data feeders
This is not sustainable in the long run
What happens if Chainlink stops working? (regulations / prolonged bear market / mismanagement / etc.)
Corruption risk: Nodes are in charge of billions of dollars in DeFi, which is dangerous even with slashing mechanisms.
Even if unlikely, there is room for censorship/bribery and extortion.
Nodes monopolize MEV: even though we canât say this is a corrupted procedure, it is an undesirable property of a decentralized system.
Scaling tension:Â Reward system is not compatible with scaling
The more nodes on the system (more decentralized), the more rewards dilute for each of them.
The more data fed into the system, the more rewards dilute for each node.
Permissioned:Â As a result of the scaling tension, incentivized Data feeds are whitelisted.
There are also issues with the API, software, and gas dependence.
âWell, at least Maker secures its $8b billion with a custom-made oracle. We can copy that model, right? right?â
TLDR:Â Makerâs internal oracle, which defends more than $8b, is expensive to maintain and therefore, not efficient for scale.
Maker uses their oracle to report collateralsâ prices in the protocol. Although this oracle is not designed to be used by other protocols, we might consider using the same methodology on our protocol, right?
Unsustainable: Having an entire network of keepers frequently updating costs requires gas subsidies and enough incentives to make this task worthwhile. This might not be an issue for Maker but it is for small and medium protocols.
Gas dependance: Maker also had issues with gas dependence.
âUniswap is full of Giga brains; Uniswap v3 must be the solution!â
TLDR:Â Uniswap v3 introduced a novel way of querying price data. It is decentralized and sustainable (thanks to swappers and LPâs subsidies), but it is complicated to rely on due to liquidityâs unpredictability.
Uniswap has the most decentralized and sustainable solution for oracles, but it also has a long track of exploits and manipulations. This improved after v3, but itâs still happening, and itâs prone to a PoS multi-block attack.
Trust issues:Â Oracle quality depends on poolâs liquidity, but that depends on external providers.
Most LPs stay for as long as itâs profitable, making it hard for the users of the oracle to predict the oracleâs future status.
Even protocols that provide liquidity for their own token might decide to remove liquidity for a set of different reasons at any time.
Complexity:Â Concentrated liquidity is a double-edged sword. It enormously increases capital efficiency for LPs, but it also makes manipulation easier.
Multi-block attack: With the recent move from PoW to PoS consensus on Ethereum, predictability on block proposers was also introduced. Chances are that some big players will propose multiple blocks in a row with high frequency. A potential attack on Uniswap TWAP could consist of price manipulation while leaving out of the blocks any external arbitrage, hence doing this for free (minus trading fees).
Medians were suggested several times as an alternative to the standard TWAP to filter away multi-block attacks. But:
Median filters away fast movements but cannot differentiate manipulations from legitimate price swings.
Medians are always laggier than TWAPs (see Uniswap below), as they take longer to react.
Medians are not smooth, a desirable property for many use cases (Dutch auction liquidations, for instance).
Price is a permissionless and reliable solution that leverages UniV3 and keeper automation to provide safe price quotes on any existing token.
Price is built on top of Uniswap v3, thus inheriting all its decentralization and sustainable features. In addition, it solves the issues we marked above:
Trust issues:Â Price makes liquidity trustworthy and predictable for the oracleâs users.
Complexity:Â Everything is managed by smart contracts. We created a hassle-free experience for our users.
Multi-block attacks:Â Price uses automation to detect and correct price manipulations, including multi-block attacks. These corrections unlock safer, more precise TWAPs, even for short time frames.