[CurveLP-stETH-ETH] Collateral Onboarding Oracle Assessment (MIP10c3-SP43)

MIP10c3-SP43

Author(s): Niklas Kunkel (@NiklasKunkel)
Contributors: Kurt Barry (@Kurt_Barry)
Type: Process Component
Status: RFC
Date Proposed: 2020-11-26

Specification

Introduction

This oracle provides a price for the steCRV Curve pool (Lido staked ETH and ETH) LP token.

Oracle Data Model

A lower bound on the price of an LP is calculated by an on-chain smart contract based on the following inputs:

p_eth := price of ETH in USD (18 decimal precision)
p_steth := price of stETH in USD (18 decimal precision)
vp := virtual price of the steCRV pool (18 decimal precision)

The virtual price of the steCRV pool is defined by the return value of the pool’s get_virtual_price function. This represents liquidity per LP token when the pool is in equilibrium and is insensitive to manipulation via large swaps (for example via a flash loan) by construction.

The price return by the oracle is given by:

vp * min(p_eth, p_steth) / 10^18

where min takes the minimum of the two constituent tokens. Thus the computed price represents a lower bound on the value of an LP token.

Other MakerDAO oracles are used to obtain the ETH and stETH USD prices. Because Maker provides an oracle only for wrapped staked Ether (wstETH), an “oracle proxy contract” is used to convert the wstETH price into a stETH price using a conversion factor provided by the staked Ether contract itself. Specifically:

p_steth = p_wsteth * 10^18 / <stETH_contract>.getPooledEthByShares(10^18)

This oracle proxy contract utilizes the same authorization model as the underlying oracle, preventing prices from being inadverently revealed.

Oracle Supporting Data Model(s)

wstETH/USD (canonical)

|    Source    |  Asset Pair   |Quorum | Feed Model  | Oracle Model |
| :----------- | :------------ | :---: | :---------: | :----------: |
|   Balancer   |   stETH/ETH   |  13   |    Median   |    Median    |
|     Curve    |   stETH/ETH   |

ETH/USD (canonical)

|    Source     |  Asset Pair   |  Feed Model  |
| :------------ | :------------ | :----------: | 
|   Binance     |    ETH/USD    |    Median    |
|   Bitfinex    |    ETH/USDT   |              |
|   Bitstamp    |    ETH/USD    |              |
|   Coinbase    |    ETH/USD    |              |
|   Gemini      |    ETH/USD    |              |
|   Kraken      |    ETH/USD    |              |

USDT/USD (canonical)

|    Source     |  Asset Pair   |  Feed Model  |
| :------------ | :------------ | :----------: | 
|   Binance     |    BTC/USDT   |    Median    |
|   BitFinex    |    USDT/USD   |              |
|   FTX         |    ETH/USDT   |              |
|   Huobi       |    ETH/USDT   |              |
|   Kraken      |    USDT/USD   |              |
|   OKEx        |    BTC/USDT   |              |

Oracle Address

  • stETH price oracle proxy - Mainnet TBD
  • Oracle Security Module (OSM) - Mainnet TBD

Supported Tools

Remaining Work

  • Deploy stETH price oracle proxy contract
  • Deploy Curve oracle factory contract
  • Deploy steCRV oracle using factory
  • Update the MegaPoker to poke the steCRV oracle

Summary

This proposal defines an oracle for pricing ETH-stETH Curve pool LP tokens, a necessary step in onboarding this collateral.

A lower bound on the price can be computed on-chain utilizing the existing price feeds for wstETH and ETH. This calculation is not vulnerable to manipulation via flash loans because it makes use of get_virtual_price and off-chain feeds. This a standard method in wide use across DeFi for pricing Curve LP tokens.

The code for this oracle is based on the Uniswap V2 LP token oracle. Unit and simulation tests have been written, and further testing, review, and auditing is ongoing.

Safe and accurate pricing for steCRV LP tokens unlocks an additional source of DAI generation for users of the Maker protocol who may prefer the higher yield of the steCRV pool relative to simply depositing wstETH directly into a Vault for leverage.

4 Likes