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

Aave and Compound support for recipe + Testing out Balancer support #2

Open
1 of 3 tasks
MickdeGraaf opened this issue Nov 2, 2020 · 1 comment
Open
1 of 3 tasks

Comments

@MickdeGraaf
Copy link
Member

MickdeGraaf commented Nov 2, 2020

User Story

  • As an <audience/user>: User
  • I want to <action/task>: Mint Pies with yield bearing tokens in them directly from ETH in a single transaction
  • so that <outcome/goal/benefit>: Can enjoy my Pie without having to source the underlying assets myself

Type

  • Enhancement
  • Maintenance
  • Refactor

Description

The current recipe only supports buying assets from Uniswap and Balancer. Interest bearing tokens are listed on those protocols but they will cost more compared to just buying the underlying and wrapping it.

Solution

When buying one of the underlying of the pie the recipe needs to execute the following logic when swapping WETH to a Token

  • Check if token is lending token in Aave or Compound
  • If not swap regularly
  • If it is calculate the amount of underlying needed to buy to mint the a/cToken and buy it and wrap it

Additionally there need to be setters to map lending tokens to their underlying and protocol.

Definition of Done

New recipe is able to mint a/cTokens without any changes compared to the current interface.

Minting pies and calcToPie() work as expected.

New recipe should inherit from:

https://github.com/pie-dao/pie-oven/blob/recipe/contracts/recipes/recipes/UniswapV2BalRecipe.sol

@Evert0x
Copy link
Collaborator

Evert0x commented Nov 2, 2020

Thanks, please let me know if this suffices.

https://github.com/pie-dao/pie-oven/blob/recipe/contracts/recipes/recipes/InterestingRecipe.sol

I don't see any tests for the recipes. Is that right?

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

No branches or pull requests

2 participants