Skip to content

Latest commit

 

History

History
278 lines (260 loc) · 14.3 KB

YPP-0065.md

File metadata and controls

278 lines (260 loc) · 14.3 KB

Proposal

Configure series for contango december 2022 instruments

Background

Contango exchange uses fixed rate markets to synthesise expirable futures. In order to allow for a smoother interaction, Yield holds a separate copy of some key contracts (Ladle, Cauldron, & Witch) and so they need to be updated in a similar fashion as the "public" ones This proposal also deploys & configure new oracles that weren't present in the alpha release of Contango

Details

Here are the steps:

  1. Deploy PoolOracle (no need for governance approval)
  2. Deploy YieldSpaceMultiOracle (no need for governance approval)
  3. Deploy new Joins (no need for governance approval)
  4. Initialise PoolOracle (no need for governance approval)
  5. Governance proposal
    1. Configure YieldSpaceMultiOracle permissions
    2. Configure each new Join's permissions
    3. Add YieldSpaceMultiOracle oracle sources
    4. Add Composite oracle sources
    5. Add Composite oracle paths
    6. Add assets to the Contango cauldron
    7. Configure base assets on the Contango cauldron
    8. Add series to the Contango cauldron
    9. Create ilks on the Contango cauldron
    10. Enable ilks for the created series

Script that performed said actions: https://github.com/yieldprotocol/environments-v2/blob/ae8d75c12c11fc8ab093e0793f931f9ef5253755/scripts/governance/contango/shared/orchestrateNewInstruments.ts

Configuration applied:

// Assets that will be made into a base
export const bases: Array<[string, string]> = [
  [DAI, joins.get(DAI)!],
  [USDC, joins.get(USDC)!],
  [ETH, joins.get(ETH)!],
]

// Input data: baseId, quoteId, oracle name
export const compositeSources: Array<[string, string, string]> = [
  [FYDAI2212, DAI, protocol.get(YIELD_SPACE_MULTI_ORACLE)!],
  [FYUSDC2212, USDC, protocol.get(YIELD_SPACE_MULTI_ORACLE)!],
  [FYETH2212, ETH, protocol.get(YIELD_SPACE_MULTI_ORACLE)!],
]
// Input data: assetId, assetId, [intermediate assetId]
export const compositePaths: Array<[string, string, Array<string>]> = [
  [DAI, FYUSDC2212, [USDC]],
  [USDC, FYDAI2212, [DAI]],
  [DAI, FYETH2212, [ETH]],
  [USDC, FYETH2212, [ETH]],
  [ETH, FYDAI2212, [DAI]],
  [ETH, FYUSDC2212, [USDC]],
]

/// @notice Assets that will be added to the protocol
/// @param Asset identifier (bytes6 tag)
/// @param Address for the asset
/// @param Address for the join
export const assetsToAdd: Array<[string, string, string]> = [
  [FYDAI2212, fyTokens.get(FYDAI2212)!, newJoins.get(FYDAI2212)!],
  [FYUSDC2212, fyTokens.get(FYUSDC2212)!, newJoins.get(FYUSDC2212)!],
  [FYETH2212, fyTokens.get(FYETH2212)!, newJoins.get(FYETH2212)!],
]

// Input data: baseId, ilkId, ratio (1000000 == 100%), line, dust, dec
/// @notice Collateralisation parameters and debt limits for each new asset pair
/// @param Base asset identifier (bytes6 tag)
/// @param Collateral asset identifier (bytes6 tag)
/// @param Collateralisation ratio, with six decimals
/// @param Maximum protocol debt, decimals to be added
/// @param Minimum vault debt, decimals to be added
/// @param Decimals to add to maximum protocol debt, and minimum vault debt.
export const fyTokenDebtLimits: Array<[string, string, number, number, number, number]> = [
  [DAI, FYUSDC2212, 1100000, 10000, 40, 18], // dai collateralized with fyUsdc
  [DAI, FYETH2212, 1400000, 10000, 40, 18], // dai collateralized with fyEth
  [USDC, FYDAI2212, 1100000, 10000, 40, 6], // usdc collateralized with fyDai
  [USDC, FYETH2212, 1400000, 10000, 40, 6], // usdc collateralized with fyETH
  [ETH, FYUSDC2212, 1400000, 10000000, 25000, 12], // eth collateralized with fyUsdc
  [ETH, FYDAI2212, 1400000, 10000000, 25000, 12], // eth collateralized with fyDai
]

export const auctionLineAndLimits: AuctionLineAndLimit[] = [
  // ETH
  {
    baseId: ETH,
    ilkId: FYUSDC2212,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: ETH,
    ilkId: FYDAI2212,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('1000000'),
  },
  // USDC
  {
    baseId: USDC,
    ilkId: FYETH2212,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: USDC,
    ilkId: FYDAI2212,
    duration: 600,
    vaultProportion: parseUnits('1'),
    collateralProportion: parseUnits('0.9545454545'), // 105 / 110
    max: parseUnits('1000000'),
  },
  // DAI
  {
    baseId: DAI,
    ilkId: FYETH2212,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: DAI,
    ilkId: FYUSDC2212,
    duration: 600,
    vaultProportion: parseUnits('1'),
    collateralProportion: parseUnits('0.9545454545'), // 105 / 110
    max: parseUnits('1000000'),
  },
]

// Input data: seriesId, [ilkIds]
/// @notice New asset pairs to be accepted
/// @param Base asset identifier (bytes6 tag)
/// @param Array of collateral asset identifiers (bytes6 tag array)
export const seriesIlks: Array<[string, string[]]> = [
  [FYDAI2212, [FYUSDC2212, FYETH2212]],
  [FYUSDC2212, [FYDAI2212, FYETH2212]],
  [FYETH2212, [FYUSDC2212, FYDAI2212]],
]

The contracts have been deployed to Arbitrum mainnet and the proposal sent to the multisig.

Testing

The proposal approval & execution were tested on tenderly: https://dashboard.tenderly.co/Yield/contango/fork/c3fe7111-cdf1-453d-9475-d11ade39904b

Proposal log

➜  environments-v2 git:(main) ✗ sh scripts/governance/contango/arbitrum/dec22roll/roll.sh
++ dirname scripts/governance/contango/arbitrum/dec22roll/roll.sh
+ HERE=scripts/governance/contango/arbitrum/dec22roll
+ export CONF=/Users/bbonanno/Developer/projects/yield/environments-v2/scripts/governance/contango/arbitrum/dec22roll/contango.arb_mainnet.dec22.config
+ CONF=/Users/bbonanno/Developer/projects/yield/environments-v2/scripts/governance/contango/arbitrum/dec22roll/contango.arb_mainnet.dec22.config
+ RUN='npx hardhat run --network arb_mainnet'
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/dec22roll/../../../deploy/deployPoolOracle.ts
PoolOracle deployed at 0x210F4e1942bEEc4038743A8f885B870E0c27b414
npx hardhat verify --network arb_mainnet 0x210F4e1942bEEc4038743A8f885B870E0c27b414 86400 24 300 
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/dec22roll/../../../deploy/deployYieldSpaceMultiOracle.ts
YieldSpaceMultiOracle deployed at 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
npx hardhat verify --network arb_mainnet 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2 0x210F4e1942bEEc4038743A8f885B870E0c27b414 
yieldSpaceMultiOracle.grantRoles(ROOT, timelock)
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/dec22roll/../../../deploy/deployJoins.ts
Join deployed at 0x53A35a547549875Cd8ddC498c3f2bd866c392900 for 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2
npx hardhat verify --network arb_mainnet 0x53A35a547549875Cd8ddC498c3f2bd866c392900 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2 
join.grantRoles(ROOT, timelock)
Join deployed at 0xc603b59514315D0Ab0DF9931D4237171e307e005 for 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449
npx hardhat verify --network arb_mainnet 0xc603b59514315D0Ab0DF9931D4237171e307e005 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449 
join.grantRoles(ROOT, timelock)
Join deployed at 0x4c05E3A558d91840b14c893c41B807e9AfAD23Ff for 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464
npx hardhat verify --network arb_mainnet 0x4c05E3A558d91840b14c893c41B807e9AfAD23Ff 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464 
join.grantRoles(ROOT, timelock)
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/dec22roll/../../../../fragments/witchV2/initialisePoolOracle.ts
Initialised PoolOracle for pool: 0208-0x81Ae3D05e4F0d0DD29d6840424a0b761A7fdB51c
Initialised PoolOracle for pool: 0108-0x25e46aD1cC867c5253a179F45e1aB46144c8aBc0
Initialised PoolOracle for pool: 0008-0x7F0dD461D77F84cDd3ceD46F9D550e35F1969a24
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/dec22roll/../../shared/orchestrateNewInstruments.ts
yieldSpaceMultiOracle.grantRoles(gov, timelock)
yieldSpaceMultiOracle.grantRole(ROOT, cloak)
yieldSpaceMultiOracle.revokeRole(ROOT, deployer)
join.revokeRole(ROOT, deployer)
join.grantRole(ROOT, cloak)
cloak.plan(ladle, join(0108)): 0xd9f0dc066694173915391cf4665d2ae8b5e1abd66081e511d9ab60b646fde6b0
join.revokeRole(ROOT, deployer)
join.grantRole(ROOT, cloak)
cloak.plan(ladle, join(0208)): 0x1838c144a10dc3bff0364a6fc5945c5cd9d8b2d4f954ebaf1e0cd7f7e20187f7
join.revokeRole(ROOT, deployer)
join.grantRole(ROOT, cloak)
cloak.plan(ladle, join(0008)): 0x8e2a4acfe1216d8dcf240c5536477b46896c94ea82c113527b9f57a993ad41af
Adding 0x303130380000/0x303100000000 from 0x210F4e1942bEEc4038743A8f885B870E0c27b414
pair: 0108/01 -> 0x25e46aD1cC867c5253a179F45e1aB46144c8aBc0
Adding 0x303230380000/0x303200000000 from 0x210F4e1942bEEc4038743A8f885B870E0c27b414
pair: 0208/02 -> 0x81Ae3D05e4F0d0DD29d6840424a0b761A7fdB51c
Adding 0x303030380000/0x303000000000 from 0x210F4e1942bEEc4038743A8f885B870E0c27b414
pair: 0008/00 -> 0x7F0dD461D77F84cDd3ceD46F9D550e35F1969a24
Adding 0x303130380000/0x303100000000 from 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
pair: 0108/01 -> 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
Adding 0x303230380000/0x303200000000 from 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
pair: 0208/02 -> 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
Adding 0x303030380000/0x303000000000 from 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
pair: 0008/00 -> 0xb958bA862D70C0a4bD0ea976f9a1907686dd41e2
[path: 01/0208 -> 0x303200000000],
[path: 02/0108 -> 0x303100000000],
[path: 01/0008 -> 0x303000000000],
[path: 02/0008 -> 0x303000000000],
[path: 00/0108 -> 0x303100000000],
[path: 00/0208 -> 0x303200000000],
Using FYDAI2212 at 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2
0x53A35a547549875Cd8ddC498c3f2bd866c392900
Adding asset 0x303130380000 at 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2 with join 0x53A35a547549875Cd8ddC498c3f2bd866c392900
Using FYUSDC2212 at 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449
0xc603b59514315D0Ab0DF9931D4237171e307e005
Adding asset 0x303230380000 at 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449 with join 0xc603b59514315D0Ab0DF9931D4237171e307e005
Using FYETH2212 at 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464
0x4c05E3A558d91840b14c893c41B807e9AfAD23Ff
Adding asset 0x303030380000 at 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464 with join 0x4c05E3A558d91840b14c893c41B807e9AfAD23Ff
Asset 01 made into base using 0x0ad9Ef93673B6081c0c3b753CcaaBDdd8d2e7848
Asset 02 made into base using 0x0ad9Ef93673B6081c0c3b753CcaaBDdd8d2e7848
Asset 00 made into base using 0x0ad9Ef93673B6081c0c3b753CcaaBDdd8d2e7848
Using fyToken at 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2 for 0x303130380000
Using pool at 0x25e46aD1cC867c5253a179F45e1aB46144c8aBc0 for 0x303130380000
Adding 0x303130380000 for 0x303100000000 using 0xe8Ec1A61f6C86e8d33C327FEdad559c20b9A66a2
Adding 0x303130380000 pool to Ladle using 0x25e46aD1cC867c5253a179F45e1aB46144c8aBc0
fyToken.grantRoles(mint/burn, ladle)
cloak.plan(ladle, fyToken(0108)): 0x9c3dbdf5ade5b30b910be88143a57e7326f43a4dee5d58cb7e6bc3db3cbcf9f8
cloak.plan(witch, burn(0108)): 0xf34153dfa5c5d63414ea9d1cc4d570fb9c87e3b41fbef765bbf9539a605db539
Using fyToken at 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449 for 0x303230380000
Using pool at 0x81Ae3D05e4F0d0DD29d6840424a0b761A7fdB51c for 0x303230380000
Adding 0x303230380000 for 0x303200000000 using 0xD4aeA765BC2c56f09074254eb5a3f5FF9d709449
Adding 0x303230380000 pool to Ladle using 0x81Ae3D05e4F0d0DD29d6840424a0b761A7fdB51c
fyToken.grantRoles(mint/burn, ladle)
cloak.plan(ladle, fyToken(0208)): 0x26a043fcd53a61f421d24cad98dc45d44e27c290ea7e10d0733afe42bf5a69fd
cloak.plan(witch, burn(0208)): 0xce9b3702bc79352d59f9bfda443d2789047b147f1552e57ebc33494fd1c77f5c
Using fyToken at 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464 for 0x303030380000
Using pool at 0x7F0dD461D77F84cDd3ceD46F9D550e35F1969a24 for 0x303030380000
Adding 0x303030380000 for 0x303000000000 using 0x5655A973A49e1F9c1408bb9A617Fd0DBD0352464
Adding 0x303030380000 pool to Ladle using 0x7F0dD461D77F84cDd3ceD46F9D550e35F1969a24
fyToken.grantRoles(mint/burn, ladle)
cloak.plan(ladle, fyToken(0008)): 0xe1e7b8a374c382826d68f43f10dd24fdb447389542c21df1ef39628499e698f0
cloak.plan(witch, burn(0008)): 0xa54aeaa5e76f7bf7fceb390a50d8bba9e36435284aaa4a15c35222eb3678ae06
Witch#setLineAndLimit(0208, 00, 600, 500000000000000000, 750000000000000000, 500000000000000000000)
Witch#setLineAndLimit(0108, 00, 600, 500000000000000000, 750000000000000000, 1000000000000000000000000)
Witch#setLineAndLimit(0008, 02, 600, 500000000000000000, 750000000000000000, 500000000000000000000)
Witch#setLineAndLimit(0108, 02, 600, 1000000000000000000, 954545454500000000, 1000000000000000000000000)
Witch#setLineAndLimit(0008, 01, 600, 500000000000000000, 750000000000000000, 500000000000000000000)
Witch#setLineAndLimit(0208, 01, 600, 1000000000000000000, 954545454500000000, 1000000000000000000000000)
Allowing witch to exit join: 0xc603b59514315D0Ab0DF9931D4237171e307e005
cloak.plan(witch, exit(0208)): 0x1857ec2a67acc708531cd0b9f445699dc0261975da9069186fb5f7473745859d
Allowing witch to exit join: 0x53A35a547549875Cd8ddC498c3f2bd866c392900
cloak.plan(witch, exit(0108)): 0xf1bd611aab5ef052ae18004327cbb628dd0e640218d962135a0d633f69279b15
Allowing witch to exit join: 0x4c05E3A558d91840b14c893c41B807e9AfAD23Ff
cloak.plan(witch, exit(0008)): 0xf4e49d3c18de262e0e593d0305862bec11ca48d884933bffcbf7c5037d71e6b2
Adding for 01/0208 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Adding for 01/0008 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Adding for 02/0108 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Adding for 02/0008 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Adding for 00/0208 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Adding for 00/0108 from 0x750B3a18115fe090Bc621F9E4B90bd442bcd02F2
Updating 0x303130380000 series with 0x303230380000,0x303030380000 ilks
addIlks 0108: 0x303230380000,0x303030380000
Updating 0x303230380000 series with 0x303130380000,0x303030380000 ilks
addIlks 0208: 0x303130380000,0x303030380000
Updating 0x303030380000 series with 0x303230380000,0x303130380000 ilks
addIlks 0008: 0x303230380000,0x303130380000
Proposal: 0x11203c228b6614e9bedd0d87233bcc28f6657aa7c7cd53c7679d0df156f791de
Proposing
Developer: 0x05950b4e68f103d5aBEf20364dE219a247e59C23
Proposed 0x11203c228b6614e9bedd0d87233bcc28f6657aa7c7cd53c7679d0df156f791de