Configure the policies
Use a loadedvault, connection, and manager Keypair. Select the market and reserve from the SDK’s published catalog. KaminoMarket.MAIN identifies Kamino’s SOL/BTC market in this SDK.
allowedDepositMints applies to all four actions. Omitting a filter or passing an empty list removes that restriction. Include every reserve/mint needed by your strategy.
New lending accounts require a separate initialization policy. Build it with public constraint helpers:
addActions steps or sync calls so each execution matches one policy. Leave policyPda omitted for automatic matching.
Prepare the lending accounts
The Squads owner needs Kamino user metadata and an obligation for the selected lending market. Initialize missing accounts once:autoManagePositions: false for explicit initialization, then register the obligation through a proposal; default automatic registration requires zero AUM. The transaction builder can prepare missing accounts automatically when the corresponding policies are installed.
Register the obligation before allocating to it, unless the zero-AUM automatic setup already registered it. The sync tab below shows registration for a newly initialized, empty obligation. New obligation registration on a funded vault requires a proposal.
Pre-register intended reserve price/farm mappings with vault.ixRegisterKaminoObligationReserve({ authority: manager.publicKey, obligation, reserve: reserve.pubkey }). Confirm each update, refresh AUM, and reload before building the lending action. This avoids relying on first-use mapping updates during policy execution. Price paths must cover both collateral and debt; an existing obligation also needs mappings for its current reserves.
Deposit, borrow, and repay
This deposits 1 SOL as collateral. Amounts use the underlying token’s smallest units; the SDK resolves the collateral-token accounting.- Transaction builder
- Sync helpers
build() returns an execution plan: ordered transactionSets containing instructions, additional signers, and lookup table addresses. The builder schedules supported setup and refreshes; send() simulates and submits the sequence.Withdraw collateral or manage debt
Discover asset keys with
Object.keys(KAMINO_RESERVES[market]); choose the reserve from that market rather than reusing a key from another market. SOL uses the vault’s wrapped-SOL token account; arrange its funding before allocation and keep it tracked like other token accounts.