Skip to content

Latest commit

 

History

History
66 lines (54 loc) · 3.39 KB

YPP-0024.md

File metadata and controls

66 lines (54 loc) · 3.39 KB

Proposal

Enable Yearn USDC Vaults (yvUSDC) as a collateral for USDC loans

Background

The vault token yvUSDC (api 0.4.3) has over $154m USD market cap and total value locked in all Yearn vaults is over $3.8 billion. Adding yvUSDC would allow us to gauge customer interest and inform our decision on adding other Yearn vault types. Furthermore, the yvUSDC price is based on USDC and we are initially only allow borrowing against it in USDC, so that makes it a lower risk and an acceptable entry point into Yearn vault collateral.

To enable yvUSDC as a collateral we will be using the pricePerShare function on the yvUSDC token contract. This function calculates the current share value in real time as: total vault assets / total token supply.

Details

The addYVUSDC-1.ts, addYVUSDC-2.ts and addYVUSDC-3.ts scripts will be used, with this input:

export const assets: Map<string, string> = new Map([
  [USDC,   '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'],
  [YVUSDC, '0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE'],
])

// underlying, yvToken, address
export const yearnSources: Array<[string, string, string]> = [
  [USDC, YVUSDC,  assets.get(YVUSDC) as string]
]

// Assets for which we will have a Join
export const assetsToAdd: Array<[string, string]> = [
  [YVUSDC, assets.get(YVUSDC) as string],
]

// Input data: baseId, ilkId, oracle name, ratio (1000000 == 100%), inv(ratio), line, dust, dec
export const yearnLimits: Array<[string, string, string, number, number, number, number, number]> = [
  [USDC, YVUSDC, YEARN, 1400000, 714000, 500000,  5000,    6],
]

// Input data: seriesId, [ilkIds]
export const seriesIlks: Array<[string, string[]]> = [
  [FYUSDC2112, [YVUSDC]],
  [FYUSDC2203, [YVUSDC]],
]

Steps:

  1. Deploy YearnOracle and give ROOT access to the Timelock.
  2. Configure the permissions for the Yearn Oracle
  3. Add the USDC/YVUSDC yvToken as the USDC/YVUSDC source in the Yearn Oracle
  4. Add YVUSDC as an asset to the Yield Protocol using the Wand
  5. Permission the YVUSDCJoin
  6. Make YVUSDC into an ilk
  7. Approve YVUSDC as collateral for USDC series

Testing

The change has been tested on a mainnet fork by posting yvUSDC to all series, borrowing, repaying and withdrawing. Here are the results of the tests:

$ npx hardhat run --network localhost scripts/governance/addYearnCollateral/yvUSDC/addYVUSDC.test.ts
No need to generate any newer typings.
ChainId: 1
1002007137043 YVUSDC available
series: 0x303230340000
vault: 0xfc9e74c26b167d7826d9c2a8
posted and borrowed
repaid and withdrawn
series: 0x303230350000
vault: 0xea90d3561c60bf79271a0eac
posted and borrowed
repaid and withdrawn