Skip to content
Finance
Skill

/raptor-dex

Self-hosted Solana DEX aggregator by SolanaTracker — multi-hop routing across 25+ DEXes, WebSocket streaming, Yellowstone Jet TPU submission, no rate limits

From plugin
trading-skills
55968 skills

Claude Code

$ npx -y skills add agiprolabs/claude-trading-skills --skill raptor-dex --agent claude-code

SKILL.md

raptor-dex.SKILL.md
name: raptor-dex
description: Self-hosted Solana DEX aggregator by SolanaTracker — multi-hop routing across 25+ DEXes, WebSocket streaming, Yellowstone Jet TPU submission, no rate limits

Raptor — Self-Hosted Solana DEX Aggregator

Raptor is a self-hosted Rust binary that aggregates swap quotes across 25+ Solana DEXes. Unlike Jupiter, Raptor runs on your own infrastructure with **no rate limits**, **no API key**, and **no dependency on external API availability**. Free during public beta.

  • **Program ID (Mainnet)**: `RaptorD5ojtsqDDtJeRsunPLg6GvLYNnwKJWxYE4m87`
  • **GitHub**: [solanatracker/raptor-binary](https://github.com/solanatracker/raptor-binary)
  • **Docs**: [docs.solanatracker.io/raptor/overview](https://docs.solanatracker.io/raptor/overview)

Quick Start

# Clone the binary repo (includes required signature file)
git clone https://github.com/solanatracker/raptor-binary
cd raptor-binary

# Run with required environment variables
export RPC_URL="https://your-solana-rpc.com"
export YELLOWSTONE_ENDPOINT="https://your-yellowstone-grpc.com"
export YELLOWSTONE_TOKEN="your-token"  # if required by provider
./raptor
# Listens on 0.0.0.0:8080 by default

**Requirements**: Solana RPC endpoint + Yellowstone gRPC endpoint (for pool indexing). Raptor uses very few RPC calls during normal operation since pool state is streamed via Yellowstone.

**Signature file**: The `signature` file must be in the same directory as the Raptor binary. It authenticates your instance and is included in the repo clone. If you move the binary, copy the signature file with it.

Execution Flow

1. GET  /quote              → Best route across 25+ DEXes
2. POST /swap               → Unsigned versioned transaction
3. Sign locally              → Your private key never leaves your machine
4. POST /send-transaction   → Submit via Yellowstone Jet TPU
5. GET  /transaction/{sig}  → Confirm status (pending/confirmed/failed/expired)

API Endpoints

| Method | Endpoint | Description | |--------|----------|-------------| | `GET` | `/quote` | Get swap quote with multi-hop routing | | `POST` | `/swap` | Build swap transaction from quote | | `POST` | `/swap-instructions` | Get swap instructions only (no tx wrapper) | | `POST` | `/quote-and-swap` | Quote + transaction in one request | | `POST` | `/send-transaction` | Submit via Yellowstone Jet TPU with auto-retry | | `GET` | `/transaction/:signature` | Track transaction status and parsed events | | `GET` | `/health` | Health check (pools, cache, Yellowstone connection) |

Get a Quote

import httpx

RAPTOR = "http://localhost:8080"

resp = httpx.get(f"{RAPTOR}/quote", params={
    "inputMint": "So11111111111111111111111111111111111111112",   # SOL
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",  # USDC
    "amount": 1_000_000_000,  # 1 SOL in lamports
    "slippageBps": 50,
})
quote = resp.json()
print(f"Output: {quote['amountOut']} lamports")
print(f"Price impact: {quote['priceImpact']}%")
print(f"Route: {len(quote['routePlan'])} hops")

Quote Parameters

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `inputMint` | string | Yes | Input token mint address | | `outputMint` | string | Yes | Output token mint address | | `amount` | integer | Yes | Amount in smallest unit (lamports) | | `slippageBps` | string | No | Basis points or `"dynamic"` (default: 50) | | `dexes` | string | No | Comma-separated DEX filter | | `excludeDexes` | string | No | DEXes to exclude | | `maxHops` | integer | No | 1-4 hops (default: 4) | | `directRouteOnly` | boolean | No | Only single-hop routes | | `pools` | string | No | Comma-separated pool address filter | | `feeBps` | integer | No | Platform fee 0-1000 bps | | `feeAccount` | string | No | Fee recipient wallet |

Build and Sign a Swap

import base64
import os

# Step 2: Build transaction from quote
resp = httpx.post(f"{RAPTOR}/swap", json={
    "quoteResponse": quote,
    "userPublicKey": "YOUR_WALLET_PUBKEY",
    "wrapUnwrapSol": True,
    "txVersion": "v0",
    "priorityFee": "auto",       # min|low|auto|medium|high|veryHigh|turbo|unsafeMax
    "maxPriorityFee": 100_000,    # cap in lamports
})
swap = resp.json()
# swap["swapTransaction"] is base64-encoded unsigned transaction

# Step 3: Sign locally (private key never sent to Raptor)
from solders.transaction import VersionedTransaction
from solders.keypair import Keypair

tx_bytes = base64.b64decode(swap["swapTransaction"])
tx = VersionedTransaction.from_bytes(tx_bytes)
keypair = Keypair.from_base58_string(os.getenv("PRIVATE_KEY"))
signed_tx = VersionedTransaction(tx.message, [keypair])
signed_b64 = base64.b64encode(bytes(signed_tx)).decode()

# Step 4: Submit via Yellowstone Jet TPU
resp = httpx.post(f"{RAPTOR}/send-transaction", json={
    "transaction": signed_b64,
})
result = resp.json()
print(f"Signature: {result['signature']}")

# Step 5: Track status
resp = httpx.get(f"{RAPTOR}/transaction/{result['signature']}")
status = resp.json()
# status: pending | confirmed | failed | expired
print(f"Status: {status['status']}, Latency: {status.get('latency_ms')}ms")

WebSocket Streaming

Real-time quote streaming with slot-based updates when pool state changes:

import asyncio, websockets, json

async def stream_quotes():
    async with websockets.connect("ws://localhost:8080/stream") as ws:
        await ws.send(json.dumps({
            "type": "subscribe",
            "inputMint": "So11111111111111111111111111111111111111112",
            "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
            "amount": 1_000_000_000,
            "slippageBps": "50",
        }))
        async for msg in ws:
            data = json.loads(msg)
            if data.get("type") == "quote":
                print(f"Out: {data['data']['amountOut']} (slot {data['data']['contextSlot']})")

`/stream/swap` variant pre-builds transactions ready for signing,

Read more
@agiprolabs
Ships withtrading-skills

A comprehensive collection of 68 ready-to-use trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools.

Stars on GitHub

Momentum

stars in total
559
Star history of agiprolabs/claude-trading-skills on GitHub, a chart by star-history.com

Other skills on trading-skills.

coingecko-api

coingecko-api

Broad crypto market data from CoinGecko covering 13,000+ tokens. Global market stats, historical price data going back years,…

More skills from other plugins.

ccxt-cli

ccxt-cli

CCXT command-line interface (ccxt-cli) for interacting with 100+ cryptocurrency exchanges directly from the terminal — no code…

ccxt9d45k
@ccxt@ccxtInstall Skill

Questions about raptor-dex.

Which coding agents can use raptor-dex?
raptor-dex installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.