Vaults have 2 types of smart contracts: Storage and Logic
A Storage contract is responsible for all interactions with users' wallets
- Users can deposit to Storage
- Users can withdraw from Storage
- Users can claim rewards
Storage contract implements Rewards Distribution Model. More info about the distribution model can be found here:
The logic contract is responsible for the implementation of the Yield aggregation strategy and its interaction with DeFi platforms according to the Strategy. It includes:
- Lending and borrowing algorithms
- Provide Liquidity to DEXes (create LP pairs)
- Farm LP pairs on DEXes
- Swap tokens to rerebalance LP pairs
- Claim rewards
- Byback BLID from the market
The deposited assets are divided into 2 parts.
- A small number of tokens is held on the Storage contract.
- After the user's deposit action, tokens are transferred to the Logic contract in order to begin to work on the Strategy. These assets are involved in the Strategy, which means they are held on the Logic contract (belong to).
When a user wants to withdraw some assets:
- 1.If there is enough amount of assets on the Storage contract, the full amount of tokens can be withdrawn to the user's wallet.
- 2.If there are not enough assets on the Storage contract, the algorithm removes tokens from Farming and returns them to the Storage contract meaning that a full amount of tokens is withdrawn to the user's wallet.
Note: The first option has a less expensive transaction, while the second one is more gas-consuming.
Contract addresses can be found here: