Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
agiprolabs avatar

Dex Execution

  • 190 installs
  • 257 repo stars
  • Updated June 24, 2026
  • agiprolabs/claude-trading-skills

dex-execution is a Claude Code skill for Solana DEX swap execution via the Jupiter aggregator, covering quoting, transaction building, signing, and confirmation.

About

dex-execution is a Claude Code skill for executing Solana token swaps through the Jupiter v6 aggregator, which routes across Raydium, Orca, Meteora, and 20+ venues. It defines a seven-step pipeline covering quoting, user confirmation, transaction building, signing, submission, and confirmation. A developer uses it when building on-chain swap execution into a trading agent. It gives slippage and priority-fee ranges by token type and requires explicit user confirmation before any swap.

  • Seven-step Jupiter v6 swap pipeline: quote, display, confirm, build, sign, submit, confirm
  • Slippage and priority-fee guidance per token type, from majors to new launches
  • Mandates explicit user confirmation before submitting any swap

Dex Execution by the numbers

  • 190 all-time installs (skills.sh)
  • Ranked #486 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

dex-execution capabilities & compatibility

Needs a funded Solana wallet and RPC URL; Jupiter quote/swap endpoints are free but on-chain gas and priority fees apply.

Capabilities
dex execution · swap quoting · transaction signing · slippage control · trade confirmation
Use cases
trading · orchestration
Runs
Runs locally
Pricing
Bring your own API key
From the docs

What dex-execution says it does

Execute token swaps on Solana through Jupiter, the dominant DEX aggregator routing across Raydium, Orca, Meteora, Phoenix, Lifinity, and 20+ other venues.
SKILL.md
**NEVER proceed without explicit "yes" from the user.**
SKILL.md
Every swap follows this seven-step pipeline. Never skip steps 2-3 (display and confirm).
SKILL.md
npx skills add https://github.com/agiprolabs/claude-trading-skills --skill dex-execution

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs190
repo stars257
Last updatedJune 24, 2026
Repositoryagiprolabs/claude-trading-skills

What it does

Execute Solana token swaps via the Jupiter aggregator with quoting, signing, and confirmation.

Who is it for?

Executing Solana swaps through Jupiter with proper slippage, priority fees, and confirmation flow.

Skip if: Skipping the display-and-confirm steps; the skill mandates explicit user confirmation before any swap.

When should I use this skill?

You need to quote and execute a Solana token swap through Jupiter inside an agent.

What you get

A quoted, user-confirmed swap signed and submitted through Jupiter with confirmation polling.

By the numbers

  • Seven-step swap pipeline
  • Jupiter routes across 20+ DEX venues
  • Slippage ranges 0.5% to 30% by token type

Files

SKILL.mdMarkdownGitHub ↗

DEX Execution — Solana Swap Execution via Jupiter

Execute token swaps on Solana through Jupiter, the dominant DEX aggregator routing across Raydium, Orca, Meteora, Phoenix, Lifinity, and 20+ other venues.

Overview

Jupiter aggregates liquidity across all major Solana DEXes to find optimal swap routes. A single swap may split across multiple pools and hop through intermediate tokens to minimize price impact. The Jupiter v6 API handles route discovery, transaction building, and fee optimization — your code handles quoting, user confirmation, signing, and submission.

Base URL: https://quote-api.jup.ag/v6

Execution Pipeline

Every swap follows this seven-step pipeline. Never skip steps 2-3 (display and confirm).

Step 1 — Get Quote

import httpx

params = {
    "inputMint": "So11111111111111111111111111111111111111112",   # SOL
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC
    "amount": 1_000_000_000,  # 1 SOL in lamports
    "slippageBps": 50,        # 0.5%
}
resp = httpx.get("https://quote-api.jup.ag/v6/quote", params=params)
quote = resp.json()

Step 2 — Display Quote to User

Always show these fields before proceeding:

FieldSource
Input amountquote["inAmount"] (in token decimals)
Output amountquote["outAmount"]
Minimum receivedquote["otherAmountThreshold"]
Price impactquote["priceImpactPct"]
Routequote["routePlan"] — DEXes used
SlippageThe slippageBps you requested

Step 3 — Require User Confirmation

⚠️  SWAP PREVIEW
    Selling:   1.000 SOL
    Buying:    ~142.50 USDC
    Min recv:  141.79 USDC (0.5% slippage)
    Impact:    0.01%
    Route:     Raydium V4 → USDC

    Proceed? [y/N]

NEVER proceed without explicit "yes" from the user.

Step 4 — Build Transaction

swap_body = {
    "quoteResponse": quote,
    "userPublicKey": "YourPubkeyBase58...",
    "wrapAndUnwrapSol": True,
    "dynamicComputeUnitLimit": True,
    "prioritizationFeeLamports": "auto",
}
resp = httpx.post("https://quote-api.jup.ag/v6/swap", json=swap_body)
swap_data = resp.json()
swap_tx = swap_data["swapTransaction"]  # base64-encoded transaction

Step 5 — Sign Transaction

import base64
from solders.transaction import VersionedTransaction
from solders.keypair import Keypair

raw_tx = base64.b64decode(swap_tx)
tx = VersionedTransaction.from_bytes(raw_tx)
keypair = Keypair.from_base58_string(os.environ["WALLET_PRIVATE_KEY"])
tx.sign([keypair])

Step 6 — Submit Transaction

rpc_url = os.environ.get("SOLANA_RPC_URL", "https://api.mainnet-beta.solana.com")
signed_bytes = bytes(tx)
payload = {
    "jsonrpc": "2.0", "id": 1,
    "method": "sendTransaction",
    "params": [
        base64.b64encode(signed_bytes).decode(),
        {"encoding": "base64", "skipPreflight": False,
         "maxRetries": 3, "preflightCommitment": "confirmed"}
    ],
}
resp = httpx.post(rpc_url, json=payload)
sig = resp.json()["result"]
print(f"Submitted: https://solscan.io/tx/{sig}")

Step 7 — Confirm Transaction

import time

for attempt in range(30):
    payload = {
        "jsonrpc": "2.0", "id": 1,
        "method": "getSignatureStatuses",
        "params": [[sig], {"searchTransactionHistory": False}],
    }
    resp = httpx.post(rpc_url, json=payload)
    status = resp.json()["result"]["value"][0]
    if status and status.get("confirmationStatus") in ("confirmed", "finalized"):
        print(f"Confirmed at slot {status['slot']}")
        break
    time.sleep(2)
else:
    print("Transaction not confirmed within 60s — check explorer")

Jupiter API v6 Endpoints

EndpointMethodPurpose
/quoteGETGet best-price quote with routing
/swapPOSTBuild a swap transaction from a quote
/swap-instructionsPOSTGet individual instructions (advanced)
/price?ids=token1,token2GETSimple price lookup (v2)
/tokensGETList all supported tokens

See references/jupiter_api.md for full parameter and response documentation.

Key Parameters

Slippage (slippageBps)

Token TypeRecommended RangeNotes
SOL, USDC, major tokens50-100 (0.5-1%)Stable liquidity
Mid-cap tokens100-300 (1-3%)Variable liquidity
PumpFun / meme tokens500-2000 (5-20%)Thin books, high volatility
New launches (<1h old)1000-3000 (10-30%)Extreme volatility

Dynamic Slippage

Set dynamicSlippage: true in the swap request to let Jupiter auto-adjust slippage based on current market conditions. Preferred for most use cases.

Priority Fees (prioritizationFeeLamports)

Priority fees determine transaction ordering within a block.

LevelmicroLamportsWhen to Use
Low10,000-50,000Normal conditions
Medium50,000-200,000Moderate congestion
High200,000-1,000,000High congestion / time-sensitive
Urgent1,000,000-5,000,000Meme coin launches, NFT mints
Auto"auto"Jupiter estimates for you

Use "auto" for most cases. For fine-grained control, query Helius getPriorityFeeEstimate.

Other Parameters

  • `onlyDirectRoutes`: Skip multi-hop routing. Faster but may get worse price.
  • `asLegacyTransaction`: Use legacy format instead of versioned transactions. Required for some older wallets.
  • `maxAccounts`: Limit accounts in transaction (default 64). Lower values reduce route options but improve confirmation reliability.
  • `platformFeeBps`: Integrator fee in basis points. Taken from output amount.
  • `wrapAndUnwrapSol`: Auto wrap/unwrap SOL ↔ wSOL (default true).
  • `dynamicComputeUnitLimit`: Auto-set compute budget based on simulation.

Priority Fee Estimation

# Using Helius getPriorityFeeEstimate
helius_url = f"https://mainnet.helius-rpc.com/?api-key={HELIUS_KEY}"
payload = {
    "jsonrpc": "2.0", "id": 1,
    "method": "getPriorityFeeEstimate",
    "params": [{"accountKeys": [input_mint, output_mint],
                "options": {"recommended": True}}],
}
resp = httpx.post(helius_url, json=payload)
fee = resp.json()["result"]["priorityFeeEstimate"]

Transaction Confirmation Strategy

See references/transaction_lifecycle.md for the full Solana transaction lifecycle.

1. Submit with skipPreflight: False to catch obvious errors 2. Poll getSignatureStatuses every 2 seconds for up to 60 seconds 3. If not confirmed: rebuild transaction with fresh blockhash and retry (max 3 attempts) 4. Blockhash expiry: transactions expire ~60 seconds after blockhash was fetched 5. Final check: verify token balance changed as expected

Error Handling

ErrorCauseRecovery
"Slippage tolerance exceeded"Price moved beyond slippageBpsIncrease slippage or retry
"Insufficient funds"Not enough input token or SOL for feesCheck balance before quoting
"Transaction expired"Blockhash too oldRebuild with fresh blockhash
"Transaction simulation failed"Various — check logsParse simulation logs for root cause
"Too many accounts"Route uses too many accountsSet maxAccounts lower or use onlyDirectRoutes
HTTP 429Rate limitedBack off and retry with exponential delay
HTTP 400 "No route found"No liquidity path existsCheck token mints are correct, try larger slippage

Safety Requirements

These are non-negotiable requirements for any execution code.

1. ALWAYS show quote details (amounts, price impact, route) before execution 2. ALWAYS require explicit user confirmation — never auto-execute 3. Default to simulation mode — do not sign or submit unless explicitly enabled 4. Never store or log private keys — load from env vars, use immediately, discard 5. Never use 100% slippage — this is a common scam/exploit vector 6. Verify token addresses — confirm mints match expected tokens before swapping 7. Check price impact — warn if >2%, block if >10% unless user overrides 8. Maintain SOL reserve — keep 0.05 SOL minimum for rent and future fees

See references/safety_checklist.md for the complete pre/during/post execution checklist.

Integration with Other Skills

SkillIntegration
slippage-modelingEstimate optimal slippageBps based on token liquidity profile
liquidity-analysisVerify pool depth supports trade size before quoting
position-sizingCalculate trade amount based on risk parameters
risk-managementEnforce portfolio-level exposure limits before execution
jupiter-apiUnderlying API documentation for Jupiter endpoints
helius-apiPriority fee estimation and transaction monitoring

Files

References

  • references/jupiter_api.md — Complete Jupiter v6 API parameter and response reference
  • references/transaction_lifecycle.md — Solana transaction lifecycle, priority fees, retry strategies
  • references/safety_checklist.md — Pre/during/post execution verification checklist

Scripts

  • scripts/get_quote.py — Fetch and display Jupiter swap quotes with route analysis
  • scripts/simulate_swap.py — Build and simulate swap transactions without submitting

Related skills

FAQ

Which venues does Jupiter route across?

Raydium, Orca, Meteora, Phoenix, Lifinity, and 20+ other Solana DEXes, sometimes splitting a swap across pools.

What slippage is recommended?

0.5-1% for majors, 1-3% for mid-caps, 5-20% for PumpFun/meme tokens, and 10-30% for launches under an hour old.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.