Introduction
On Dec-05-2024 10:28 PM +UTC Bitcoin experienced a flash crash, sending the price from $98,000 to $90,500 on Binance, $91,700 on Kraken, and similar levels on other exchanges. The price recovered to $96,000 within 4 minutes.
Despite the rapid recovery, the volatility was sufficient to drive 3 liquidations on Euler, all of which involved positions in which a user had used one form of wrapped bitcoin (LBTC or WBTC) to borrow cbBTC. Under normal circumstances, such positions would be considered to be at relatively low risk of liquidation, given that both collateral and debt should be valued similarly. However, in this circumstance, the pace and scale of the volatility was sufficient to drive the price of LBTC and WBTC substantially lower than cbBTC, causing cbBTC borrowers to experience a rapid decline in the health of their positions, eventually leading to liquidation.
Here, we investigate the root cause of these price differences in detail. We conclude that liquidations were caused by two main factors: a) real differences in pricing of cbBTC relative to WBTC and LBTC on secondary markets due to the unique risk factors of different wrapped BTC assets and inefficiencies in arbitrage for cbBTC; and b) unexpected behaviour of the cbBTC price feed. We end by proposing that Euler DAO refund liquidated users in full, and suggest Euler DAO re-evaluate Euler Prime’s oracle configuration, and consider replacing the cbBTC market price feed with an alternative pricing solution, such as a fundamental price.
Real differences in cbBTC pricing
The bitcoin flash crash affected BTC and all of its wrapped equivalents on Ethereum: LBTC, WBTC, cbBTC, and tBTC. However, each of these assets comes with its own unique risk profile and liquidity. These differences led to quite different behaviours in terms of pricing during the flash crash, with WBTC trading below the price of BTC, but cbBTC trading much higher than the price of BTC. These differences can be seen in the graph below, which plots the price as recorded by Pyth validators:
Fig 1. Secondary market prices of WBTC and cbBTC differed significantly during the flash crash. Note: Although the data here was helpfully provided by Pyth, it is important to stress that no Pyth oracles were involved in recent liquidations.
The higher price of cbBTC relative to other BTC asset is perhaps explained by the fact that cbBTC is a newer asset, with a less efficient arbitrage network, and that most of its liquidity is onchain, where block times and gas prices make arbitrage less efficient, whereas a lot of BTC and WBTC liquidity is found on centralised exchanges, where arbitrage is relatively efficient. Whether or not oracles should price these assets as equivalent to BTC or not depends on your perspective. If you are a BTC wrapped asset collateral user, you would want to use the highest price available. If you are a BTC wrapped asset borrower, you would want to use the lowest price available.
Liquidations on euler
During the flash crash, 3 leveraged BTC positions in Euler Prime were liquidated for a total of ~$120,450 collateral seized (~1.2546 BTC). The biggest liquidation (~$80,256) was captured by the liquidation bot run by Euler Labs while the other two liquidations were captured by front-running bots:
- Liquidation 1 on block 21339286 (10:30:23 PM UTC), realizing a loss of 0.2386 wBTC + 0.0385 cbBTC (~$26,601) for the account 0x14bBD3b28CAa94B8A578389E6D6cD7d95e46C980. The position consisted of 3.8756 WBTC of collateral and 3.5870 cbBTC debt (Tx trace).
- Liquidation 2 on block 21339289 (10:30:59 PM UTC), realizing a loss of 0.1119 LBTC + 0.0297 cbBTC (~$13,593) for account 0x40534E513dF8277870B81e97B5107B3f39DE4f15 (s5000.eth). The position consisted of 2.9378 LBTC of collateral and 2.7897 cbBTC debt (Tx trace).
- Liquidation 3 on block 21339294 (10:31:59 PM UTC), realizing a loss of 0.1682 cbBTC + 0.6678 LBTC (~$80,256) for account 0x344d9C4f488bb5519D390304457D64034618145C. The position consisted of 16.3599 LBTC of collateral and 15.4844 cbBTC debt (Tx trace).
Euler Prime’s oracle configuration calculates the price of assets in terms of USD:
- WBTC uses a CrossAdapter that crosses (multiplies) Chainlink’s WBTC/BTC and Chainlink’s BTC/USD.
- cbBTC uses a CrossAdapter that crosses (multiplies) Chronicle’s cbBTC/USDC and Chainlink’s USDC/USD.
- LBTC uses a CrossAdapter that crosses (multiplies) RedStone’s LBTC_FUNDAMENTAL/BTC and Chainlink’s BTC/USD.
We analyzed how these oracles behaved on blocks 21339270-21339300 spanning the duration of the BTC flash crash. We included Chainlink’s cbBTC/USD oracle as well to compare its performance against Chronicle. We included top-of-block price data on major DEX pairs to assess the extent of the flash crash onchain:
- Chronicle USDC/USD, Chainlink WBTC/BTC, and RedStone LBTC/BTC remained constant as expected.
- Chainlink BTC/USD started at $98521.00, updated to $97270.63 on block +3, $96028.96 on block +7, and $92784.91 on block +9.
- Chronicle cbBTC/USDC started at $98964.08 and did not update.
- Chainlink cbBTC/USD started at $99800.91, updated to $97752.76 on block +8, and did not update further.
- The cbBTC/USDC pool on Uniswap V3 followed the crash observed on centralized exchanges. The price dropped to $92761.96 on block +8, and sustained a level under $94,000 until block +15.
The full analysis can be found in this spreadsheet.
Unexpected configuration of the oracle pricing
Although all oracles reported a higher price of cbBTC relative to other BTC assets, which reflected very real price differences on secondary markets, our deeper analysis of oracle state also revealed unexpected behavior of Chronicle’s cbBTC oracle, which did not reflect the secondary market price with the level of sensitivity expected during the crash. This was due to the configuration of Chronicle's mainnet Oracles, which are optimistic in nature, leading to overvalued debt of 3 users relative to the value of their collateral.
The deviation threshold of Chronicle’s cbBTC oracle is 1%, therefore the price should have been updated as soon as a price below $97974.44 was observed. In Chronicle’s system, prices are continuously monitored by a peer-to-peer network of validators. Each validator pulls prices from several CEX and DEX venues and aggregates them into a single price value. Price values from all validators are collected, and the median is selected and transmitted as the true price. If this price crosses the deviation threshold, then an onchain update transaction is executed. Chronicle oracles have a transparent and verifiable data flow, allowing us to see which validators participated in the round, their aggregated price and timestamp, as well as every price observed on the CEX/DEX venues.
After conducting research and speaking to the Chronicle team, we concluded that there was an anomalous price aggregation round for the cbBTC/USDC oracle on block 21339296 (Chronicle dashboard). During this round 13 validators participated and reported prices ranging from $93,810.02 (Validator Euler Labs) to $98,252.78 (Validator ETHGlobal), with a median of $96,154.97 selected as the true price. Several unexpected things were observed:
- Validators reported prices at different times. Validator ETHGlobal reported a price timestamped at 10:25:50, while Validator 0xFbaF3a…5F5D00 reported a price timestamped at 10:29:20, with a total spread of 210 seconds. The rest of the validators reported prices uniformly in the time range.
- The price update landed onchain on block 21339296 (tx) at timestamp 10:32:23, 6.5 minutes after the earliest price, and 3 minutes after the latest price. By the time this transaction landed, the flash crash had already stabilized and BTC had recovered to $96,000.
The price was updated with opPoke, an optimistic price submission function which delays the visibility of the price by 20 minutes. In effect, the update to $96,154.97 was not observed until 99 blocks after the fact. After speaking with the Chronicle team, they confirmed that this behavior is intended. Chronicle’s alternative, immediate price update was not triggered during the flash crash.
The Chronicle team further confirmed that the oracle’s 1% deviation threshold as displayed on their dashboard is configured for optimistic updates through opPoke, whereas there is a substantially higher 5% deviation threshold for immediate updates to supersede opPoke. They confirmed that this parameter is neither shown in the dashboard nor the documentation, but is a dynamic configuration parameter in the relayer. The Euler Labs team and auditors of the pricing smart contracts were not previously aware of this. The Chronicle team promptly acknowledged this and are working to optimize its performance and improve transparency.
Insights into pricing strategy
How assets are priced in lending protocols varies significantly across DeFi. All pricing methodologies come with significant trade-offs.
Some users have suggested that cbBTC, WBTC, and LBTC might be better pegged to the price of BTC, rather than their own underlying, so that they are all equal to one another. This strategy might work well in helping borrowers who have carry trades open on a lending protocol. However, it would arguably punish users who were long cbBTC against USD, since those users might be unfairly liquidated if their cbBTC collateral was underpriced relative to the real trade price for cbBTC on secondary markets. There is no perfect pricing solution for these kinds of assets.
Whether or not oracles should price derivative assets as equivalent to BTC or not depends on your perspective and is very much open for debate. If you are a BTC wrapped asset collateral user, you would want to use the highest price available. If you are a BTC wrapped asset borrower, you would want to use the lowest price available.
Ultimately, it is important to stress that bitcoin wrapped assets are not all made equal and there is no reason why they should trade at the same identical price. They all carry their own unique risks, relating to custody, withdrawal times, centralisation, and liquidity risks. These differences in risk profile can lead the market to value these assets very differently, as shown in Fig. 1 above. Using a fixed BTC oracle for derivative assets can therefore help to lower risks for wrapped BTC borrowers during temporary price discrepancies, but carries significant risks to lenders during longer term price dislocations owing to fundamental differences in BTC wrapped assets. A sustained ‘depeg’ that is not properly captured by an oracle can quickly lead to bad debt.
It has also been suggested that Euler might have benefitted from using Chainlink cbBTC pricing instead of Chronicle within Prime. However, it is important to note that Chainlink cbBTC oracle also did not report a large price fall in cbBTC, as can be seen in the spreadsheet. If Euler Prime had used Chainlink instead of Chronicle for cbBTC then liquidations on Euler would still have happened.
Conclusions
After conducting this analysis, Euler Labs has concluded that there are two root causes for the liquidations: 1) inefficiencies in arbitrage for cbBTC, which dampened its response to Bitcoin’s price shock; and 2) the unexpected behavior of Chronicle’s optimistic oracle on mainnet in response to extreme price movements. Given these unique circumstances, Euler Labs therefore proposes to the Euler DAO to: a) refund liquidated users in full; and b) re-evaluate Euler Prime’s oracle configuration to replace the Chronicle cbBTC price feed with an alternative price feed. It is important to stress, however, that the cause of liquidations on Euler was at least partly driven by real differences in secondary market pricing for cbBTC during bitcoin’s flash crash, and not just driven by oracle anomalies.
This content is brought to you by Euler Labs, which wants you to know a few important things.
This piece is provided by Euler Labs Ltd. for informational purposes only and should not be interpreted as investment, tax, legal, insurance, or business advice. Euler Labs Ltd. and The Euler Foundation are independent entities.
Neither Euler Labs Ltd., The Euler Foundation, nor any of their owners, members, directors, officers, employees, agents, independent contractors, or affiliates are registered as an investment advisor, broker-dealer, futures commission merchant, or commodity trading advisor or are members of any self-regulatory organization.
The information provided herein is not intended to be, and should not be construed in any manner whatsoever, as personalized advice or advice tailored to the needs of any specific person. Nothing on the Website should be construed as an offer to sell, a solicitation of an offer to buy, or a recommendation for any asset or transaction.
This post reflects the current opinions of the authors and is not made on behalf of Euler Labs, The Euler Foundation, or their affiliates and does not necessarily reflect the opinions of Euler Labs, The Euler Foundation, their affiliates, or individuals associated with Euler Labs or The Euler Foundation.
Euler Labs Ltd. and The Euler Foundation do not represent or speak for or on behalf of the users of Euler Finance. The commentary and opinions provided by Euler Labs Ltd. or The Euler Foundation are for general informational purposes only, are provided "AS IS," and without any warranty of any kind. To the best of our knowledge and belief, all information contained herein is accurate and reliable and has been obtained from public sources believed to be accurate and reliable at the time of publication.
The information provided is presented only as of the date published or indicated and may be superseded by subsequent events or for other reasons. As events and markets change continuously, previously published information and data may not be current and should not be relied upon.
The opinions reflected herein are subject to change without being updated.