Git Product home page Git Product logo

yield-booster's Introduction

Contributors Forks Stargazers Issues Discord


Logo

Alluo - Yield booster

A yield booster set of smart contracts allowing users to increase the amount of yield by cycling LP tokens brrrrr

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

This repo contains all the Alluo Yield Booster product, a series of smart contract allowing users of the Alluo protocol to boost LP reward yield by combining Curve and Convex power.

(back to top)

Built With

Here are the major framework / languages used to build the Protocol.

hardhat

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
npx hardhat help
npx hardhat coverage
npx hardhat run scripts/deploy.ts
TS_NODE_FILES=true npx ts-node scripts/deploy.ts
npx eslint '**/*.{js,ts}'
npx eslint '**/*.{js,ts}' --fix
npx prettier '**/*.{json,sol,md}' --check
npx prettier '**/*.{json,sol,md}' --write
npx solhint 'contracts/**/*.sol'
npx solhint 'contracts/**/*.sol' --fix

Etherscan verification

To try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Rinkeby.

In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Rinkeby node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:

hardhat run --network rinkeby scripts/sample-script.ts

Then, copy the deployment address and paste it in to replace DEPLOYED_CONTRACT_ADDRESS in this command:

npx hardhat verify --network rinkeby DEPLOYED_CONTRACT_ADDRESS "Hello, Hardhat!"

Performance optimizations

For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable TS_NODE_TRANSPILE_ONLY to 1 in hardhat's environment. For more details see the documentation.

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm

    npm install
    cp .env.example .env
    nano .env
  • yarn

    yarn install
    cp .env.example .env
    nano .env

Testing

npx hardhat clean
npx hardhat test

(back to top)

Roadmap

See our public roadmap here: Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source and DeFi communities such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Bug bounties

If you notice any vulnerabilities, bugs, or even efficiency improvements please checkout our Bug Bounty program on Gitcoin

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

0xtuytuy.eth - @0xtuytuy - [email protected]

Project Link: https://github.com/GetAlluo/yield-booster

(back to top)

yield-booster's People

Contributors

aliyadav avatar pentatonictritones avatar alexanderem49 avatar dependabot[bot] avatar 0xtuytuy avatar jorge-lopes avatar juuroudojo avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

jorge-lopes

yield-booster's Issues

Add pools CRV/yCRV and Dola/FRAXBP to the yield boost options

Is your feature request related to a problem? Please describe.
Add options to the yield boost pools, this is a more classic pools like the ones we have already implemented

Describe the solution you'd like
We need to test, deploy and add options for the 2 following convex vaults:

  1. image
  2. image

Here are the contract addresses:

  1. Reward contract: 0xe94b4cC50aC9ebeC491c3665C3E5a017a87dCF19
  2. Reward contract:0x0404d05F3992347d2f0dC3a97bdd147D77C85c1c

Describe alternatives you've considered
NA

Additional context
NA

Build FRAX/USDC EIP-4626 vault

Is your feature request related to a problem? Please describe.
No problem, the goal is to increase TVL in the protocol and the number of CVX rewards $ALLUO lockers earns.

This is related to the white paper here: https://www.notion.so/alluo/Yield-booster-933737d27e1f4808b425081f3ecbd60c

Describe the solution you'd like
This task is to build the first part of the Yield Booster product, the vault. The vault should take in base assets, create the LP on Curve, and issue the AlluoBoostedXXX token to the user.

We would like to use the ERC-4626 standard (described here by open Zepplin: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC4626) and implement the UX improvements that come with EIP-2612 as well.

This issue includes:

  • create the template vault to create more AlluoBoostedXXX tokens
  • implement the AlluoBoostedFraxUsdc
  • implement the wrapper that will convert the USDC and FRAX into LP and then deposit them into the AbFraxUsdc vault

The AlluoBoostedFraxUsdc should be able to take in USDC or FRAX tokens and invests them in the Frax/Usdc pool on the Curve (https://curve.fi/fraxusdc) then move the LP token to the booster pool (issue to be created)

The AbFraxUsdc vault should implement all the standard functions described in the ERC:

The vault should then be complemented by a wrapper contract which will actually be used by the Alluo webapp and mobile app to interact with this boosted pool. This contract should implement the following functions:

  • getBalances(address, address = 0x) -> this should return the underlying balance of the tokens addresses passed. So in the Frax / USDC case, you would be able to query the view function with both USDC and FRAX addresses and it would give back the amount of USDC or FRAX you are able to claim back from the vault if you are to unwind your LP
  • getRewardsBalance() -> this function would return the balance in reward from the boost pool for the Frax/Usdc case if it is attached to the boost pool Cvx/ETH it would return how much ETH and how much CVX a share of the vault is entitled to.

Describe alternatives you've considered
this is the only standard out there for now, so better than building our own stuff!

Additional context
This task is linked to the booster pool which will be described the next task.

Enable claimAll() across multiple vaults with gas optimisation

Is your feature request related to a problem? Please describe.

Today, claiming of rewards across multiple vaults is extremely expensive and a wasteful duplication of gas. This is because on each transaction, we are unwrapping and withdrawing from curve, multiple times.

Describe the solution you'd like

We should additionally add an option to claim rewards across all the vaults in one go.

Proposed architecture

Create a delegate claiming contract where the users can call claimAll().

This should (across all the vaults) update the rewards mapping for the user to 0 (add new function in the vault contract).

Then, we should add a new function in the pool contract that correctly deducts the each vault's shares of the booster pool.

Finally, we should withdrawAndUnwrap the correct total amount of cvxETH lps back to the user.

For example:

User has CVX-ETH rewards in two different vaults - 50 CVXETH and 80 CVX-ETH.

  1. User calls claimAll().
  2. delegateClaim contract updates both vaults' rewards mapping to 0.

User's rewards balance is now 0, 0.

  1. delegateClaim contract correctly deducts each vault's share of the booster pool (check how it is done today in the claiming function called withdraw()).

  2. delegateClaim contract withdrawsaAndUnwraps 50+80 = 130 CVX-ETH lps from the booster pool directly.

There are different ways of doing it but this is one solution

Beefy Omnivault / Beefy Vault Optimizer (same chain)

Is your feature request related to a problem? Please describe.
We want to create a vault contract that accepts token deposits, and then invests those into the top X yielding beefy vaults that week on the same chain (crosschain will come later).

Every week (or time period we decide on), through an offchain script, we wil nominate and change the underlying X number of beefy vaults to maximise the yield. This will be a separate ticket for automation.

Describe the solution you'd like
Create a vault contract that has the following characteristics:

  1. Accepts token deposits and withdrawals so that we can change tokens into a moo token and vice versa.

  2. Upon a token deposit, split the deposit up into whatever proportion is decided, then swap them into the beefy vault moo tokens. Then, indvidually credit the user with the appropriate token.

For example:

a. User deposits 100 EURT

b. The proportion decided is 50% in Vault A, 30% in Vault B, 20% in Vault C. Therefore split the EURT into:

50 EURT for Vault A, 30 EURT for Vault B, 20 EURT for Vault C.

Then swap each EURT into the vault's beefy vault moo tokens. We should create the appropriate beefy adapters for the exchange to streamline the process. This will be written as a separate ticket in the exchange repo.

c. Credit the user with the resulting Moo tokens received for each vault:

Vault A resulted in 30 Moo tokens, Vault B in 20 Moo Tokens, VAult C in 8 Moo tokens:

Credit the User with: {Vault A: 30 Moo, Vault B: 20 Moo, Vault C: 8 Moo}

  1. Create a 'reallocate' function that changes the underlying allocation and then loops through to credit the users with the correct balances.

Ex.)
Step 1: Check the user's balance as a proportion of the total balances.

User with: {Vault A: 20 Moo, Vault B: 8Moo, Vault C: 12 Moo} and the Optimizer has balances {Vault A: 60 Moo, Vault B: 40Moo, Vault C: 16 Moo}

The user had 33% of the optimizer's Vault A moo tokens (20/60), 20% of the optimizer's Vault B moo tokens (8/40), 75% of the optimizer's Vault C moo tokens (12/16).

Step 2: Change the allocation

Allocation changes to 60% Vault C, 40% Vault D.

Swap all Moo tokens into USDC (single token) : {Vault A: 60 Moo, Vault B: 40Moo, Vault C: 16 Moo} -->{Vault A: 100USDC, Vault B: 60 USDC, Vault C: 40USDC} == 200 USDC total.

Then do

120 USDC --> Vault C, 80 USDC --> Vault D.

Results in:

{Vault C: 90 Moo tokens, Vault D: 70 Moo tokens} in total for the whole Optimizer.

Step 3: Calculate how much belongs to the user in absolute terms

Total: {Vault A: 100USDC, Vault B: 60 USDC, Vault C: 40USDC} == 200 USDC total after swaps.

Therefore, the user deserves: 100 USDC * 33% + 60 USDC * 20% + 75% * 40 USDC = 75 USDC worth.

75 USDC / 200 USDC = 37.5% of the vault's new moo tokens belong to the user.

Vaults new total balances : {Vault C: 90 Moo tokens, Vault D: 70 Moo tokens}

User's new mapping should be updated to

(90 * 0.375) , (70 * 0.375)= )(33.75, 26.25)

User's new mapping: {Vault C: 33.75 Moo tokens, Vault D: 26.25 Moo tokens}

Describe alternatives you've considered
There might be more efficient ways to avoid slippage but we want to avoid other solutions that try denominate things into a single token because it can be frontrun.

Therefore, in this implementation, there are no "share" receipt tokens. Just an updating of the mapping. Perhaps we can add a transfer function if we want to to alter the underlying mappings. But this is not necessary.

Additional context

Add pool cvxCRV/FRAXBP and ETH/frxETH to locked pool options

Is your feature request related to a problem? Please describe.
Adding more diversity to our locked pools options.

Describe the solution you'd like
We need to check what needs to be done (add coins to the exchange, update the strategy contract, test, etc.) and implement the 2 pools from fraxConvex:

  1. image
  2. image

Contract addresses are here:

  1. Underlying curve: https://curve.fi/#/ethereum/pools/factory-crypto-97/deposit/ | staking address: https://etherscan.io/address/0x57c9F019B25AaAF822926f4Cacf0a860f61eDd8D
  2. Underlying curve: https://curve.fi/#/ethereum/pools/frxeth/deposit | staking address: https://etherscan.io/address/0xa537d64881b84faffb9Ae43c951EEbF368b71cdA

This is of course a similar issue then with the frax.convex implementation in the LD repo, what do we do while its locked?
For now let's just lock the funds for 7 days, and the user is simply not able to withdraw. The DAO does NOT take the risk.

Describe alternatives you've considered
NA

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.