Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yearn Finance integration deployment #16

Open
43 tasks
dimpar opened this issue Jul 26, 2021 · 4 comments
Open
43 tasks

Yearn Finance integration deployment #16

dimpar opened this issue Jul 26, 2021 · 4 comments
Labels
:shipit: deployment Deployments and CI workflows

Comments

@dimpar
Copy link
Contributor

dimpar commented Jul 26, 2021

Refs: #7

Team Members
Deployment Team TBD
Technical Wallet Team TBD
Community Multisig TBD
Communications TBD

Prerequisites

tBTC v2

  • tBTC v2 token deployed (0x..)

Curve pool

  • Curve pool for tBTC v2 token deployed. Follow curve-contract/contracts & see tBTCv1 as an example.
  • Experimental Yearn vault for tBTC v2 Curve pool LP Tokens deployed (crvTBTCv2 vault) (0x..)
    • determine our governance address (0x..). This address can be probably used as a guardian and rewards puller
    • name: Curve tBTCv2 Pool yVault
    • symbol: crvTBTCv2
    • releaseDelta: 0 for newest Vault's version
    • call newExperimentalVault()
  • Depositor contract for the tBTC v2 Curve pool (tbtcCurvePoolDepositor)
  • Gauge contract for the tBTC v2 Curve pool (tbtcCurvePoolGauge)
  • Additional reward token distributed by the gauge contract of the tBTC v2 Curve pool (tbtcCurvePoolGaugeReward optional)
  • ID of TBTC Convex Reward Pool must be set. ID of the Convex reward pool paired with the tBTC v2 Curve pool (tbtcConvexRewardPoolId)

Saddle pool

  • Saddle pool for tBTC v2 token deployed (0x..)
  • Experimental Yearn vault for tBTC v2 Saddle pool LP Tokens deployed (saddleTBTCv2 vault) (0x..)
    • determine our governance address (0x..). This address can be probably used as a guardian and rewards puller
    • name: Saddle tBTCv2 Pool yVault
    • symbol: saddleTBTCv2
    • releaseDelta: 0 for newest Vault's version
    • call newExperimentalVault()
  • tBTC v2 Saddle pool swap contract deployed (tbtcSaddlePoolSwap) (0x..)
  • tBTC v2 Saddle reward pool contract deployed (tbtcSaddleLPRewards) (0x..)
    • Call setGated(false). Otherwise only externally-owned accounts can call stake()on it.

Code

  • Update in the code all the addresses for new tBTC v2 token and newly deployed contracts. Verify that all the "TODOs" have been addressed.
  • All security audit issues addressed

Deploy smart contracts

All steps done by Deployment Team

  • Tag yearn/v1.0.0 in `keep-network/tbtc-v2
  • Sign yearn/v1.0.0 commit hash
  • Deploy CurveVoterProxyStrategy contract (address: 0x...) with the following parameters:
    • _vault: crvTBTCv2 vault address
    • _tbtcCurvePoolDepositor: tbtcCurvePoolDepositor address
    • _tbtcCurvePoolGauge: tbtcCurvePoolGauge address
    • _tbtcCurvePoolGaugeReward: tbtcCurvePoolGaugeReward address (optional, zero is valid value)
  • addStrategy(CurveVoterProxyStrategy) to the crvTBTCv2 vault.
  • Vault and strategy Health check
  • Deploy ConvexStrategy (address: 0x...) with the following parameters:
    • _vault: crvTBTCv2 vault address
    • _tbtcCurvePoolDepositor: tbtcCurvePoolDepositor address
    • _tbtcConvexRewardPoolId: tbtcConvexRewardPoolId id
  • addStrategy(ConvexStrategy) to the crvTBTCv2 vault.
  • Vault and strategy Health check
  • Deploy SaddleStrategy (address: 0x...) with the following parameters:
    • _vault: saddleTBTCv2 vault address
    • _tbtcSaddlePoolSwap: _tbtcSaddlePoolSwap address
    • _tbtcSaddleLPRewards: _tbtcSaddleLPRewards address
  • addStrategy(SaddleStrategy) to the saddleTBTCv2 vault.
  • Vault and strategy Health check

Etherscan verification

All steps done by Deployment Team

  • Verify CurveVoterProxyStrategy contract
  • Verify ConvexStrategy contract
  • Verify SaddleStrategy contract

Post-deploy actions

  • Acquire approval from Yearn governance to make Experimental vault a Real vault and their strategies for tBTC v2 Curve pool LP Tokens
  • Acquire approval from Yearn governance to make Experimental vault a Real vault and their strategies for tBTC v2 Saddle LP Tokens (saddleTBTCv2?)
  • Run our own keeper bot or adding our strategies to the Keep3r network.

Package publication

Done by Deployment Team

  • Publish v1.0.0 package of yearn integration to NPM

Release notes

Done by Deployment Team

  • Publish yearn/v1.0.0 release notes in keep-network/tbtc-v2
@dimpar dimpar added the :shipit: deployment Deployments and CI workflows label Jul 26, 2021
@lukasz-zimnoch
Copy link
Member

Some remarks:

  1. Regarding vault names, Yearn has a naming convention. For Curve vault, the name should be: Curve tBTCv2 Pool yVault and for Saddle vault: Saddle tBTCv2 Pool yVault.

  2. In section Deploy smart contracts:

    • Deploy CurveVoterProxyStrategy in _vault parameter we should pass the crvTBTCv2 vault address
    • Deploy ConvexStrategy in _vault parameter we should pass the crvTBTCv2 vault address
    • Deploy SaddleStrategy in _vault parameter we should pass the saddleTBTCv2 vault address
  3. At the end of Deploy smart contracts section we should add strategies to their vaults using addStrategy method.

  4. In Post-deploy actions section we should add a point about running our own keeper bot or adding our strategies to the Keep3r network.

@pdyraga
Copy link
Member

pdyraga commented Aug 2, 2021

I see Technical Wallet Team and Community Multisig are mentioned in the issue description but I am not sure what would be their responsibilities. From the task list I see:

  • determine our governance address (0x..). This address can be probably used as a guardian and rewards puller
  • determine our governance address (0x..). This address can be probably used as a guardian and rewards puller

What governance responsibilities should be covered?

@dimpar
Copy link
Contributor Author

dimpar commented Aug 2, 2021

I see Technical Wallet Team and Community Multisig are mentioned in the issue description but I am not sure what would be their responsibilities.

This table was copied from the Coverage Pool v1.0.0 deployment scenario and I assumed that's a standard process of how we deploy to mainnet and left TBD to determine actual addresses if we need it. I wasn't sure of the purpose of each wallet and was hoping you can shed some light on it.

What governance responsibilities should be covered?

Governance would be able to call functions defined in our strategy contracts:

But all contracts that are implemented by us inherit from the BaseStrategy.sol which is a part of Yearn project and is in their repo. There are multiple functions there that can be called by governance like setting a strategiest, setting a keeper, doing a health check etc.

@lukasz-zimnoch
Copy link
Member

I made a closer look at the governance addresses we need to use and here are the conclusions:

Vaults

According to that doc we need to deploy the vault using Yearn's Brownie script. Regarding addresses we should:

  • Use our Deployment/Technical Wallet for vault's governance while deploying. This is because we'll need to perform some direct actions on the vault at the beginning. Ultimately, we'll need to set governance to ychad.eth ENS as we plan to endorse the vault in the near future.
  • Use treasury.ychad.eth as the rewards address. Yearn docs don't explain why we need to point to that address specifically but I suppose it's about the management fee which is accounted by all official vaults.
  • Use dev.ychad.eth as guardian address. This one delegates emergency actions to the Yearn Core Dev team.
  • Use brain.ychad.eth as management address. It delegates management actions to the Yearn Strategist multisig.

The current tBTC v1 vault has the same roles assignment.

Strategies

In this case we can first deploy the strategies using our Deployment account. Once we are ready we can transfer roles to the following addresses (it doesn't have to be done immediately):

  • Use 0x736D7e3c5a6CB2CE3B764300140ABF476F6CFCCF as keeper address if we want take advantage of the Keep3r network.
  • Use health.ychad.eth as health check address
  • Probably use Community multisig as strategist address. It can manage strategy parameters (beside vault's governance) and set the rewards address which is able to pull performance fee (accounted as a percentage of strategy's profit) in form of vault's shares.
  • Regarding rewards address mentioned above, we need to determine which address should be able to pull the performance fee.

@pdyraga pdyraga modified the milestones: solidity/v1.1.0, typescript/v1.0.0 Apr 20, 2022
@pdyraga pdyraga removed this from the typescript/v1.0.0 milestone Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:shipit: deployment Deployments and CI workflows
Projects
None yet
Development

No branches or pull requests

6 participants