Smart Contracts

This document provides a comprehensive, in-depth overview of the IPOR-Fusion architecture, its core concepts, modular components, and operational mechanics, structured for developers.

1. Core Architecture: The Polymorphic Vault

At its heart, IPOR-Fusion is a polymorphic vault architecture. This design allows the vault's core strategy and capabilities to be dynamically extended without upgrading the central PlasmaVault contract.

  • PlasmaVault: This is the central, stateful contract that holds all user-deposited funds. It acts as a secure container that executes operations on various external protocols but does not contain complex strategy logic itself.

  • Markets: A "Market" represents an external protocol or a specific strategy within a protocol with which the PlasmaVault integrates. It's the destination for the funds that the vault manages (e.g., a lending pool on Aave). The Market ID is an abstract entity. While in most cases a single ID corresponds to a single market in an external protocol, the architecture allows for defining more than one Market ID for a single external protocol integration (via a Fuse). This is particularly useful when one Fuse needs to handle different assets or sub-strategies within that same protocol, treating each as a distinct market from the vault's perspective.

  • The Alpha: This refers to the authorized strategist or automated entity responsible for managing the vault's funds by rebalancing assets between different Markets.

2. The Building Blocks: Modular Components

The polymorphic nature of the vault is enabled by a set of pluggable, modular components that handle specific tasks. These components are invoked by the PlasmaVault using delegatecall, which means their logic executes within the context of the vault's storage, address, and balance.

3. Manager Contracts: Specialized Logic

Manager contracts are specialized contracts that encapsulate and offload specific areas of logic from the PlasmaVault, making the system more modular and maintainable. (See folder: https://github.com/IPOR-Labs/ipor-fusion/tree/main/contracts/managersarrow-up-right)

4. Lifecycle Part 1: Vault Creation via Factories

The IPOR-Fusion ecosystem is designed to be extensible through a system of Factory contracts. These factories are responsible for deploying and initializing different parts of the system. (See folder: https://github.com/IPOR-Labs/ipor-fusion/tree/main/contracts/factoryarrow-up-right )

5. Lifecycle Part 2: Post-Deployment Vault Configuration

Once a vault is deployed via a factory, its behavior is fine-tuned using the following methods:

6. Core Operational Mechanics

7. Key Code-Level Definitions

To fully understand the system's operation, it is essential to be familiar with several key definitions found directly in the codebase.

8. Example DeFi Strategies for Alpha

The tests within the IPOR-Fusion repository serve as excellent, practical examples of the types of DeFi strategies the Alpha can execute via the PlasmaVault. These strategies range from simple, single-action operations to complex, multi-step leveraged positions.

9. Developer Resources: Locating Addresses and ABIs

Contract addresses and their Application Binary Interfaces (ABIs) are essential for interacting with the protocol. You can find these crucial details in our dedicated IPOR ABI GitHub Repository: https://github.com/IPOR-Labs/ipor-abiarrow-up-right.

Within this repository, navigate to the abi/ folder to access JSON files containing the ABIs for individual contracts. You will also find contract addresses for various networks, such as Ethereum Mainnet and Arbitrum. Common addresses for the Fusion ecosystem are typically located in folders with a "-fusion" postfix, and specific deployment addresses are often in files like deployment-addresses.json.

Last updated