agiprolabs/claude-trading-skills/dex-execution
Claude Code and agent skill by agiprolabs/claude-trading-skills
- community
Checking that the SKILL.md file is still in the repository.
Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation
Install
npx vskill@latest install agiprolabs/claude-trading-skills/dex-executionSKILL.md
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
Step 2 — Display Quote to User
Always show these fields before proceeding:
| Field | Source | |
|---|---|---|
| Input amount | quote["inAmount"] (in token decimals) | |
| Output amount | quote["outAmount"] | |
| Minimum received | quote["otherAmountThreshold"] | |
| Price impact | quote["priceImpactPct"] | |
| Route | quote["routePlan"] — DEXes used | |
| Slippage | The slippageBps you requested |
Step 3 — Require User Confirmation
NEVER proceed without explicit "yes" from the user.
Step 4 — Build Transaction
Step 5 — Sign Transaction
Step 6 — Submit Transaction
Step 7 — Confirm Transaction
Jupiter API v6 Endpoints
| Endpoint | Method | Purpose | |
|---|---|---|---|
/quote | GET | Get best-price quote with routing | |
/swap | POST | Build a swap transaction from a quote | |
/swap-instructions | POST | Get individual instructions (advanced) | |
/price?ids=token1,token2 | GET | Simple price lookup (v2) | |
/tokens | GET | List all supported tokens |
See references/jupiter_api.md for full parameter and response documentation.
Key Parameters
Slippage (slippageBps)
| Token Type | Recommended Range | Notes | |
|---|---|---|---|
| SOL, USDC, major tokens | 50-100 (0.5-1%) | Stable liquidity | |
| Mid-cap tokens | 100-300 (1-3%) | Variable liquidity | |
| PumpFun / meme tokens | 500-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.
| Level | microLamports | When to Use | |
|---|---|---|---|
| Low | 10,000-50,000 | Normal conditions | |
| Medium | 50,000-200,000 | Moderate congestion | |
| High | 200,000-1,000,000 | High congestion / time-sensitive | |
| Urgent | 1,000,000-5,000,000 | Meme 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
Transaction Confirmation Strategy
See references/transaction_lifecycle.md for the full Solana transaction lifecycle.
- Submit with
skipPreflight: Falseto catch obvious errors - Poll
getSignatureStatusesevery 2 seconds for up to 60 seconds - If not confirmed: rebuild transaction with fresh blockhash and retry (max 3 attempts)
- Blockhash expiry: transactions expire ~60 seconds after blockhash was fetched
- Final check: verify token balance changed as expected
Error Handling
| Error | Cause | Recovery | |
|---|---|---|---|
"Slippage tolerance exceeded" | Price moved beyond slippageBps | Increase slippage or retry | |
"Insufficient funds" | Not enough input token or SOL for fees | Check balance before quoting | |
"Transaction expired" | Blockhash too old | Rebuild with fresh blockhash | |
"Transaction simulation failed" | Various — check logs | Parse simulation logs for root cause | |
"Too many accounts" | Route uses too many accounts | Set maxAccounts lower or use onlyDirectRoutes | |
| HTTP 429 | Rate limited | Back off and retry with exponential delay | |
HTTP 400 "No route found" | No liquidity path exists | Check token mints are correct, try larger slippage |
Safety Requirements
These are non-negotiable requirements for any execution code.
- ALWAYS show quote details (amounts, price impact, route) before execution
- ALWAYS require explicit user confirmation — never auto-execute
- Default to simulation mode — do not sign or submit unless explicitly enabled
- Never store or log private keys — load from env vars, use immediately, discard
- Never use 100% slippage — this is a common scam/exploit vector
- Verify token addresses — confirm mints match expected tokens before swapping
- Check price impact — warn if >2%, block if >10% unless user overrides
- 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
| Skill | Integration | |
|---|---|---|
slippage-modeling | Estimate optimal slippageBps based on token liquidity profile | |
liquidity-analysis | Verify pool depth supports trade size before quoting | |
position-sizing | Calculate trade amount based on risk parameters | |
risk-management | Enforce portfolio-level exposure limits before execution | |
jupiter-api | Underlying API documentation for Jupiter endpoints | |
helius-api | Priority fee estimation and transaction monitoring |
Files
References
references/jupiter_api.md— Complete Jupiter v6 API parameter and response referencereferences/transaction_lifecycle.md— Solana transaction lifecycle, priority fees, retry strategiesreferences/safety_checklist.md— Pre/during/post execution verification checklist
Scripts
scripts/get_quote.py— Fetch and display Jupiter swap quotes with route analysisscripts/simulate_swap.py— Build and simulate swap transactions without submitting
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dex-execution/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 30 Oct 2026, yesterday.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/agiprolabs/claude-trading-skills/dex-execution)