Unagii Vaults V1 is an Ethereum-based protocol that enables users to passively earn from automated yield farming by depositing single crypto assets into the Vaults executing a specific Strategy in a gas-efficient environment. Unagii integrates with third-party DeFi protocols (i.e. AMMs and lending platforms), enabling support for a wide selection of strategies that are deemed safe and valuable to users.
Unagii Vaults V1 Architecture
Admin refers to the Unagii team, managed by a 2 out of 3 team member Gnosis multisig. Admin members are able to set and approve strategies, and execute the
These are Externally Owned Accounts (EOA) that are set to automate transactions at specific time periods to the Controller contract.
The main Unagii governance contract. Only the Admin and Bots are authorized to trigger transactions on the Controller.
DeFi is the acronym for Decentralized Finance, a term describing a variety of blockchain-based financial protocols and applications.
The function to transfer user funds into Strategy.
The function to claim and sell down rewards, then return all funds in the associated Strategy back into the Vault.
This is the contract that allows Unagii to tokenize gas on Ethereum. Unagii will store gas when it is cheap to do so, and spend the Gas Token when deployment and transaction costs are high.
This enables the Bots to spend the Gas Token on a transaction that cuts transaction fees.
The function to claim and sell down rewards into the most premium deposit token, then re-investing the token back into the vault, thereby compounding rewards.
Calls the Deposit function to transfer tokens from the Vault into the Strategy.
The function to update user balances according to the asset balance in the Strategy. It can only be called when the asset balance is more than the debt balance within the Strategy.
Strategy determines how yield is generated and accrued. Each DeFi protocol has different sets of strategies. Unagii has curated a bank of whitelisted strategies handpicked by the team that will give users the best performing yields on their tokens.
All new strategy contracts to be launched will be deployed behind a 24 hour time lock. It is currently managed by admin. The time lock will need to be called in order for new strategies to be approved. Users will be able to verify all of such events on-chain.
The function to withdraw tokens from the Strategy back into the Vault.
Unagii Vaults V2 is the next iteration of the protocol with a slightly different architecture:
- Vaults are upgradable by default as the Unagii Token contracts and the Vault contracts are separated, making it similar in design with Curve token and Curve pool contract
- Smart contracts can interact (deposit/withdraw) from the vaults, which allows any developer to integrate with Unagii Vaults V2 (there is a block delay)
- Vaults are protected from flash loan attacks as Unagii token tracks the lastest block number of the caller
- Protected from sandwich attack on harvest as profit is vested over a period of time (6 hours for now)
- Vaults are able to invest in multiple strategies, allowing the protocol to maximize returns by optimizing the allocation of funds to each strategy
Unagii Vaults V2 Architecture
mint Unagii shares when user deposits.
burn Unagii shares when user withdraws.
set minter to Vault. this makes Unagii V2 upgradable. (only called by TimeLock).
user deposit token (DAI, USDC, USDT, ETH, WBTC), receives Unagii token in return.
user withdraws token (DAI, USDC, USDT, ETH, WBTC), Unagii token is burnt.
set FundManager used to upgrade FundManager contract (only called by TimeLock).
borrow user funds from Vault (only FundManager can call).
repay borrowed funds (only FundManager can call).
report profit back to Vault.
set Vault used to upgrade Vault contract (only TimeLock can call).
approve new strategy (only TimeLock can call).
activate strategy (only approved strategy can be activated).
reorder activate strategies (order determines which strategy to withdraw from first).
borrow user funds from Vault.
repay user funds to Vault.
call report on Vault.
withdraw user funds from FundManager and activate strategies, back into Vault.
borrow user funds from FundManager.
repay user funds to FundManager.
report profit back to FundManager.
withdraw user funds back into FundManager.
borrow from FundManager and invest into external DeFi.
claimRewards / skim / harvest
Unagii Vaults V3 further iterate upon the protocol with the following changes:
- Gas cost optimizations for users and operators
- Upgradable Swap contract allows us to choose the best AMM exchange rates for yield -> vault tokens in response to changing market conditions
Unagii Vault V3 Architecture
deposit / mint
deposit asset token (USDC, ETH, etc) in exchange for Unagii vault tokens
withdraw / redeem
exchange Unagii vault tokens for asset token (USDC, ETH, etc)
adds a new strategy to strategy queue
withdraws all assets from strategy to Vault and removes it from strategy queue
harvest / harvestAll
claim profit from strategies
report / reportAll
re-balance assets within strategies
manually withdraws assets from strategy
claim profit from DeFi
deposit assets into DeFi
sends assets back to vault
set swap contract used (if necessary)
choose AMM to swap token pair with (e.g. Uniswap, Sushiswap)
swap tokens along the assigned best route