Using our risk framework and Uniswap V3 price impact tool we give WBTC the highest possible oracle rating.
For maximum security of the oracle, it needs to fulfil 3 criteria:
- Liquidity is provided over the full price range
- Elevating the TWAP (Time-Weighted-Average-Price) to a meaningful extent is impossible or extremely costly.
- Depressing the TWAP to a meaningful extent is impossible or extremely costly.
Meaningful extent is contingent on the effective factor (CF X BF) and will be addressed in the analysis.
A quick glance over the liquidity profile of the 0.3% WBTC/WETH pool reveals not only substantial TVL, but also that the liquidity is spread across the full range:
Let us explore hypothetical attack vectors.
Here we consider the likelihood of a ‘Pump Collateral Attack’. This attack follows the following pattern:
- Attacker deposits WBTC.
- Attacker inflates the oracle price of WBTC by x% by swapping ETH into the WBTC/WETH pool on Uniswap.
- Attacker uses the artificially inflated price to borrow more assets from Euler than they ordinarily would be allowed to.
In this scenario, we are trying to find out by how much the TWAP needs to be manipulated for the attacker to start breaking even (x%).
This largely depends on the effective borrowing factor. By depositing WBTC and borrowing USDC, he is subject to the proposed WBTC collateral factor (0.88) and USDC borrow factor (0.94). The effective factor is 0.8272 (0.88 x 0.94), meaning before the attack, depositing $1 million worth of WBTC allows a user to borrow up to $827.2k worth of USDC.
To make that borrowable USDC worth $1 million, the attacker must inflate WBTC by a certain %. That would be approximately 20.9%, as (1+0.209)*0.8272 = 1.
Using our oracle tool, we can determine the size of the trade necessary to inflate the price of WBTC/WETH TWAP pool by 20.9%.
The cost to perpetrate the attack is a staggering $122 billion.
A 2-block attack is more feasible, but still incredibly expensive and likely to fail given the full range liquidity creates arbing opportunities for the entire market:
Please note that since it’s a TWAP, flashloan attacks are not feasible. The attacker needs to actually put capital at risk by waiting for the next block so the TWAP updates.
Crashing the price of WBTC collateral doesn’t make as much economic sense as inflating to borrow funds, but it would still have negative consequences. Namely, everyone borrowing assets against WBTC would be liquidated.
Let us simulate a 10% TWAP drop within a one-block attack:
Clearly, dumping WBTC is less costly than pumping it, which makes sense given lower liquidity on the downside vs upside on Uniswap.
Similarly, we can simulate a 10% TWAP drop within a two-block attack:
While substantially cheaper, it is still extremely expensive given a massive risk of being arbed back.
A more interest attack vector would be the following:
- Crash the price of the WBTC/WETH TWAP by x%
- Deposit $1 million worth of USDC
- Borrow > $1 million worth of WBTC (real market value)
Essentially, x% is the manipulation necessary for the attacker to break even.
Like in the attack involving inflating the price of WBTC collateral, x% is contingent on the effective factor. As we lend USDC to borrow WBTC, we need the USDC collateral factor (0.90) and the proposed WBTC borrowed factor (0.91) to arrive at the effective factor of 0.819 (0.90 x 0.91). This means that normally, depositing $1 million USDC worth would allow us to borrow up to $819k WBTC worth.
Hence, by crashing the TWAP by -18.1% (1-0.819), the attacker may break even.
A one block attack would imply the following cost:
$12 trillion, which is clearly unfeasible.
A two-block attack would be somewhat cheaper:
Still extremely expensive.
To conclude, we give WBTC the highest oracle grading as attacks appear extremely costly on both upside and downside as one-block and two-block attacks.