Built-In Adaptors by Voltr
Last updated
Last updated
The Voltr protocol includes four built-in adaptors (Kamino, Marginfi, Drift, Solend). Each adaptor implements standardized interfaces while handling protocol-specific logic and state management.
Each built-in adaptor implements three core instructions:
Key Features
Lending market interactions
Collateral management
Position tracking
Verify program IDs for each protocol
Validate account ownership
Check account relationships
Confirm authority permissions
Handle math overflow in calculations
Verify exchange rates
Validate deposit/withdrawal amounts
Track protocol-specific limits
Refresh protocol state before operations
Update positions after operations
Verify state changes
Handle failed transactions
Always refresh protocol state before operations
Verify calculations with protocol state
Update strategy state after operations
Handle partial operations
Implement comprehensive error types
Handle protocol-specific errors
Provide clear error messages
Include error context
Maintain accurate position tracking
Handle decimal conversions
Verify balance updates
Track cumulative amounts
Account Loading
Cache loaded accounts
Minimize redundant loads
Batch state updates
CPI Calls
Optimize remaining accounts
Minimize transaction size
Handle CPI restrictions
Calculations
Use efficient math operations
Handle precision correctly
Minimize redundant calculations
For detailed protocol specifications and implementation details, refer to each protocol's documentation.