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

# Running Bots & Scripts

> Automate vault operations for optimal performance

Vault operations are operationally manual unless you automate them yourself.

<Warning>
  Voltr does not provide managed bot hosting. You are responsible for deployment, monitoring, and key management.
</Warning>

## Why Automation Is Needed

| Task                | Why It Needs Automation                                  |
| ------------------- | -------------------------------------------------------- |
| Rebalancing         | Rates and allocations change over time                   |
| Reward claiming     | Unclaimed rewards leave value idle                       |
| Reward swapping     | Claimed rewards often need conversion back to base asset |
| Position monitoring | Strategy-specific health can degrade without alerts      |
| Fee harvesting      | Accumulated fees should be collected periodically        |

## Where The Building Blocks Live

Every operation your automation needs — strategy init, allocation, reward claiming, fee harvesting — ships in one repository, [`sdk-scripts`](https://github.com/voltrxyz/sdk-scripts). You can drive it two ways:

* **Shell out to the CLI** (`pnpm cli -- <group>:<action> --mode execute`) from a cron job or scheduler — the simplest path for periodic rebalancing and claims. See [CLI & Scripts](/vault-owners/operations/cli-and-scripts).
* **Import the operation builders** into a long-running service or bot. The [`examples/`](https://github.com/voltrxyz/sdk-scripts/tree/main/examples) directory has one runnable file per action showing how to build a `BuiltOperation` and route it through the shared transaction processor.

For lower-level reads and custom instruction building, the underlying [`@voltr/vault-sdk`](/developers/sdk-reference) is also available directly — the shape below uses it.

## Basic Script Shape

```typescript theme={null}
import { createKeyPairSignerFromBytes, createSolanaRpc } from "@solana/kit";
import {
  fetchVault,
  getPositionAndTotalValuesForVault,
} from "@voltr/vault-sdk";

async function main() {
  const rpc = createSolanaRpc(process.env.RPC_URL!);
  const managerSigner = await createKeyPairSignerFromBytes(
    Uint8Array.from(JSON.parse(process.env.MANAGER_KEY!))
  );

  const vaultAccount = await fetchVault(rpc, vaultAddress);
  const positions = await getPositionAndTotalValuesForVault(rpc, vaultAddress);

  // 1. Read idle and deployed balances
  // 2. Pull strategy-side data
  // 3. Decide on reallocations
  // 4. Build strategy deposit/withdraw instructions

  console.log(vaultAccount.data.asset.totalValue, positions.strategies.length);
}

main().catch(console.error);
```

## Operational Requirements

* keep manager and admin wallets funded with SOL
* add retries and alerting
* respect RPC limits
* make scripts idempotent where possible
* keep signing keys isolated from application code
