Developer GuidesGhid

Build a crypto AI agent in Python with MCP: an open-source kit

On 1 December 2026 an open-source Python agent found Solana's busiest SOL/USDC pool and read its RSI in three tool calls. Here is the kit behind it: a chat agent, a new-pool bot and paper signals.

Build a crypto AI agent in Python with MCP: an open-source kit
Ilustrație: CoinPaprika

The DexPaprika agent kit is an open-source Python template with three crypto AI agents: a chat agent that picks its own data tools, a bot that posts new liquidity pools to Discord or Telegram, and a job that turns RSI, MACD and Bollinger Bands into paper signals. All three talk to the hosted DexPaprika MCP server, so there is no server to run.

According to DexPaprika data, on 1 December 2026 the chat agent found the busiest SOL/USDC pool on Solana, an Orca pool with about $94.3 million of 24-hour volume, and read its hourly RSI of 59.76 in three tool calls.

Most crypto agent tutorials stop at a chat window. This one covers code that runs while nobody is at the keyboard: in a cron job, a bot or your own product. It walks through what each agent does, how the tool loop works, how to run it with any model that supports tool calling, and where the free tier ends.

What is in the kit

Each agent is one short file. The shared plumbing (the MCP session, the tool loop, retries and error handling) lives in agentkit.py.

AgentWhat it doesNeeds a model
market_chat.pyAnswers questions like "top WETH pools on Ethereum" by picking DexPaprika tools itselfYes
pool_radar.pyPosts new liquidity pools on a network to Discord, Telegram or the terminalNo
signal_agent.pyReads RSI, MACD and Bollinger Bands for a watchlist and returns buy, sell or hold on paperOptional

The repository is a GitHub template under the MIT license, so Use this template gives you your own copy to change. If the kit saves you time, a star on GitHub helps other builders find it.

Run it in a few minutes

You need Python 3.10 or newer. Two of the agents run without any key and without a model:

git clone https://github.com/coinpaprika/dexpaprika-agent-kit cd dexpaprika-agent-kit python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python signal_agent.py # no keys, no model python pool_radar.py # no keys; alerts print in the terminal

The signal agent prints one line per pool and the numbers behind it. A run on 1 December 2026:

USDC/WETH on ethereum: HOLD RSI 63.0 is between 30 and 70: no extreme to act on. price 1699.145544 rsi 62.968774 macd hist 1.602235 bbands 1628.032112 / 1740.239007 SOL/USDC on solana: HOLD RSI 59.8 is between 30 and 70: no extreme to act on. price 73.363609 rsi 59.758131 macd hist 0.012905 bbands 70.79002 / 74.906753

How the agent loop works

The agents connect to https://mcp.dexpaprika.com/streamable-http with the official MCP Python SDK. If the Model Context Protocol is new to you, our MCP explainer covers the idea. In short, the server describes its tools, and the client decides which ones to call.

agentkit.chat() hands the model the tools listed in TOOLS, runs the ones it asks for, feeds the results back and returns the model's answer. That loop is the whole agent. The three files differ only in which tools they expose and what they do with the answer.

When you do not need a model at all, agentkit.call() runs one tool directly. It retries network failures and raises a typed error with DexPaprika's own code when a tool refuses. This script prints the three busiest pools on Base:

import asyncio from agentkit import call, dexpaprika async def main(): async with dexpaprika() as mcp: page = await call(mcp, "getNetworkPools", {"network": "base", "limit": 3}) for pool in page["results"]: print(pool["dex_name"], pool["id"], f"${pool['volume_usd_24h']:,.0f}") asyncio.run(main())

Run from the repository folder at 11:58 UTC on 2 December 2026, it printed:

Aerodrome Slipstream 0xec3c3755b9ded4a2960ef50c9b48c1694ce274c2 $175,545,681 Uniswap V3 0x6c561b446416e1a00e8e93e221854d6ea4171372 $73,577,516 Uniswap V3 0x7aea2e8a3843516afa07293a10ac8e49906dabd1 $67,431,416

The chat agent picks its own tools

For market_chat.py, copy .env.example to .env and uncomment one model block. The agent prints each tool call as the model makes it, so you can see how it reaches the answer. A run with Claude Sonnet 5.5 on 1 December 2026:

$ python market_chat.py "What is the RSI on the main SOL/USDC pool on Solana right now, on 1h candles?" > search {"query": "SOL USDC solana", "limit": 10} > getNetworkPools {"network": "solana", "limit": 20} > getPoolIndicator {"network": "solana", "pool_address": "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE", "indicator": "rsi", "interval": "1h", "limit": 5}

The answer named the Orca SOL/USDC pool, gave the 1h RSI as about 59.76 from the 14:00 UTC candle, and explained the pick: it had the highest 24h volume of the SOL/USDC pools, about $94.3 million. The model asked for five RSI values, and the kit widened the request to 100, because RSI, EMA and MACD only settle over a long window. It then passed the model the newest 24.

A new-pool bot for Discord or Telegram

pool_radar.py first remembers the pools that already exist on a network, then alerts on every pool created after that with liquidity above a floor (5,000 USD by default). Set DISCORD_WEBHOOK_URL, or TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID, and the alerts go there. A real alert from Base on 1 December 2026:

New pool on base: WETH/KOIN on Uniswap V2 Liquidity $19,556 · 24h volume $2,828 · 9 txns · created 2026-12-01T12:17:12Z https://dexpaprika.com/base/pool/0x3d923db7ecc21d2520b896917134dc1569b0e43f New pools are unvetted and many are scams. Not a recommendation.

python pool_radar.py --once does one pass and exits, which suits cron or CI. The list of pools it has seen is kept in a state file, so that file has to survive between runs. Pools reach the radar about an hour after they are created, because the hosted MCP server lists pools the way a free key does: on 1 December 2026 the newest pool it listed on Solana and on Base was 60 minutes old. For alerts as soon as a pool is indexed, the kit's README points to the api-pro pool search on a Dev, Pro or Enterprise plan.

Paper signals from RSI, MACD and Bollinger Bands

DexPaprika computes the indicators server-side from pool candles, so the signal agent never downloads or processes candles itself. Without a model it applies a plain rule: buy when RSI is under 30 and the MACD histogram is positive, sell when RSI is over 70 and the histogram is negative, otherwise hold. With a model configured, the model decides from the same numbers. On 1 December it disagreed with the rule on USDC/WETH and said BUY, citing a positive MACD histogram and room below the upper band.

The signals are an example of wiring indicators into an agent. They are not trading advice, and nothing in the kit places orders.

Token names are untrusted input

Whoever deploys a token picks its name and symbol, so a symbol can carry text written for your model. The kit treats every tool result as data from a stranger: results reach the model wrapped in <tool_result> tags, the model can only run the read-only tools in TOOLS, and a request for any other tool is refused and never sent. Alerts quote symbols as code and turn mentions off, so a token called @everyone pings nobody. The signal agent gives the model numbers only, never symbols. Our guide to AI agent security covers these attacks in more depth.

Models, keys and limits

The model side is any endpoint that speaks the OpenAI chat API with tool calling. .env.example has blocks for Anthropic, Nebius, OpenRouter, OpenAI and Ollama. On Ollama, start the server with OLLAMA_CONTEXT_LENGTH=32768, because the tool descriptions alone take about 25,000 characters.

The default tools need no DexPaprika key. Token-level OHLCV, token indicators and pool swaps need a Dev, Pro or Enterprise plan: set DEXPAPRIKA_API_KEY and the kit sends it in the Authorization header on its own. If you also call the DexPaprika REST API from your own code, it works without a key, and a free key from console.dexpaprika.com raises the rate and the quota. Free-tier data can be up to 60 seconds behind and real-time data is on paid plans; current numbers are on the pricing page.

Common questions

Do I need an API key to build a crypto AI agent with this kit?

No DexPaprika key is needed for the default tools. You need a model for the chat agent; a local one in Ollama has no key either.

Which chains does it cover?

Every network DexPaprika indexes, 35 as of 2 December 2026. The getNetworks tool returns the current list.

Can the agent trade?

No. Every tool it can call is read-only, and the signals are on paper.

Is the agent kit free to use?

The code is MIT licensed, and the DexPaprika tools it uses by default need no key. Your model provider may charge for tokens; a local model in Ollama does not.

How do I add a tool?

Add its name to TOOLS in market_chat.py. The server has more than the default list, for example getNetworkPoolsFilter for volume and liquidity filters. A short list keeps the prompt small enough for local models.

How these numbers were measured

The signal output, the chat transcript and the pool alert are verbatim runs of the kit on 1 December 2026, published in the repository's README; the chat run used Claude Sonnet 5.5. The Base pool list comes from running the script above against the hosted MCP server at 11:58 UTC on 2 December 2026. Volumes are DexPaprika's 24-hour figures at the time of each run. The network count comes from the DexPaprika networks endpoint on 2 December 2026.

Code: github.com/coinpaprika/dexpaprika-agent-kit. Server: hosted MCP server docs. Full REST reference: docs.dexpaprika.com. Free key: console.dexpaprika.com. Plans: dexpaprika.com/api/pricing. Local MCP server: github.com/coinpaprika/dexpaprika-mcp.

Pool data guides built on the same API: Manifest API on Solana, Ekubo API on Ethereum and Bluefin API on Sui.

Distribuiți acest ghid
Scris de Mateusz Sroka

Ghid original CoinPaprika.

Raportați o corectură
Toate ghidurile

Cryptocurrencies are highly volatile and involve significant risk. You may lose part or all of your investment.

All information on Coinpaprika is provided for informational purposes only and does not constitute financial or investment advice. Always conduct your own research (DYOR) and consult a qualified financial advisor before making investment decisions.

Coinpaprika is not liable for any losses resulting from the use of this information.