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

# Jupiter Swap

> Execute token swaps through Jupiter aggregator

Commands for swapping tokens using Jupiter aggregator.

<Note>
  The `JupiterSwap` integration must be enabled before using these commands:

  ```bash theme={null}
  glam-cli integration enable JupiterSwap
  ```
</Note>

## Swap

Swap tokens held in the vault using Jupiter.

* `from`: Source token (mint address or symbol like `SOL`, `USDC`)
* `to`: Destination token (mint address or symbol)
* `amount`: Amount to swap (in source token units)
* `--slippage-bps`, `-s`: Slippage tolerance in basis points (default: 5, which is 0.05%)
* `--max-accounts`, `-m`: Maximum accounts allowed in the swap route
* `--only-direct-routes`, `-d`: Only use direct swap routes
* `--use-v2`: Use Jupiter v2 instruction

```bash theme={null}
glam-cli jupiter swap <from> <to> <amount> [options] [--yes]
```

**Example:** Swap 1 SOL to USDC:

```bash theme={null}
glam-cli jupiter swap SOL USDC 1
```

**Example:** Swap with custom slippage:

```bash theme={null}
glam-cli jupiter swap SOL USDC 1 --slippage-bps 50
```

***

## Policy Management

Jupiter swap policies allow you to restrict which tokens can be swapped and set maximum slippage limits.

### View Policy

View the current Jupiter swap policy for the vault.

```bash theme={null}
glam-cli jupiter view-policy
```

### Set Maximum Slippage

Set the maximum allowed slippage for swaps in basis points.

* `slippage_bps`: Maximum slippage in basis points (e.g., 100 = 1%)

```bash theme={null}
glam-cli jupiter set-max-slippage <slippage_bps> [--yes]
```

### Allowlist Token

Add a token to the swap allowlist. When tokens are allowlisted, swaps are restricted to only those tokens.

```bash theme={null}
glam-cli jupiter allowlist-token <token_mint> [--yes]
```

### Remove Token from Allowlist

Remove a token from the swap allowlist.

```bash theme={null}
glam-cli jupiter remove-token <token_mint> [--yes]
```

### Clear Allowlist

Clear the swap allowlist to allow swapping any token.

```bash theme={null}
glam-cli jupiter clear-allowlist [--yes]
```
