> ## Documentation Index
> Fetch the complete documentation index at: https://pessoal-86816071.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocol Testing

> Operator runbook for validating Drift and Kamino before attempting full vault execution.

# Protocol Testing

The safest order is:

1. diagnose env and RPC
2. build bundles
3. send one direct protocol transaction
4. only then involve the vault

## Step 1. Diagnose runtime

```bash theme={null}
node --experimental-strip-types services/ranger/src/doctor.ts
```

Look for:

* RPC URLs present
* owner addresses matching local signers
* wallet balances greater than `0 SOL`
* program executable on the configured cluster

## Step 2. Validate Drift bundle construction

```bash theme={null}
DRIFT_SMOKE_MODE=deposit node --experimental-strip-types services/ranger/src/drift-smoke.ts
```

Expected:

* `executionSource: "drift-sdk"`
* `instructionEnvelopes` present

Use `deposit` before `withdraw`.

## Step 3. Validate Kamino bundle construction

```bash theme={null}
node --experimental-strip-types services/ranger/src/kamino-smoke.ts
```

Expected:

* `executionSource: "kamino-sdk"`
* `instructionEnvelopes` present

## Step 4. Send a real Drift transaction without the vault

```bash theme={null}
node --experimental-strip-types services/ranger/src/drift-live-send.ts
```

This is the cleanest first live transaction because it removes the vault from the equation.

## Step 5. Bring in the vault

After protocol paths are working:

* bootstrap the vault
* inspect state
* run a vault user deposit
* run a rebalance

## Common errors

### Drift withdraw requires an existing user account

You attempted `withdraw` before doing a real `deposit`.

### Program not executable

`VAULT_PROGRAM_ID` is still a placeholder or belongs to the wrong cluster.

### Attempt to debit an account but found no prior credit

The signer exists, but it does not have SOL yet.
