Smart Vaults are structured in different smart contract components:
Mimic Smart Vaults architecture
This is the main component of the architecture, this is where all the assets are held and where its primitives are executed. This contract is also in charge of performing all the accounting logic related to investments and protocol fees.
Smart Vaults also provide a built-in authentication logic to configure who is allowed to execute these primitives. Only allowed users can operate the Smart Vault’s assets, Mimic is never in control of their funds.
Smart Vaults are replicated across different EVM-compatible chains to make sure users can interact with them transparently and in a unique way.
Smart Vaults flexibility come with responsibility. It is very important how permissions are configured. The suggested permission schema is to have an owner of the Smart Vault with permissions to authorize and unauthorize and to provide permissions to primitives only to secure actions. Check here about actions.
Smart Vaults can use different strategies to allocate assets into different DeFi protocols. Strategies simply need to define how assets are allocated into a DeFi protocol, how to claim rewards to earn yield, and how to exit their position from the DeFi protocol. These can be managed dynamically, Smart Vaults are allowed to add or remove strategies to control their investment strategies at any time.
Mimic provides a standard interface to make sure all DeFi protocols can be accessed in a simple way from Smart Vaults. Additionally, Mimic facilitates a few implementations to integrate different DeFi protocols like Curve, AAVE, Balancer, Compound, Uniswap, and others. However, custom strategies can be developed in a really easy way. Any ERC-4626 vault or similar vaults can be used as a Smart Vault strategy.
Mimic opens the doors to a whole world of community developers that want to contribute to strategies development. The protocol and curation process is open to anyone. Each Smart Vault will then decide which strategies they want to use. Mimic offers an on-chain curated list of strategies to make sure Smart Vaults can rely on this source. The curation process will be done by a governance committee initially, but it is already planned to become fully decentralized in the near future.
The Swap Connector is a smart contract that simply assists the rest of the components in a Smart Vault to swap assets. Having this kind of logic in a separate contract allows Smart Vaults to update it or replace it with another implementation in the future if desired. For example, the Swap Connector may allow swapping in different exchanges initially but it also may want to support some more in the future.
The Swap Connector simply interfaces with external exchanges to swap assets and it is mainly used by Smart Vaults. For example, it allows Smart Vaults to swap assets in order to join strategies to have a better position or to swap rewards in order to re-invest them.
The Price Oracle can be used to query the price of an asset in a decentralized way. It can be used along with other components to achieve different operations.
For example, it can be used to compute the minimum amount out for a swap based on a given slippage before calling the Swap Connector. It serves as a second source of truth to avoid having Smart Vaults depending entirely on what the Swap Connector says.
Similarly to the Swap Connector, Smart Vaults can update or replace this dependency with new implementations in the future if they need to.
The Mimic Registry is where all the implementations of the contracts listed above are registered. It acts as a curated on-chain registry so Smart Vaults can check against it before updating their dependencies.
For example, there could be two available Swap Connector implementations registered in the Registry that offer different exchanges. If a Smart Vault wants to update its Swap Connector dependency from one to another, it can simply validate that change using the registry to make sure they are not pointing to an invalid or malicious Swap Connector instance.
The Mimic Registry will be controlled by a governance committee initially, but it is already planned to become fully decentralized in the near future.
As described before, actions are where primitives can be combined together to achieve more complex operations. Actions can be granted with Smart Vaults permissions to execute different primitives.
An action is a simple smart contract with Smart Vaults permissions that executes a specific set of primitives in a specific order. Context predicates can be defined in each action to control when this should be executed.
Moreover, similarly to Smart Vaults, actions also can make use of their built-in authentication logic to control who is allowed to execute these. For example, actions can be triggered by Mimic bots if they allow that.
It's important to note that Smart Vaults are not meant to be called directly by users, actions are required to be built on top to make sure Smart Vaults are called in a safe way. Permissions must be properly configured for an action in order to have a secure and successful layout.
Actions can be triggered not only manually, but also automatically by Mimic bots. Of course, this needs to be allowed from the Smart Vault itself beforehand.
Smart Vaults can allow Mimic bots to execute certain actions based on their pre-set conditions. Bots will monitor the blockchain and trigger these actions automatically only if said pre-set conditions are met. For example, a Smart Vault could be set to withdraw gains on a monthly basis. Note that this action can be configured to be executed automatically by a Mimic bot with a gas cost limit or gas price limit.
Currently, Mimic runs the bots internally, but in order to ensure trustless execution, the system will eventually migrate to a decentralized network of bots.