The Quinoa Protocol is an Ethereum Smart Contract for risk managing portfolio with rule-based dynamic asset allococation. Through the Product contracts, accounts can invest their funds in diverse assets to receive share tokens. The share tokens represent how much shares of the portfolio values funded in and run by the product.
- ERC20 tokens for representing how much shares of the portfolio values funded in and run by the product.
Deposit/Withdraw
- Product has interfaces including
deposit
,withdraw
,convertToShares
,convertToAssets
which are inspired by standard format of ERC4626 as Tokenized Vault Standard. Users can deposit or withdraw their assets among the underlying tokens of each strategy manage. - Each product has a buffer assets called float. The float ratio should be set by the DAC(manager of the product). When user request withdraw, the products receive the share token and return the assets from the float first. If float is not enough to cover the debt from the user, the assets run by strategies would be withdrawn in order of withdrawal queue.
Managing Assets
- Base underlying asset for product is USDC(for V1 version)
- AssetParams is a struct data structure having the information of asset address, target weight for allocation in product.
- Connected to multiple strategies.
portfolioValue()
returns the total values of funded assets in USD basis.- The
rebalance()
allocates the assets into strategies connected to the product. which can be called by the DAC and the Chainlink Automation Keeper.
Security
- In Emergency situation, the product should be called
emergencyWithdraw
being deactivated and the all assets in strategies are withdrawan.
- Managing a single asset for getting yields from defi ecosystem.
- Should be implemented the logic inside 'deposit', 'delegate', 'yield'. As Quinoa-V1, the strategy leverage yield strategies in defi ecosystem such as Beefy, Balancer, Stargate.
- USDC Strategy : Deposit Stargate USDC LP tokens into Beefy USDC Pool which compounds the yield as base of USDC
- WETH Strategy : Deposit Balancer WETH-WSTETH LP into Beefy BAL_WETH-WSTETH pool which compounds the yield as base of WETH
- A library for features for fetching the USD prices of each asset and calcuating how much values in USD with amount of each asset.
- A module for utilizing swap assets using Uniswap-V2 interfaces.
- Have swap functions for trading tokens with exact input and output and estimation functions for trading with input or output.