Vault Flow
Last updated
Last updated
Actors:
User: Can deposit, withdraw, and query share values.
Admin: Can initiate bridging operations.
Executor: Can add fees, add reserves, and request funds.
Gateway: Can add reserves.
Vault Smart Contract Actions:
Deposit: Increases total shares, user shares, and total deposited amount.
Withdraw: Decreases total shares, user shares, and total deposited amount.
Add Fees: Adds fees and increases value of each share in the vault.
Add Reserves: Doesn't change the total deposited amount but increases available funds. Used by executors and during bridging.
Request Funds: Allows the executor to withdraw funds without changing the total deposited amount.
Bridge: Decreases the total deposited amount as tokens are moved to another network.
Get Share Value: Reads the total shares and total deposited amount to calculate share value.
Flow:
Users interact with Deposit, Withdraw, and Get Share Value functions.
Admin can initiate bridging operations.
Executor and Gateway can add fees and reserves, with the Executor also able to request funds.
When fees are transferred from the executor, the total balance state variable of the contract is increased, leading to an increase in the price for every share.