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

Chore: create d3m checklist #41

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

SidestreamStrongStrawberry
Copy link
Contributor

This PR adds D3M onboarding checklist.

Superset of all D3M onboarding action list
  1. Define required contracts
    • Contracts on Chainlog: D3M_HUB, D3M_MOM
    • Contracts needs to be pre-deployed: D3M_PLAN, D3M_POOL , D3M_ORACLE, operator(optional)
  2. Add dss-direct-deposit/D3MCoreInstance, dss-direct-deposit/D3MInit, dss-direct-deposit/D3MInstance in dependencies dir (from here)
    • D3MInit init functions do value sanity check, setting params value, updating chainlog address
  3. Create DssInstance (code)
  4. Create D3MInstance (code)
    • plan: plan contract address
    • pool: pool contract address
    • oracle: oracle contract address
  5. Create D3MCommonConfig (code)
    • hub: D3M hub contract address (from chainlog)
    • mom: D3M mom contract address (from chainlog)
    • ilk: ilk name
    • existingIlk: bool value, if ilk exists already or not
    • maxLine: Debt ceiling (auto line value)
    • gap: Max Value between current debt and line to be set (auto line value)
    • ttl: Min time to pass before a new increase (auto line value)
    • tau: Time until you can write off the debt [sec]
  6. Initialise protocol specific configs
    1. Aave
      1. Create D3MAavePoolConfig (code)
      2. Create D3MAaveBufferPlanConfig (code)
    2. Compound
      1. Create D3MCompoundPoolConfig (code in archive, d3m repository)
        • king: address who will get rewards
        • cdai: cdai token address
        • [comptroller](https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol): comptroller address
        • comp: address of the COMP token
      2. Create D3MCompoundRateTargetPlanConfig (code in archive, d3m repository)
        • barb: target Interest Rate Per Block [wad]
        • cdai: cdai token address
        • tack: supported rate models
        • delegate: cDai supported implementations
    3. Morpho
      1. Create D3M4626PoolConfig (code)
        • vault: ERC4626 standard vault address
      2. Create D3MOperatorPlanConfig (code)
        • operator: D3M Operator Plan address
  7. Execute D3MInit.initCommon (code), in d3m repository)
    • params: dss: DssInstance, d3m: D3MInstance, cfg: D3MCommonConfig
    • actions
      • Sanity check
        • oracle.vat address matches to dss.vat (code))
        • oracle.ilk name matches to ilk name (code)
      • Authorization
        • plan contract relies on mom contract (code)
      • Set params
        • set ilk.pool address in hub contract (code)
        • set ilk.plan address in hub contract (code)
        • set ilk.tau value in hub contract (code)
        • set hub address in oracle contract (code)
        • set ilk.pip(price feed) in spotter (code)
        • set ilk.mat(liquidation ratio) in spotter (code)
        • IF ilk is newly added, add ilk in vat (code)
        • IF ilk is newly added, add ilk in jug (code)
        • update ilk.line in vat (code)
        • update global line (code)
        • enable auto-line for ilk (code)
        • add ilk to ILK_REGISTRY (code)
        • Add pool, plan, oracle contract to chainlog with prefix (code)
  8. Execute protocol specific init functions
    1. Aave
      1. D3MInit.initAavePool ([code](https://github.com/makerdao/spells-mainnet/blob/9633f7e86c3083e1900da9d50ae60f365cac3038/archive/2023-04-28-DssSpell/DssSpell.sol#L97-L102, in [=d3m repository)
        • params: dss: DssInstance, d3m: D3MInstance, cfg: D3MCommonConfig, aaveCfg: D3MAavePoolConfig
        • actions
          • Sanity checks
            • pool.hub address matches DIRECT_HUB address on chainlog
            • pool.ilk name matched ilk
            • pool.vat address matches MCD_VAT address on chainlog
            • pool.dai address matches MCD_DAI address on chainlog
            • pool.adai address matches adai address
            • pool.stableDebt address matches stableDebt address
            • pool.variableDebt address matches variableDebt address
          • Set params
            • set pool.king value
      2. D3MInit.initAaveUSDSPool (in d3m repository)
        • params: dss: DssInstance, d3m: D3MInstance, cfg: D3MCommonConfig, aaveCfg: D3MAavePoolConfig
        • actions
          • Sanity checks
            • pool.hub address matches hub address (code)
            • pool.ilk name matched ilk (code)
            • pool.vat address matches vat address (code)
            • pool.usdsJoin address matches usdsJoin (code)
            • pool.usds address matches usds (code)
            • pool.daiJoin address matches daiJoin (code)
            • pool.dai address matches dai address (code)
            • pool.ausds address matches ausds address (code)
            • pool.stableDebt address matches stableDebt address (code)
            • pool.variableDebt address matches variableDebt address (code)
          • Set params
            • set pool.king value (code)
      3. D3MInit.initAaveBufferPlan (code), in d3m repository)
        • params: cfg: D3MCommonConfig, aaveCfg: D3MAaveBufferPlanConfig
        • actions
          • Sanity check
            • plan.adai matches adai (code)
          • Set params
            • set plan.buffer (code)
    2. Compound
      1. D3MInit.initCompoundPool (code in d3m repository)
        • params: dss: DssInstance, d3m: D3MInstance, cfg: D3MCommonConfig, compoundCfg: D3MCompoundPoolConfig
        • actions
          • Sanity checks
            • pool.hub address matches hub address (code)
            • pool.ilk name matched ilk (code)
            • pool.vat address matches vat address (code)
            • pool.dai address matches dai address (code)
            • pool.comptroller address matches comptroller address (code)
            • pool.comp() address matches comp address (code)
            • pool.cDai address matches cDai address (code)
          • Set Params
            • set pool.king (code)
      2. D3mInit.initCompoundRateTargetPlan(code in d3m repository)
        • params: d3m: D3MInstance, compoundCfg: D3MCompoundRateTargetPlanConfig
        • actions
          • Sanity check
            • plan.tacks(tack) returns 1 (code)
            • cdai.interestRateModel matches tack (code)
            • plan.delegates(delegate) returns 1 (code)
            • cdai.implementation matches delegate (code)
            • plan.cDai matches cDai address (code)
          • Set Params
            • set plan.barb (code)
    3. Morpho
      1. D3MInit.init4626Pool (code), in d3m repository)
        • params: dss: DssInstance, d3m: D3MInstance, cfg: D3MCommonConfig, erc4626Cfg: D3M4626PoolConfig
        • actions
          • Sanity checks
            • pool.hub address matches hub address (code)
            • pool.ilk name matched ilk (code)
            • pool.vat address matches vat address (code)
            • pool.dai address matches dai address (code)
            • pool.vault address matches given vault address (code)
      2. D3MInit.initOperatorPlan (code, in d3m repository)
        • params: d3m: D3MInstance, operatorCfg: D3MOperatorPlanConfig
        • This was only found in morpho before but it will be used for next AaveV3USDS D3M (source)
        • actions
          • set plan.operator address to given operator address
  9. Bump the chainlog (code) - in init functions, contract addresses were added to chainlog

Copy link
Contributor

@amusingaxl amusingaxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: 1 fix and several grammar/phrasing nits.

spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
Copy link
Contributor

@amusingaxl amusingaxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some redundant checks that might potentially be removed.

spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
spell/d3m-checklist.md Outdated Show resolved Hide resolved
Copy link
Contributor

@amusingaxl amusingaxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants