Set Documentation
Search…
⌃K

Overview

What are Templates?

Asset management templates or strategies are a set of periphery contracts built on top of the core Set Protocol V2 contracts that allows asset managers to create advanced structured product instances. These periphery contracts complement the core protocol and include:
  • Rebalancing specific logic. Trading assets, Wrapping/unwrapping
  • Split fees among multiple parties
  • Accessibility/Permissions
  • Asset restrictions
  • Any other programmatic restrictions on the Set
Currently, creating a product directly using the TokenSets UI results in the manager address being the EOA address which provides maximum flexibility to the manager in trading and rebalancing assets in their Set. However, if you are looking to build a rules-based market index or leverage token, maximum flexibility may not be the most optimal option.
This is where manager contracts and asset management templates come in! Instead of the manager of the Set being an EOA, templates allow smart contracts to be the manager and automate, customize and combine many of these actions. For example, a yield hunting product may use an asset management template that contains a function that allows anyone to call claim() on the ClaimModule, absorb() on the AirdropModule, and trade() on the TradeModule() to reinvest governance token rewards in one transaction. Or a leverage token that allows any keeper to calculate the current leverage ratio and delever during market crashes. The possibilities here are endless...
We have built templates to be easily forked and deployed by developers and asset manager partners. Index Coop, a partner building structured products on Set Protocol, uses these templates we provide to launch popular products such as the DeFi Pulse Index, Metaverse Index and the ETH2x-FLI leverage index with over $400M TVL.
To get started, check out the set-v2-strategies Github repo or join us in Discord. As an open source project, we welcome any developers to contribute to our repository!

Architecture

Similar to the core Set Protocol system, we have architected the initial asset management templates to be modular and allow maximum flexibility for adapters that customize functionality specific to the structured product you are building.
The entry point to the system is the BaseManager. Below is an example of the architecture used by the DeFi Pulse Index where Extension contracts call relevant Set modules, and are easily added and removed by the manager:

Contract Types

  • BaseManager - This contract is the address defined as the manager state variable on the SetToken. The BaseManager has explicit functions to interact with the SetToken (add/remove modules, edit manager address). Additionally, the manager functionality is "extended" through the interactManager which is only callable by Extensions. This contract also stores addresses for the permissioned roles, operator and methodologist
  • Extensions - These contracts extend the function of the BaseManager by passing arbitrary bytedata to the interactManager function on the BaseManager. Extensions can contain any logic and have the ability to apply their own permissions to callers of its functions. Extensions can be used to split fees, encode rebalancing strategies, permission SetToken functionality, etc.

Global Roles

  • Operator - Address responsible for upgrading and maintaining the Set. This address is the only one that can add/removes Extensions, change managers or add/remove modules.
  • Methodologist - This address can be used to grant the methodologist permissions or as an address to forward revenue generated by the Set.

Available Extensions

Currently, these BaseManager Extensions are available in the Set V2 Strategies Github for anyone to fork and build products using.
Extension Name
Description
PerpV2 Leverage Strategy
Smart contract that enables trustless leverage tokens using Perpetual Protocol V2 deployed on Optimism. This extension is paired with the PerpV2LeverageModule from Set Protocol where module interactions are invoked via the IBaseManager contract. Any leveraged token can be constructed as long as the market is listed on Perp V2.
Aave Leverage Strategy
Smart contract that enables trustless leverage tokens using Aave. This extension is paired with the AaveLeverageModule from Set Protocol. Any leveraged token can be constructed as long as the collateral and borrow asset is available on Aave.
Compound Leverage Strategy
Smart contract that enables trustless leverage tokens using Compound or any fork. This extension is paired with the CompoundLeverageModule from Set Protocol. Any leveraged token can be constructed as long as the collateral and borrow asset is available on Compound or forks.
Fee Split
FeeSplit Extensions are used to interact with the StreamingFeeModule (and any other module which collects fees). These extensions distribute fees to stakeholders. These extensions must be added to the BaseManager in order to be used.