How it Works

About Orchestrators & OrchestratorFactory

Orchestrators: Crafting Personalized Strategies

Nexera-Fi Orchestrator contracts empower users to architect and employ their own financial strategies and campaigns in the dynamic DeFi landscape. These user-owned smart contracts serve as versatile DeFi aggregators, seamlessly integrating with various DeFi platforms based on their configured Adapters. The configuration of Orchestrators allows their respective owner to handpick Adapters, define asset compositions, and select trusted operators.

The successful operation of Orchestrators necessitates owners to transfer their selected assets for strategic financial purposes to the respective instance. Orchestrators engage with various DeFi platforms via associated Adapters, ensuring that the designated output assets are directed to the appropriate Adapter for use on the corresponding platform. The assets resulting from these platform-specific interactions are subsequently allocated back to the Orchestrator contract, but only if they satisfy specific predefined criteria, such as surpassing the minimum expected input assets threshold; otherwise, the transaction will be reversed.

It's important to emphasize that owners maintain complete ownership and control over their assets, retaining the ability to withdraw them at any time through the withdraw or withdrawBatch function.

/**
* @notice Withdraws a specified amount of a given ERC-20 token from the Orchestrator contract
* @dev Only callable by the owner
* @param token The address of the ERC-20 token to withdraw
* @param amount The amount of the specified token to withdraw
* @param target The target address to receive the withdrawn funds
*/
function withdraw(address token, uint256 amount, address payable target) external;
/**
 * @notice Withdraws specified amounts of multiple ERC-20 tokens from the Orchestrator contract
 * @dev Only callable by the owner
 * @param tokens An array of ERC-20 token addresses to withdraw
 * @param amounts An array of amounts corresponding to each specified token to withdraw
 * @param target The target address to receive the withdrawn funds
 */
function withdrawBatch(address[] calldata tokens, uint256[] calldata amounts, address payable target) external;

Executing Actions

graph LR; style Users fill:#64ae6d; style Data_Source fill:#5ab3aa; style Executor fill:#85a1a7; style Nexera-Fi fill:#9999dd; style DeFi_Platforms fill:#ff66b2; subgraph Users A[<b>User A</b>] end subgraph Data_Source B[<b>Data</b>] end subgraph Executor C[<b>Executor</b>] end subgraph Nexera-Fi D[<b> Orchestrator <br> Contract Instance</b> <br> <i>owned by User A</i>] E[<b>Adapter X</b>] end subgraph DeFi_Platforms F["<b>Platform X</b> <br> (e.g. DEX)"] end A --> |<b>-1-</b> Configures & <br> allocates assets| D B <--> |<b>-2-</b> Real-Time <br> Data Monitoring| C C --> |"<b>-3-</b> execute('Action') call <br> on conditions"| D D --> |"<b>-4.1-</b> Employment of <br> <i>(based on Action)</i>"| E E <--> |"<b>-4.2-</b> Interacts with <br> <i>(based on Action)</i>"| F E --> |"<b>-4.3-</b> Result <i>(assets' allocation)</i> <br>of actualized Action"| D A -.- |"<b>-5-</b> Receives assets <br> <i>(withdraw() call)</i>"| D

Orchestrators offer users the freedom to manually operate their strategies or delegate the task to an approved operator referred to as an "executor". This executor can be a third-party service, such as a cloud-based program, designed to continuously monitor price feeds and other relevant data, and programmed to execute specific actions via the Orchestrator contract based on those data. The function for initiating actions' execution, exposed by the Orchestrator, can only be called by the configured executor, while the overall control of the strategy remains with the owner. Actions are explicitly defined through a structured set of parameters, including the following:

  • The Adapters to employ (specified via their addresses)
  • The Operation (swap, deposit etc..) that each Adapter should actualize in the respective DeFi platform
  • The Assets at play (output assets & expected minimum input assets) for each Adapter
  • Any additional data required by specific Adapters

This approach provides flexibility and control, enabling users to adapt their strategies on-the-fly in response to changing market dynamics.

OrchestratorFactory: Streamlining Deployment and Configuration

OrchestratorFactory is pivotal in Nexera-Fi, streamlining the deployment and configuration of Orchestrator contract instances. The Factory, owned by Nexera-Fi, maintains essential state data, including the Orchestrator implementation contract address as well as the pre-configured executor.

The employment of OrcehstratorFactory offers a secure environment for users to create and configure their strategy campaigns while ensuring contract structure consistency. Users are enabled to effortlessly deploy and configure customized Orchestrator instances by providing the minimal necessary information such as Adapters and assets for their designed strategy. This streamlined process deploys and configures an Ownable Orchestrator instance in a single transaction, offering efficiency and simplicity. Additionally, all deployed instances can be fully reconfigured by their respective owner at any time, ensuring that their strategies remain adaptable and responsive to evolving market dynamics.

graph TD; style Nexera-Fi fill:#a3b8bd; style Factory fill:#42a9c9; style Users fill:#bddda9; style Orchestrator_Instances fill:#679eac; subgraph Nexera-Fi A[<b>Nexera-Fi Admin</b>] subgraph Factory B[<b>OrchestratorFactory</b>] end subgraph Users C[<b>...</b>] D[<b>User X</b>] E[<b>...</b>] end subgraph Orchestrator_Instances F[<b>...</b>] G[<b>Orchestrator</b> <br> <i>Owned by User X</i>] H[<b>...</b>] end end A -.- |Set| B B --> |Deploys Configured Instance| G D --> |Configure & Deploy <br> Orchestrator Call| B

On this page