Fund Allocation
Setup
import { Connection, Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js";
import { VoltrClient, LENDING_ADAPTOR_PROGRAM_ID, SEEDS } from "@voltr/vault-sdk";
import { BN } from "@coral-xyz/anchor";
import {
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddressSync,
getAccount,
TOKEN_PROGRAM_ID,
} from "@solana/spl-token";
import fs from "fs";// Load manager keypair
const managerKp = Keypair.fromSecretKey(
Uint8Array.from(JSON.parse(fs.readFileSync("/path/to/manager.json", "utf-8")))
);
const manager = managerKp.publicKey;
// Initialize connection and client
const connection = new Connection("your-rpc-url");
const client = new VoltrClient(connection);
// Reference vault and asset
const vault = new PublicKey("your-vault-address");
const vaultAssetMint = new PublicKey("your-asset-mint");Depositing Funds to Strategies
Protocol / Adaptor
Deposit Scripts
1. Account Setup
2. Create Deposit Instruction
3. Send Transaction
Withdrawing Funds from Strategies
Protocol / Adaptor
Withdraw Scripts
1. Account Setup
2. Create Withdrawal Instruction
3. Send Transaction
Best Practices
Troubleshooting
Issue
Solution
Last updated