The Strategy contract is the main storage layer of the protocol. It contains the state of the strategy such as which assets are part of the strategy, what the percent of the total strategy value each token is allotted, and the ownership shares of each user. Additionally, this contract holds all assets that are part of the strategy and gives access to the StrategyController to trade assets on it's behalf.
The StrategyController is the main interface of the Enso protocol. It is the only contract that may transfer tokens from the Strategy or approve tokens to be transferred from the Strategy. For any functions that require the movement of tokens (such as
finalizeStructure) the StrategyController approves all tokens to be transferred from the Strategy by the Router. After trading takes place, approval is removed from the Router and the StrategyController ensures that there is no loss in value in the Strategy with the help of the Oracle contract.
Routers handle the main trading logic of the protocol. They are given approval to trade on behalf of a StrategyController and may freely transfer assets away from the the Strategy in order to do that. However, for security, all approvals are removed from the Router upon completion of the transaction and no funds may remain within a Router after a transaction. Additionally, the StrategyController relies upon an Oracle to ensure that there is no loss of value to the underlying assets at the completion of a transaction.
An Adapter provides a common interface to exchange assets, provide liquidity, or yield farm. The manager of a strategy can define the trading path needed to get into a desired token position by providing an array of adapters to handle each token exchange.
The EnsoOracle provides a global price feed of the available assets, priced in WETH. It provides an interface where the StrategyController may query the current valuation of all its underlying assets to determine if it needs rebalancing and to ensure that any trading by a Router does not result in a loss of strategy value.