Orchestrator Deployment
Interaction with Adapters is consistently facilitated through Orchestrator contracts, serving as the primary gatekeepers. Thus, each interaction with a DeFi protocol is initiated from a configured Orchestrator instance and directed through the designated Adapter, guided by the supplied operation data.
The forthcoming example demonstrates the deployment and configuration of an Orchestrator contract via the OrchestratorFactory using the Nexera-Fi SDK.
Make sure you've appropriately initialized the NexeraFiSDK, covering configurations essential for further interactions.
Deploying & Configuring an Orchestrator Instance
Typescript Example
Begin by specifying the Adapters and Assets to whitelist in your Orchestrator.
Notably, this step is optional for the deployment process, as the whitelisting of Adapters and/or Assets can be accomplished after deployment by interacting directly with the Orchestrator instance.
Next, obtain the utility function for deploying an Orchestrator by calling the deployOrchestrator
method.
Provide the necessary arguments when executing the deployment function:
- chainId: The chain ID of the target blockchain
- signer: An Ethers.js Signer (The address of this wallet will be the owner of the Orchestrator)
- adaptersToWhitelist: Array of Adapter addresses to whitelist (or empty array to skip)
- assetsToWhitelist: Array of token addresses to whitelist (or empty array to skip)
You can now connect to the deployed Orchestrator instance using the obtained deployment address.
Python Example
Begin by specifying the Adapters and Assets to whitelist in your Orchestrator.
Notably, this step is optional for the deployment process, as the whitelisting of Adapters and/or Assets can be accomplished after deployment by interacting directly with the Orchestrator instance.
Get OrchestratorFactory Web3 contract instance
Simulate Tx to get the deployment address of the Orchestrator
Execute the transaction
You can now connect to the deployed Orchestrator instance using the obtained deployment address.
Further Configuration of an Orchestrator
Continuing from the above example, this section demonstrates how to further configure or reconfigure your Orchestrator.