Skip to main content

swap

Swap assets held in the vault using Jupiter DEX.
glam jupiter swap <from> <to> <amount> [options]
from
string
required
Source token mint address or symbol
to
string
required
Destination token mint address or symbol
amount
number
required
Decimal-adjusted UI amount to swap
-m, --max-accounts
number
Specify max accounts allowed in the transaction
-s, --slippage-bps
number
default:"5"
Slippage in basis points (default: 5 = 0.05%)
--use-v1
boolean
default:"false"
Use v1 instruction (default: v2)
-d, --only-direct-routes
boolean
Use only direct routes for the swap
-y, --yes
boolean
default:"false"
Skip confirmation prompt
Examples:
# Swap 100 USDC to SOL with default slippage
glam jupiter swap USDC SOL 100

# Swap with custom slippage
glam jupiter swap USDC SOL 100 -s 10

# Swap using direct routes only
glam jupiter swap USDC SOL 100 -d

# Skip confirmation
glam jupiter swap USDC SOL 100 -y

view-policy

View the current Jupiter swap policy including max slippage and token allowlist.
glam jupiter view-policy
Example output:
Max slippage BPS: 50
Swap allowlist:
[0] EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
[1] So11111111111111111111111111111111111111112

set-max-slippage

Set the maximum allowed slippage for swaps in basis points.
glam jupiter set-max-slippage <slippage_bps> [options]
slippage_bps
number
required
Maximum slippage in basis points (e.g., 50 = 0.5%)
-y, --yes
boolean
default:"false"
Skip confirmation prompt
Examples:
# Set max slippage to 0.5%
glam jupiter set-max-slippage 50

# Set max slippage to 1%
glam jupiter set-max-slippage 100 -y

allowlist-token

Add a token to the swap allowlist.
glam jupiter allowlist-token <token> [options]
token
string
required
Token mint public key
-y, --yes
boolean
default:"false"
Skip confirmation prompt
Examples:
# Add USDC to allowlist
glam jupiter allowlist-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

# Add token without confirmation
glam jupiter allowlist-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v -y

remove-token

Remove a token from the swap allowlist.
glam jupiter remove-token <token> [options]
token
string
required
Token mint public key
-y, --yes
boolean
default:"false"
Skip confirmation prompt
Examples:
# Remove token from allowlist
glam jupiter remove-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

# Remove without confirmation
glam jupiter remove-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v -y

clear-allowlist

Clear the swap allowlist to allow all tokens.
glam jupiter clear-allowlist [options]
-y, --yes
boolean
default:"false"
Skip confirmation prompt
Examples:
# Clear allowlist
glam jupiter clear-allowlist

# Clear without confirmation
glam jupiter clear-allowlist -y

Build docs developers (and LLMs) love