How to Build a Jupiter DEX Aggregator Bot with CoinMarketCap API
CoinMarketCap API DIY

How to Build a Jupiter DEX Aggregator Bot with CoinMarketCap API

3 Minuten
3 months ago

Learn how to build a Solana trading bot that uses CoinMarketCap’s DEX API for discovery and signals, and Jupiter for optimal trade routing and execution.

How to Build a Jupiter DEX Aggregator Bot with CoinMarketCap API

Inhaltsverzeichnis

Introduction

On Solana, execution is fast, but choosing what to trade is the hard part.

Jupiter solves routing: it finds the best path across DEXs (Raydium, Orca, etc.) to execute a trade.

CoinMarketCap solves decision-making: it helps you discover tokens, evaluate liquidity, and generate signals.

In this guide, you’ll build a Jupiter DEX Aggregator Bot with CoinMarketCap API where:
  • CoinMarketCap API powers the signal engine (discovery, ranking, risk filters)
  • Jupiter handles execution and routing (best price across Solana DEXs)

CoinMarketCap is a market intelligence layer. Jupiter is the execution layer.

Why Combine CoinMarketCap + Jupiter?

A naive bot trades a fixed list of tokens.

A better bot:

  • discovers new tokens early
  • ranks opportunities by volume and momentum
  • validates liquidity across DEXs
  • avoids risky tokens
  • routes trades through the best available pools

CoinMarketCap gives you:

  • DEX discovery (new, trending, gainers/losers)
  • pool-level liquidity and volume
  • transaction activity (buys/sells)
  • token metadata and risk signals

Jupiter gives you:

  • best execution route across Solana DEXs
  • slippage-aware routing
  • multi-hop swaps

System Architecture

CoinMarketCap DEX API (Signal Layer)
├─ Discovery (new / trending / meme)

├─ Liquidity + volume

├─ Pool-level data (Raydium, Orca, etc.)

├─ Transaction flow (buys/sells)

└─ Risk checks



Signal engine



Jupiter Aggregator (Execution Layer)



Best route + swap execution

Step 1: Discover Solana Tokens (DEX)

Use CoinMarketCap DEX discovery endpoints (POST + JSON body).

Best endpoints:

  • /v1/dex/new/list → newly launched tokens
  • /v1/dex/meme/list → meme coins
  • /v1/dex/tokens/trending/list → trending tokens
  • /v1/dex/gainer-loser/list → top movers
To run the automated token discovery using the /v1/dex/new/list endpoint, your CoinMarketCap API key must be on a paid commercial tier (e.g., Startup plan or higher).
HTTP 403 Forbidden

Error 1006: Plan Not Authorized
Attempting to call this specific discovery endpoint with a Free (Basic) plan will result in the error above.

Make sure your API plan includes access to DEX discovery endpoints before implementing automated token scanning.

Example

import requests

HEADERS = {
"Accept": "application/json",
"Content-Type": "application/json",
"X-CMC_PRO_API_KEY": "YOUR_KEY",
}

def fetch_trending_solana():
url = "https://pro-api.coinmarketcap.com/v1/dex/tokens/trending/list"

body = {
"platformIds": "solana_platform_id",
"limit": 50
}

r = requests.post(url, headers=HEADERS, json=body)
r.raise_for_status()

return r.json()["data"]

Step 2: Extract Token Address (Mapping)

For Solana trading, you need the contract address (SPL token).

Two reliable methods:

Method 1: DEX search

def search_token(symbol):
url = "https://pro-api.coinmarketcap.com/v1/dex/search"

params = {
"q": symbol,
"platform": "solana"
}

r = requests.get(url, headers=HEADERS, params=params)

return r.json()

Method 2: Core API

/v1/cryptocurrency/map

Look for:

  • platform.token_address

Step 3: Analyze Liquidity Across DEXs

Use pool-level data to understand where liquidity exists.

Endpoint

/v1/dex/token/pools

Example

def fetch_pools(token_address):
url = "https://pro-api.coinmarketcap.com/v1/dex/token/pools"

params = {
"address": token_address,
"platform": "solana"
}

r = requests.get(url, headers=HEADERS, params=params)

return r.json()["data"]

Key fields

  • exn → DEX name (Raydium, Orca)
  • liqUsd → liquidity per pool
  • v24 → 24h volume

Why this matters

Jupiter routes through these pools.

Your bot should:

  • ignore low-liquidity pools
  • prioritize tokens with multiple strong pools

Step 4: Evaluate Trading Activity

Understand whether a token is active.

Metrics available

  • num_transactions_24h
  • 24h_no_of_buys
  • 24h_no_of_sells

Endpoint

/v1/dex/tokens/transactions

Example signal

  • high buy count
  • rising transactions
  • healthy buy/sell ratio

Step 5: Get Real On-Chain Price

For DEX tokens, avoid global VWAP.

Use DEX pricing:

Endpoint options

  • /v1/dex/token/price
  • /v4/dex/pairs/quotes/latest

Example

def fetch_price(token_address):
url = "https://pro-api.coinmarketcap.com/v1/dex/token/price"

params = {
"address": token_address,
"platform": "solana"
}

r = requests.get(url, headers=HEADERS, params=params)

return r.json()

These return:

  • real pool price
  • buy/sell tax
  • pair-level data

Step 6: Generate Trading Signal

Combine all data:

Example rules

  • liquidity > $50k
  • volume (24h) increasing
  • high transaction count
  • strong buy ratio
  • trending or new token

Optional filters:

  • avoid tokens with extreme taxes
  • avoid low liquidity

Step 7: Execute Trade via Jupiter

Now send the trade to Jupiter.

Jupiter will:

  • find best route
  • split across pools
  • minimize slippage

Your bot just needs:

  • token address
  • amount
  • slippage tolerance

Step 8: Monitor Trade and Execution Quality

Track:

  • execution price vs expected
  • slippage
  • liquidity changes

Re-check pools periodically.

Rate Limit Strategy

CoinMarketCap is REST-only.

Best practice:

  • poll every 30–60 seconds
  • cache results locally
  • batch requests
  • use exponential backoff

Do NOT:

  • poll every 2 seconds
  • expect real-time streaming

Common Mistakes to Avoid

1. Using global price instead of DEX price

Always use DEX endpoints for Solana tokens.

2. Ignoring pool-level liquidity

Routing depends on real liquidity.

3. Trading without transaction analysis

Low activity = fake or dead token.

4. Polling too aggressively

Leads to 429 errors and wasted credits.

5. Assuming CoinMarketCap executes trades

It does not, Jupiter does.

Final Thoughts

A strong Solana trading bot is fast and selective.

By combining:

  • CoinMarketCap API for discovery and signals
  • Jupiter for execution and routing

You build a system that:

  • finds better opportunities
  • avoids weak tokens
  • executes efficiently across DEXs

That is the difference between random trades and a structured strategy.

Next Steps

To improve your bot:

  • add multi-signal strategies
  • track PnL and execution quality
  • integrate wallet risk limits
  • test different liquidity thresholds

The better your signal layer, the better your trades.

The platforms, protocols, and projects referenced in these articles are used for illustrative purposes only to demonstrate how the CoinMarketCap API can be integrated in practice. CoinMarketCap makes no representation that these projects endorse or are affiliated with CoinMarketCap. If you represent a referenced project and have concerns, please contact us at content@coinmarketcap.com and we will respond promptly.
0 people liked this article