> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ranger.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Fund Allocation

> Deposit and withdraw funds between the vault and strategies

This guide explains how to use the Ranger Earn SDK to deposit and withdraw funds between the vault's idle account and strategies.

The generic Voltr side uses:

* `getDepositStrategyInstructionAsync`
* `getWithdrawStrategyInstructionAsync`

The protocol side determines:

* strategy address derivation
* required ATAs and protocol accounts
* any remaining accounts needed by the adaptor

## Deposit To A Strategy

```typescript theme={null}
import { getDepositStrategyInstructionAsync } from "@voltr/vault-sdk";

const depositIx = await getDepositStrategyInstructionAsync({
  manager: managerSigner,
  vault: vaultAddress,
  vaultAssetMint: assetMintAddress,
  assetTokenProgram,
  strategy: strategyAddress,
  depositAmount: 1_000_000n,
  adaptorProgram,
  remainingAccounts: [
    // protocol-specific accounts
  ],
});
```

## Withdraw From A Strategy

```typescript theme={null}
import { getWithdrawStrategyInstructionAsync } from "@voltr/vault-sdk";

const withdrawIx = await getWithdrawStrategyInstructionAsync({
  manager: managerSigner,
  vault: vaultAddress,
  vaultAssetMint: assetMintAddress,
  assetTokenProgram,
  strategy: strategyAddress,
  withdrawAmount: 500_000n,
  adaptorProgram,
  remainingAccounts: [
    // protocol-specific accounts
  ],
});
```

## Operational Notes

* ATAs created for strategy operations are usually a one-time manager-paid rent cost.
* The manager should keep some idle vault liquidity for withdrawals.
* Batch ATA setup and allocation instructions when possible.
* Use the maintained adaptor repos for the exact account wiring.

## Protocol Repositories

| Protocol / Adaptor | Example Repos                                                                                                                                                                                                                   |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Kamino Adaptor     | [Kamino Vault](https://github.com/voltrxyz/kamino-scripts/blob/main/src/scripts/manager-deposit-kvault.ts), [Kamino Lending Market](https://github.com/voltrxyz/kamino-scripts/blob/main/src/scripts/manager-deposit-market.ts) |
| Drift Adaptor      | [Drift Lend](https://github.com/voltrxyz/drift-scripts/blob/main/src/scripts/manager-deposit-earn.ts), [Drift Perps](https://github.com/voltrxyz/drift-scripts/blob/main/src/scripts/manager-deposit-user.ts)                   |
| Jupiter Adaptor    | [Spot via Jupiter Swap](https://github.com/voltrxyz/spot-scripts/blob/main/src/scripts/manager-buy-spot.ts), [Jupiter Lend](https://github.com/voltrxyz/spot-scripts/blob/main/src/scripts/manager-deposit-earn.ts)             |
| Trustful Adaptor   | [Centralised Exchanges](https://github.com/voltrxyz/trustful-scripts/blob/main/src/scripts/manager-deposit-arbitrary.ts)                                                                                                        |
