Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Swap Solana Tokens Check Balances

BSecurity

Swap tokens on Solana via Jupiter aggregator and check wallet balances. Use when user wants to swap tokens, check SOL/token balance, or get swap quotes.

19 stars
0 votes
0 copies
1 views
Added 9/19/2026
ai-agentsgobashnodeapi

Works with

cliapi

Security Analysis

B88/100
criticalSends environment variables or credentials to an external URL

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add rondoflow/rondoflow --skill swap-solana-tokens-check-balances --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Swap Solana Tokens Check Balances?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Swap Solana Tokens Check Balances
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/rondoflow-swap-solana-tokens-check-balances/badge)](https://www.skillsdirectory.com/skills/rondoflow-swap-solana-tokens-check-balances)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: swap-solana-tokens-check-balances
description: "Swap tokens on Solana via Jupiter aggregator and check wallet balances. Use when user wants to swap tokens, check SOL/token balance, or get swap quotes."
category: "Finance & Crypto"
author: community
version: "0.1.0"
icon: coins
---

# Solana Swaps

Manage your Solana wallet: check balances and swap tokens using the Jupiter aggregator.

## Environment Variables

These environment variables are pre-configured and available for use:

| Variable | Description |
|----------|-------------|
| `SOLANA_KEYPAIR_PATH` | Path to wallet keypair JSON file |
| `JUPITER_API_KEY` | Jupiter API key for authenticated requests (avoids platform fees, required for Token2022/pump.fun tokens) |

**Note:** These are already set in the skill config. Just use `$SOLANA_KEYPAIR_PATH` and `$JUPITER_API_KEY` directly in commands.

### Verify Setup

```bash
# Check wallet address
solana address --keypair "$SOLANA_KEYPAIR_PATH"

# Check Solana CLI config
solana config get
```

## Balance Checking

### Check SOL Balance

```bash
solana balance --keypair "$SOLANA_KEYPAIR_PATH"
```

### List All Token Accounts

```bash
spl-token accounts --owner $(solana address --keypair "$SOLANA_KEYPAIR_PATH")
```

### Check Specific Token Balance

```bash
spl-token balance <TOKEN_MINT_ADDRESS> --owner $(solana address --keypair "$SOLANA_KEYPAIR_PATH")
```

## Common Token Mint Addresses

| Token | Symbol | Mint Address | Decimals |
|-------|--------|-------------|----------|
| Wrapped SOL | SOL | So11111111111111111111111111111111111111112 | 9 |
| USD Coin | USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | 6 |
| Tether | USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | 6 |
| Bonk | BONK | DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 | 5 |
| Jupiter | JUP | JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN | 6 |
| Raydium | RAY | 4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R | 6 |

## Token Swaps via Jupiter

**CRITICAL: Always display swap details and wait for explicit user confirmation before executing any swap.**

### Step 1: Get Quote

Convert human-readable amounts to raw units:
- SOL: multiply by 1,000,000,000 (10^9)
- USDC/USDT: multiply by 1,000,000 (10^6)
- BONK: multiply by 100,000 (10^5)

```bash
# Example: Get quote for swapping 1 SOL to USDC
INPUT_MINT="So11111111111111111111111111111111111111112"
OUTPUT_MINT="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
AMOUNT="1000000000"  # 1 SOL in lamports
SLIPPAGE_BPS="50"    # 0.5% slippage

# Get quote with API key authentication
curl -s -H "x-api-key: $JUPITER_API_KEY" \
  "https://api.jup.ag/swap/v1/quote?inputMint=${INPUT_MINT}&outputMint=${OUTPUT_MINT}&amount=${AMOUNT}&slippageBps=${SLIPPAGE_BPS}" | jq .
```

### Step 2: Display Quote and Request Confirmation

Parse the quote response and display to user:
- Input: amount and token name
- Output: expected amount and token name
- Price impact percentage
- Slippage tolerance
- Minimum received (otherAmountThreshold)

**IMPORTANT**: Ask user "Do you want to proceed with this swap?" and wait for explicit confirmation ("yes", "proceed", "confirm") before continuing.

### Step 3: Build Swap Transaction

After user confirms, request the swap transaction:

```bash
USER_PUBKEY=$(solana address --keypair "$SOLANA_KEYPAIR_PATH")

# Save quote response to file
QUOTE_FILE="/tmp/jupiter_quote.json"
curl -s -H "x-api-key: $JUPITER_API_KEY" \
  "https://api.jup.ag/swap/v1/quote?inputMint=${INPUT_MINT}&outputMint=${OUTPUT_MINT}&amount=${AMOUNT}&slippageBps=${SLIPPAGE_BPS}" > "$QUOTE_FILE"

# Request swap transaction
curl -s -X POST \
  -H "x-api-key: $JUPITER_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.jup.ag/swap/v1/swap" \
  -d "{
    \"quoteResponse\": $(cat $QUOTE_FILE),
    \"userPublicKey\": \"${USER_PUBKEY}\",
    \"dynamicComputeUnitLimit\": true,
    \"prioritizationFeeLamports\": {
      \"priorityLevelWithMaxLamports\": {
        \"maxLamports\": 5000000,
        \"priorityLevel\": \"high\"
      }
    }
  }" > /tmp/jupiter_swap.json

# Extract the swap transaction
SWAP_TX=$(cat /tmp/jupiter_swap.json | jq -r '.swapTransaction')
```

### Step 4: Sign and Submit Transaction

Use the jupiter-swap.mjs script to sign and submit:

```bash
node "$(dirname "$0")/scripts/jupiter-swap.mjs" \
  --keypair "$SOLANA_KEYPAIR_PATH" \
  --transaction "$SWAP_TX"
```

The script will output the transaction signature and a Solscan link.

## Safety Rules

1. **ALWAYS** display swap details and wait for user confirmation before executing
2. **NEVER** execute swaps automatically without explicit approval
3. **ALWAYS** check balance before attempting swaps to ensure sufficient funds
4. **WARN** users if price impact exceeds 1%
5. **WARN** users if slippage is set above 1% (100 bps)
6. **NEVER** log, display, or transmit private key contents

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| "Insufficient balance" | Not enough input tokens | Check balance, reduce swap amount |
| "Slippage tolerance exceeded" | Price moved during swap | Get fresh quote, consider higher slippage |
| "Transaction expired" | Blockhash too old | Get fresh quote and retry immediately |
| "Account not found" | Missing token account | Token account will be created automatically |
| "Route not found" | No liquidity for pair | Try smaller amount or different token |
| "Platform fee not supported" | Token2022 tokens block platform fees | Use authenticated API with $JUPITER_API_KEY header |

### Retry Logic

If a swap fails due to network issues:
1. Wait 2-3 seconds
2. Get a fresh quote (prices may have changed)
3. Re-confirm with user showing new quote
4. Retry the swap

## Example Interactions

### Check Balance
User: "What's my SOL balance?"
1. Run: `solana balance --keypair "$SOLANA_KEYPAIR_PATH"`
2. Report: "Your wallet has X.XXX SOL"

### Swap Tokens
User: "Swap 0.5 SOL for USDC"
1. Get wallet address
2. Fetch Jupiter quote for 0.5 SOL (500000000 lamports) -> USDC
3. Display quote details:
   - From: 0.5 SOL
   - To: ~XX.XX USDC (estimated)
   - Price Impact: X.XX%
   - Minimum Received: XX.XX USDC
4. Ask: "Do you want to proceed with this swap?"
5. Wait for confirmation
6. On "yes": Execute swap, report transaction link
7. On "no": Acknowledge cancellation

### List All Tokens
User: "Show me all my tokens"
1. Run: `spl-token accounts --owner $(solana address --keypair "$SOLANA_KEYPAIR_PATH")`
2. Format and display token list with balances

Attribution

rondoflowrondoflow
View sourceMore from rondoflow →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

693621 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →