Agent skill

Dex Execution

by agiprolabs in agiprolabs/claude-trading-skills

Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation

MITAuto-check passed

Install Dex Execution

skills CLI
$ npx skills add agiprolabs/claude-trading-skills --skill dex-execution -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agiprolabs/claude-trading-skills dex-execution --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dex-execution .claude/skills/dex-execution && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dex-execution
GitHub stars
410
Token cost
~2.4k tokens
SKILL.md length
770 words
Files
6 (incl. scripts, references)
Skills in repo
68
Repo updated
First seen
Licence
MIT

At a glance

Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation

  • Works in 7 steps: Get Quote → Display Quote to User → Require User Confirmation → …
  • SKILL.md covers Overview, Execution Pipeline, Jupiter API v6 Endpoints and Key Parameters, plus 6 more sections
  • Runs Python scripts from its folder; reaches quote-api.jup.ag and api.mainnet-beta.solana.com; needs WALLET_PRIVATE_KEY and HELIUS_KEY

What it does

Dex Execution is an agent skill from agiprolabs/claude-trading-skills. Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `references/jupiter_api.md`, `references/safety_checklist.md` and `references/transaction_lifecycle.md`).

It works with Solana. The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.

Example prompts

  • “/dex-execution”

Requirements

  • Python 3
  • A credential in WALLET_PRIVATE_KEY
  • A credential in HELIUS_KEY

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Get Quote
  2. Display Quote to User
  3. Require User Confirmation
  4. Build Transaction
  5. Sign Transaction
  6. Submit Transaction
  7. Confirm Transaction

What it can do on your machine

Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • quote-api.jup.ag
    • api.mainnet-beta.solana.com
    • solscan.io
    • mainnet.helius-rpc.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • WALLET_PRIVATE_KEY
    • HELIUS_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dex Execution loads about 2.4k tokens when it runs, and up to ~7.9k if it reads all its reference files. Until then it costs about 32 tokens; SKILL.md has 770 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 770 words, ~2,365 tokens.

Download SKILL.mdSave it as .claude/skills/dex-execution/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
dex-execution
description
Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation

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
python
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
python
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
python
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
python
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
python
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

python
# 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
Show full SKILL.md (301 more words)Show less

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

© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/dex-execution of agiprolabs/claude-trading-skills.

  • SKILL.md
  • references/jupiter_api.md
  • references/safety_checklist.md
  • references/transaction_lifecycle.md
  • scripts/get_quote.py
  • scripts/simulate_swap.py

Open the folder on GitHubat commit 981e1d7

Compare with similar skills

Dex Execution next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dex Execution compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dex Execution this skillagiprolabs/claude-trading-skills410—~2.4kAutomated safety check: PassMIT
Minara Crypto Trading and WalletMinara-AI/minara-skills3581 repos~5.7kAutomated safety check: PassNone
NEAR Intents Swap Integrationinternet-court/internet-court-skill6.4k2 repos~939Automated safety check: PassCustom licence
Solana Devsolana-foundation/solana-dev-skill574—~3.8kAutomated safety check: PassMIT
Meme Coin Security Auditawarexone/Agentic-Bug-Hunter5.3k1 repos~2.4kAutomated safety check: PassMIT
Swapper Depositswapperfinance/swapper-toolkit852—~1.8kAutomated safety check: PassMIT

Similar skills

  • Minara Crypto Trading and Wallet

    Minara-AI/minara-skills

    Drives the Minara CLI for crypto swaps, perps, limit orders, wallet transfers, deposits and withdrawals, plus AI market analysis.

    358 GitHub starsUsed in 1 repo~5.7k tokens
    Business, Finance & HRAuto-check passed
  • NEAR Intents Swap Integration

    internet-court/internet-court-skill

    Builds cross-chain token swaps and bridge flows with the NEAR Intents 1Click API: quotes, deposit addresses, per-chain deposits and status polling.

    6.4k GitHub starsUsed in 2 repos~939 tokens
    Backend & APIsAuto-check passed
  • Solana Dev

    solana-foundation/solana-dev-skill

    A skill your agent uses when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my…

    574 GitHub stars~3.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Meme Coin Security Audit

    awarexone/Agentic-Bug-Hunter

    Screens EVM and Solana meme coins for rug pull signs such as hidden mint, honeypot logic and fee tricks, starting with fast kill signals before any code review.

    5.3k GitHub starsUsed in 1 repo~2.4k tokens
    SecurityAuto-check passed
  • Swapper Deposit

    swapperfinance/swapper-toolkit

    Deposit and bridge funds into a wallet or protocol using Swapper Finance.

    852 GitHub stars~1.8k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • PNP Prediction Markets on Solana

    internet-court/internet-court-skill

    Creates, trades and settles permissionless prediction markets on Solana with any SPL token as collateral, including social-media and custom-oracle markets.

    6.4k GitHub stars~7.5k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check: notes

More from agiprolabs/claude-trading-skills

All 68 skills in this repo
  • Backtrader

    agiprolabs/claude-trading-skills

    Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Birdeye API

    agiprolabs/claude-trading-skills

    Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity

    410 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Coingecko API

    agiprolabs/claude-trading-skills

    Broad crypto market data from CoinGecko covering 13,000+ tokens.

    410 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Cointegration Analysis

    agiprolabs/claude-trading-skills

    Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis

    410 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Copy Trading

    agiprolabs/claude-trading-skills

    Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Correlation Analysis

    agiprolabs/claude-trading-skills

    Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Dex Execution

What does Dex Execution do?

Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation. Dex Execution is an agent skill from agiprolabs/claude-trading-skills.

How do I install Dex Execution in Claude Code?

Run `npx skills add agiprolabs/claude-trading-skills --skill dex-execution -a claude-code`. Or copy the skill folder (skills/dex-execution in agiprolabs/claude-trading-skills) into .claude/skills/dex-execution in your project. Claude Code loads it when a task matches its description.

How do I install Dex Execution in Codex?

Run `npx skills add agiprolabs/claude-trading-skills --skill dex-execution -a codex`. Or copy the skill folder (skills/dex-execution in agiprolabs/claude-trading-skills) into .agents/skills/dex-execution in your project. Codex loads it when a task matches its description.

Can I use Dex Execution in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill dex-execution -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dex-execution, .gemini/skills/dex-execution, .github/skills/dex-execution and .opencode/skills/dex-execution in your project.

What does Dex Execution need to run?

Going by SKILL.md and its folder, Dex Execution needs Python for the scripts in its folder and credentials named WALLET_PRIVATE_KEY and HELIUS_KEY. Our summary lists: Python 3; A credential in WALLET_PRIVATE_KEY; A credential in HELIUS_KEY.

Does Dex Execution access the network?

SKILL.md names 4 domains. In commands or code: quote-api.jup.ag, api.mainnet-beta.solana.com, solscan.io and mainnet.helius-rpc.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Dex Execution safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Dex Execution use?

Dex Execution is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dex Execution use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.

What are the alternatives to Dex Execution?

Skills that share tags, products or a category with Dex Execution: Minara Crypto Trading and Wallet (Minara-AI/minara-skills, 358 stars), NEAR Intents Swap Integration (internet-court/internet-court-skill, 6.4k stars), Solana Dev (solana-foundation/solana-dev-skill, 574 stars) and Meme Coin Security Audit (awarexone/Agentic-Bug-Hunter, 5.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dex Execution?

agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.

Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.