Skip to content

Latest commit

 

History

History
83 lines (70 loc) · 3.36 KB

YPP-0015.md

File metadata and controls

83 lines (70 loc) · 3.36 KB

Proposal

Enable UNI as a collateral for DAI and USDC

Background

UNI has a $9,697M market cap and 287K holders.

To enable UNI as a collateral we will be using the UNI/ETH chainlink price feed as a source of price data.

Details

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

export const assets: Map<number, Map<string, string>> = new Map([
  [1, new Map([
    [ETH,    '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'],
    [DAI,    '0x6B175474E89094C44Da98b954EedeAC495271d0F'],
    [USDC,   '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'],
    [UNI,    '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984'],
  ])],
])
  

export const chainlinkSources: Map<number, Array<[string, string, string, string, string]>> = new Map([
  [1, [
    [UNI,   (assets.get(1) as Map<string, string>).get(UNI)   as string, ETH, (assets.get(1) as Map<string, string>).get(ETH) as string, '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e'],
  ]],
])

// Assets for which we will have a Join
export const assetToAdd: Map<number, [string, string]> = new Map([
  [1,  [UNI, (assets.get(1) as Map<string, string>).get(UNI) as string]],
])

// Input data: baseId, ilkId, oracle name, ratio (1000000 == 100%), inv(ratio), line, dust, dec
export const limits: Array<[string, string, string, number, number, number, number, number]> = [
  [DAI, UNI, CHAINLINK, 1670000, 600000, 1000000, 5000, 18],
  [USDC, UNI, CHAINLINK, 1670000, 600000, 1000000, 5000, 6],
]

// Input data: seriesId, [ilkId]
export const seriesIlks: Array<[string, string[]]> = [
  [FYDAI2112,  [UNI]],
  [FYDAI2203,  [UNI]],
  [FYUSDC2112, [UNI]],
  [FYUSDC2203, [UNI]],
]
  1. Deploy a Join for UNI using the Wand
  2. Orchestrate and configure oracles
  3. Permission the UNIJoin
  4. Make UNI into an Ilk
  5. Approve UNI as collateral for all series
# Testing
The change has been tested on a mainnet fork by posting UNI to all series, borrowing, repaying and wthdrawing. [Script](https://github.com/yieldprotocol/environments-v2/tree/feat/add-chainlink-collateral/scripts/governance/addChainlinkCollateral/addChainlinkCollateral.test.ts).

alberto@alberto-laptop:~/Code/Yield/environments-v2$ npx hardhat run --network localhost scripts/governance/addChainlinkCollateral/addChainlinkCollateral.test.ts Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts! ChainId: 1 Running on a fork, impersonating 0xC7aE076086623ecEA2450e364C838916a043F9a8 24679867136918000000000000 UNI available series: 0x303130340000 vault: 0x1d25679657c550a823332384 posted and borrowed repaid and withdrawn series: 0x303130350000 vault: 0x9f888385ed574463c9e909e5 posted and borrowed repaid and withdrawn series: 0x303230340000 vault: 0x6b5f6b084071e62665bc8352 posted and borrowed repaid and withdrawn series: 0x303230350000 vault: 0xfde5d42a23ef18623d39c152 posted and borrowed repaid and withdrawn