dex-execution
Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation
Skill by Serennity007
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/serennity007-dex-execution
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 5
api.mainnet-beta.solana.com· found in codecodeload.github.com· found in install commandmainnet.helius-rpc.com· found in codeprice.jup.ag· found in codequote-api.jup.ag· found in code
Files it touches
~/.claude/skills/dex-execution
What's inside
- Skill name
dex-execution- Description
- Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation
- License
- MIT
- Instructions
- 250 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- jupiter_api.md · references/
- safety_checklist.md · references/
- transaction_lifecycle.md · references/
- get_quote.py · scripts/
- simulate_swap.py · scripts/
SKILL.md (first lines)
# 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:
| 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
```
⚠️ 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']}")From Serennity007/awesome-stock-quant-skills, MIT.
More from Serennity007/awesome-stock-quant-skills
- 0.618score
dex-pool-analysis
Serennity007
AMM pool mechanics comparison across Raydium, Orca, and Meteora including fee structures, pool types, creation patterns, and volume efficiency
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
cost-basis-engine
agipro
Multi-method cost basis computation including specific identification, FIFO, LIFO, HIFO, and proportional average cost with partial sell handling
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
feature-engineering
Serennity007
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
crypto-tax-export
agipro
Export trade history and tax calculations in formats compatible with Koinly, CoinTracker, CoinLedger, TokenTax, and IRS Form 8949
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
coingecko-api
Serennity007
Broad crypto market data from CoinGecko covering 13,000+ tokens.
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
correlation-analysis
Serennity007
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
custom-indicators
Serennity007
Crypto-native indicators including NVT ratio, exchange flow, funding rate signals, holder momentum, and smart money flow
SkillBFreshness: B★ 41Claude Code +9 - 0.617score
ibkr-options-assistant
Serennity007
Interactive Brokers options & stock trading assistant.
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
birdeye-api
Serennity007
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
cointegration-analysis
Serennity007
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
defillama-api
Serennity007
Free DeFi analytics across all chains — TVL, token prices, DEX volumes, fees/revenue, stablecoins, and bridges
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
dexscreener-api
Serennity007
Free, no-auth multi-chain DEX pair data — prices, volume, liquidity, transactions, and token profiles
SkillBFreshness: B★ 41Claude Code +9
Signals
- Stars
- 41
- Forks
- 8
- Open issues
- 1
- Last commit (this folder)
- Aug 25, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Serennity007
- 0.618score
feature-engineering
Serennity007
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
custom-indicators
Serennity007
Crypto-native indicators including NVT ratio, exchange flow, funding rate signals, holder momentum, and smart money flow
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
correlation-analysis
Serennity007
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
coingecko-api
Serennity007
Broad crypto market data from CoinGecko covering 13,000+ tokens.
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
dex-pool-analysis
Serennity007
AMM pool mechanics comparison across Raydium, Orca, and Meteora including fee structures, pool types, creation patterns, and volume efficiency
SkillBFreshness: B★ 41Claude Code +9 - 0.617score
ibkr-options-assistant
Serennity007
Interactive Brokers options & stock trading assistant.
SkillBFreshness: B★ 41Claude Code +9
Cite this page
dex-execution skill. Agent Mart. https://agentmart.dev/skills/serennity007-dex-execution (last updated 2026-10-24)