Architecture
The overall SuperReturn smart contract design is based on the highly scalable BoringVaults architecture.
BoringVault
The BoringVault is an ERC20 token contract that custodies all deposit assets and exposes permissions for minting and burning the vault shares. The other contracts rely on permissions granted by the BoringVault to execute certain actions.
Manager
The Manager is the contract responsible for rebalancing the BoringVault. The account that uses the Manager to rebalance is called the strategist. The Manager contract gates strategist calls to expose the minimum set of functionality required to rebalance the vault.
This gating is implemented as a Merkle verification system: every rebalance call made by a strategist must additionally submit a Merkle proof verifying that the content of the call is permitted by the vault.
Teller
The Teller - with the permissions granted by the BoringVault to mint and burn the shares - defines the logic for minting shares upon deposit. The Teller checks whether the given asset is part of its list of supported assets, queries the assets' value via the Accountant, and determines how many shares to mint for the given amount of deposit tokens.
The Teller also can be extended to support different types of bridges. For example, the Teller may use the LayerZero bridge to bridge its minted shares.
Accountant
The Accountant is the source of truth for the BoringVault's exchange rate as well as the value of each whitelisted deposit assets.
Because the Teller is able to accept an arbitrary number of whitelisted assets, in order to determine how many shares to mint given an asset, it needs to query both the vault's base exchange rate and the specific price of the asset.
Boring Queue
The Boring Queue implements a withdrawal management system that handles delayed withdrawals with configurable parameters for each asset. It maintains a structured queue of withdrawal requests, each with specific maturity times, deadlines, and discount rates. The queue enforces strict validation rules, ensuring withdrawals can only be processed after maturity and before deadline expiration.
Solver
The Solver is a key component that handles the execution of withdrawal requests from the BoringVault. It provides two main functionalities: allowing users to process their own withdrawal requests and enabling authorized solvers to process multiple requests at once. This design creates an efficient system for processing withdrawals while maintaining proper asset accounting and security controls.
Last updated