Skip to main content

Factory

The StrategyProxyFactory is used to deploy new strategies and also stores global contract addresses such as StrategyController, EnsoOracle, Whitelist, TokenRegistry and fee pool.#

Create Strategy#

The createStrategy() function first deploys a proxy contract and sets the deployed Strategy contract as the implementation. It then adds the contract address to the TokenRegistry contract and initializes the Strategy with relevant token metadata and its initial structure. Finally, it calls setupStrategy() in StrategyController which sets the strategy state and does the first deposit.