Ecosystem overview
Shift is a decentralized protocol that enables users to deposit funds into immutable invested vaults with a predefined set of cross-chain DeFi strategies and earn interest. The ecosystem consists of a set of smart contracts that collectively create a use case. Details about the smart contracts and their purposes are provided below.
Vault
The Vault serves as the primary gateway to Shift. Each Vault is a smart contract that issues NFTs for the user at the time of deposit into the Vault. The NFT serves as a receipt for the deposited funds and also carries information about all user allocations in DeFi strategies (DEFII). Each DEFII is represented as an ERC20 token and encompasses logic for entry, exit, reinvestment into the underlying DeFi protocol, where the user's liquidity is allocated for yield farming purposes. Each DEFII mints DEFII LP ERC20 tokens, accrued to the user's owned NFT representing the user's share in the funds hold in DEFII. The Vault stores the DEFII LP of each strategy.
During the first deposit, a position is created for the user. The position is an NFT that records the user's balance. After depositing into the Vault, it is necessary to distribute the user's funds into the DEFII. The user can initiate entry into DEFII on their own, or delegate it to an operator, prepaying the transaction processing costs and giving the operator permission to manage their position.
The Vault is deployed on one chain, while DEFII can be distributed across different chains.
DEFII
DEFII is the embodiment of an investment strategy within an underlying DeFi protocol. It oversees the logic of supplying liquidity to the underlying DeFi protocol, along with the creation of DEFII LP tokens. These tokens serve as certificates representing users' deposits in DEFII, documented within the user's NFT. Each DEFII comes with a notion, a nominal value utilized for return calculations and entry into the DEFII.
There are 2 types of DEFII: LocalDefii and RemoteDefii.
LocalDefii
Implementation of DEFII on the Vault's chain. LocalDefii includes logic for entry, exit, reinvestment into underlying protocol, and . LocalDefii stores LP tokens of the underlying DeFi protocol there user's liquidity is provided.
RemoteDefiiPrincipal & RemoteDefiiAgent
Implementation of DEFII on a remote chain. This type of DEFII consists of two contracts.
RemoteDefiiPrincipal operates on the same chain as the Vault. It is responsible for interacting with the Vault, minting DEFII LP, sending funds to the chain where the underlying protocol operates, and initiating entry and exit. RemoteDefiiPrincipal mints DEFII LP tokens for the depositor but does not store tokens of the underlying protocol.
RemoteDefiiAgent implements the logic of interacting with the underlying protocol, stores liquidity, and initiates minting of DEFII LP on the Vault's chain after entering the underlying protocol.
RemoteDefiiPrincipal interacts with RemoteDefiiAgent using message brokers.
OperatorRegistry
Stores user approvals for the operator. Approval is given so the operator can interact with the Vault on behalf of the user. The operator's actions are limited to entering and exiting DEFII. Describe in more detail the actions and that it does not affect liquidity.
Architecture overview
Misc
Router
An auxiliary contract that allows entry into the Vault with any ERC20 token.
BridgeAdapters
An interface for bridges. Currently, adapters for CCTP and Stargate are implemented.
Offchain services
For actions performed by the operator, offchain processing is provided. The offchain service performs transactions for entering DEFII when there is approval from the user. Also, the offchain service generates an optimal path for delivering the user's funds to the remote defii. In the defi-platform, this capability is ensured by the presence of SWAP, BRIDGE, SWAP_BRIDGE instructions.
Last updated