Vaultis designed to issue tokens proportional to amount of funds the user deposits. It's meant to issue new tokens or burn existing tokens only when all the fund values are updated.
TradeExecutorcontracts to invest the user funds in various protocols. The funds of mainnet
TradeExecutorare updated on a block by block basis. While those interact with other L2 protocols, the funds are updated by keeper in order to process deposits/withdrawals.
deposit- Mint to new vault tokens representing user's share of funds.
withdraw- Burn the vault tokens and transfer the amount to user's wallet.
depositIntoExecutor- Deposits funds into the executor contract to be used for making trades on protocol
withdrawFromExecutor- Withdraw funds from executor in order to process user withdrawal request.
collectFees- Calims the fees from the yield generated on user funds to governance.
vaultcontract is responsible for issuing erc20 tokens representing user share based on the total funds it holds. The
vaultalso keeps the track of funds invested in trade executors. So trade executor funds should be updated before processing any deposits or withdrawals. vault computes the yield it generated between different harvest cycles to process the fees.
Keepermaintains the list of
batchermakes sure there is always enough collateral on
vaultto process any user withdrawals.
vaultin emergency mode with
vaultto reduce attack impact.
Governancecan enable back the deposits/withdrawals after an emergency.
TradeExecutorsthat move funds to L2 protocols, their funds are updated correctly by
Keeperas they aren't available solutions to update the state of l2 contract funds. We are exploring solutions with layerZero and anyswap call for this to prevent centralization risk.