Adaptor Management
This guide explains how to add and remove adaptors in the Voltr Protocol. It covers the process of adding adaptors to vaults, and managing adaptor lifecycles.
Prerequisites
Before managing adaptors, ensure you have:
An initialized vault in the Voltr Protocol
Admin authority for the vault
The Voltr SDK installed:
Setup
Import the required dependencies:
Strategy Types
Vault owners are welcome to integrate custom adaptors created by DeFi teams. Currently. the protocol supports several in-built adaptor types:
Adding Strategies
1. Create a Strategy
First, create a new strategy account:
2. Add Strategy to Vault
After creating the strategy, add it to your vault:
3. To remove a strategy from a vault:
Account Structure
Strategy Account
Adaptor Strategy Account
Vault Strategy Account
Finding Strategy Addresses
The SDK provides helper functions to find strategy-related addresses:
Important: Strategies can only be removed when they have no funds deployed (currentAmount = 0
).
Complete Example
Here's a full example of adding and initializing a strategy:
Error Handling
Common strategy-related errors:
Best Practices
Strategy Selection:
Choose strategies that match your vault's risk profile
Understand the underlying protocol's mechanisms
Verify strategy program compatibility
Risk Management:
Start with small deposits to test strategy
Monitor strategy performance regularly
Have a withdrawal plan for emergencies
Security:
Keep admin keys secure
Test on devnet first
Verify all account permissions
Double-check program IDs
Operations:
Always check strategy balance before removal
Maintain accurate records of deployed assets
Monitor gas costs for operations
Troubleshooting
Strategy Creation Fails:
Verify admin authority
Check counterparty token account exists
Ensure protocol program ID is correct
Strategy Addition Fails:
Verify vault admin authority
Check strategy account exists
Ensure adaptor program matches
Strategy Removal Fails:
Verify strategy has zero balance
Check admin authority
Ensure all funds are withdrawn
Initialization Fails:
Check account permissions
Verify rent exemption
Validate program IDs
For more detailed information, refer to the Voltr SDK documentation or contact the development team.
Last updated