After creating your vault, strategy setup is a two-step process:
- add the adaptor to the vault
- initialize each strategy you want to deploy to
Vault creation does not initialize any strategies. Until this step is complete, deposits remain idle.
Concepts
- Adaptor: an on-chain program that knows how to talk to a category of protocols
- Strategy: a specific target inside that adaptor, such as one market, vault, or counterparty
Add The Adaptor
import { getAddAdaptorInstructionAsync } from "@voltr/vault-sdk";
const addAdaptorIx = await getAddAdaptorInstructionAsync({
payer: adminSigner,
admin: adminSigner.address,
vault: vaultAddress,
adaptorProgram: adaptorProgramAddress,
});
Initialize The Strategy
import { getInitializeStrategyInstructionAsync } from "@voltr/vault-sdk";
const initStrategyIx = await getInitializeStrategyInstructionAsync({
payer: adminSigner,
manager: managerAddress,
vault: vaultAddress,
strategy: strategyAddress,
adaptorProgram: adaptorProgramAddress,
instructionDiscriminator,
additionalArgs: new Uint8Array(),
remainingAccounts: [
// protocol-specific accounts
],
});
Use The Script Repos As Source Of Truth
The exact strategy, discriminator, and remaining accounts are adaptor-specific. Use the maintained repositories for working examples: