Skip to content

Oracle Extractable Value in DeFi [Part 1]
What Is OEV And How Does It Work?

OEV allows protocols to capture value leaking with liquidations, currently grabbed mostly by MEV bots. If you are a current or potential RedStone client, reach out to our BD team and we will help you implement a secure and scalable Oracle Extractable Value solution!

MEV vs OEV: The Extractable Value Game

The fundamental characteristic of Decentralized Finance (DeFi) is that it operates on a transparent and public ledger, predominantly Ethereum. Due to the decentralised consensus mechanism transactions sent by users can be reordered by block-building parties to extract value. Such dynamics are called Maximal Extractable Value (MEV). There are two major types of MEV: arbitrage between DEXes and liquidation in lending protocols.

Oracle Extractable Value (OEV) is the latter type, obtainable by oracle price feed updates. Nowadays, OEV emerges during liquidation events for example in lending dApps. Oracles enable DeFi protocols to accurately calculate how much the collateral and borrowed assets are worth. Therefore, they’re responsible for delivering the price that will cause a loan to hit the Liquidation LTV (Loan To Value) ratio.

OEV is formed when an oracle updates price data that causes a liquidation. Lending protocols, the second biggest category in DeFi after Liquid Staking, allow users to lock their assets i.e. ETH as collateral and take loans against it, i.e. USDC. The core principle of a lending protocol is to omit bad debt – a situation when the collateral value drops below the loan value. It could be a situation when a user locks 1 ETH worth $4,000 to borrow 2,000 USDC worth $2,000 and then the value of 1 ETH drops to $1,500, making the user better off not repaying the loan. For the protocol, it means that there’s bad debt. To omit that situation liquidation bots would settle the loan when the price of ETH hits the liquidation threshold, i.e. at 1 ETH for $2,500. One could notice that if a liquidation could happen at that price point then the liquidator would roughly be 500 USDC on profit after swapping 1 ETH to 2,500 USDC and repaying the 2,000 USDC loan. That approximate $500 margin is called the liquidations bonus.

However, the fundamental question remains: what should be the bonus to attract liquidators to settle loans? Would for example $100 or $10 be enough for them?

Protocols set the discount, defined by the Liquidation Loan To Value threshold, in the hope of being fulfilled without overpaying too much for liquidator services. In practice, they decide based on past market conditions and the liquidation bonus typically falls somewhere between 5-20%.

OEV In Practice: LRT Looping On Morpho Blue

Let’s look into a simplified example of a common LRT looping strategy. In the example we have:

-> pufETH (The yield-bearing Liquid Restaking Token from Puffer)
-> WETH (Wrapped ETH, the tokenized version of ETH used in DeFi)
-> LTV (Loan To Value, which is the value of the loan divided by its collateral)
-> Morpho Blue (A lending primitive with permissionless market creation capabilities)

  1. Bob uses his 1 pufETH to borrow 0.87 WETH on Morpho. The market has Liquidation (LTV) = 86% (Set i.e. by Gauntlet or Re7 as the MetaMorpho vault operators).

    At the moment of loan creation values are as follows:
    1. Collateral value 1 pufETH = $4,000 (Price Updated by RedStone).
    2. Loan value 0.87 WETH = 0.87 * $3,900 = $3,393 (Price Updated by Chainlink).

Using the above data, the Loan-To-Value of Bob’s loan is $3,393 / $4,000 = 84,83%
User has 86% – 84,83% = 1,17% margin from liquidation.

pufETH & WETH market on Morpho Blue operated by Gauntlet & Re7

  1. Over time there’s been fluctuation in the market. At a certain point, RedStone sends a price update of pufETH to Ethereum that crosses the liquidation threshold:
    1. Collateral value 1 pufETH = $3,030 (Updated by RedStone).
    2. Loan value 0.87 ETH = 0.87 * $3,000 = $2,610 (Updated by Chainlink).

With the new prices, the Loan To Value of Bob’s loan is $2,610 / $3,030 = 86,13% (above 86%)
The user hits the liquidation threshold, so the first eligible liquidator can sell the collateral and repay the loan (note: We assume here no partial liquidations). Let’s assume that new actor in our story, Tom, operates a liquidation bot, which does the job:

  1. Tom’s liquidation bot swaps 1 pufETH for 1.009 ETH on Curve.
  2. Liquidation bot repays 0.87 ETH loan.
  3. Both transactions cost gas worth together 0.039 ETH.
  4. Tom ends up with 1.009 – 0.87 – 0.039 = 0.1 ETH worth $300.

In such a way Tom for solely operating the liquidation bot earned $300, which constitutes 300 / 3030 = 9.9% of the loan value. It’s quite a sweet pay, especially since neither Morpho nor Bob (the borrower) got any of that value. If the loan was 1,000 times bigger the gas cost would become negligible and the profit would be around $300,000.

However, the above analysis overlooks a few aspects for simplicity and one of them is crucial. Due to the public nature of blockchains, it’ll be tough for Tom to hide the low-risk and high-yield strategy from others. Let’s imagine that Alice has heard Tom boasting about his degen and quantitative skills or Charlie simply noticed the liquidation transactions on-chain. In a scenario with multiple actors sending transactions, only the transaction closest to the price update, the one winning the timing game, will succeed and collect the bonus payments.

The competing parties can purely count on their luck or use a strategy to convince block builders to include their transaction just after the one with the price feed update. This approach is usually called back running when an actor tries to put a transaction directly after the other one. A common approach is to send an ordered bundle of transactions in a desired order directly to block builders with a tip to persuade them to pick that offer. There are a few solutions that facilitate this bidding process with MEV-Boost from Flashbots being by far the most popular. In practice, more than 90% of the profit does not end up in Tom’s hands, the winning searcher, but rather within the proposer’s (i.e. Ethereum validator) wallet.

And now, the question is: Can we redirect part of that leaked value here?

As one can notice, the above profit is a byproduct of DeFi architecture and has become another area for optimization. That’s exactly what OEV aims to achieve. Redirect the leaked value from liquidation back to the protocol, and its users. Curious how to achieve that? That depends on the Oracle design and usage of specific tools or tactics. Some solutions intend to create a dedicated chain for liquidations, while others create a wrapper on existing price feeds, delaying the liquidation. RedStone is uniquely positioned to tap into external products while also having the capability to create a native in-built OEV flow. The main reasons are:

  1. Fetching data directly from both CEXes and DEXes allows for quick price data production without relying on intermediaries.
  2. The modular design with a Data Distribution Layer (DDL) makes signed price packages publicly visible before they are sent on-chain. This allows liquidators to analyze the price and quickly calculate a competitive, yet profitable, liquidation proposal without delay.
  3. RedStone can utilize an analogous liquidation logic across Push (RedStone Classic), Pull (RedStone Core), and Perps (RedStone X) models.

All this means that RedStone can create flows that might not be achievable for Oracle providers with a monolithic architecture. Our team is dedicated to researching and testing OEV solutions to establish an equally secure flow to data delivery without OEV. We will continue implementing step-by-step experiments with OEV providers for a fair auction of the price feed that allows for liquidation. The end result?

With RedStone OEV the liquidator with the best “Buy” offer will get the option to liquidate collateral, whereas the earned funds will be redistributed to the dApp itself and its users.

Implementing an auction system to extract OEV increases competition among searchers and minimizes value loss. It’s important to note that searchers are not all malicious actors benefiting at DeFi users’ expense. They profit from inefficiencies in DeFi projects and even help stabilize markets. If rational searchers fail to identify and address economic imbalances and capitalize on protocols’ economic incentives, DeFi protocols and dapps might lack their current robustness. You can check out our first production OEV implementation that leverages UMA’s OVAL product on top of Morpho Blue, starting with pufETH here.

If you’re interested in learning about the various systems used to mitigate OEV and our journey towards secure Oracle Extractable Value, be sure to check out Part 2 of the RedStone OEV series (coming soon 👀).

About RedStone

RedStone is the quickest growing modular oracle delivering diverse, high-frequency data feeds to EVM Layer1, Layer2, Rollup-as-a-Service networks, and beyond, i.e., Starknet, Fuel Network, Casper or TON. By responding to market trends and developer needs, RedStone can support assets not available elsewhere. The modular design allows for data consumption models adjusted to specific use cases, i.e., capital-efficient LSTfi and early support of LRTs. RedStone raised almost $22M from Lemniscap, Blockchain Capital, Maven11, Arrington Capital, Coinbase Ventures, SevenX, IOSG, Stani Kulechov, Sandeep Nailwal, Alex Gluchovski, Emin Gun Sirer, and other top VCs & Angels.