# Best Tools for AI Trading Agents on Solana: The Essential Stack

> The tools an AI trading agent on Solana needs, layer by layer: Codex for onchain data, Moby for execution and guardrails, plus hosts and custom builds.

Source: https://www.codex.io/blog/solana-ai-trading-agent-tools
Published: 2026-11-20
Author: Neal O'Grady

AI trading agents on Solana are past the demo stage. You can give an agent a funded wallet, describe a strategy in plain English, and it will research tokens, size positions and place orders, with take-profit and stop-loss exits if you ask for them. The model is the easy part. Whether it makes sensible trades depends on the stack around it: the data it sees, the venue it trades through, and the limits that stop a bad decision from getting expensive.

This guide maps the essential tools for AI trading agents on Solana, layer by layer, with a recommendation at each one. The short version: [Codex](https://www.codex.io/) for the onchain data your agent reasons over, and [Moby](https://moby.win/agentic-trading) for execution with guardrails. The rest of the post covers why, how to connect both, and what to use if you build execution yourself.

## The AI Trading Agent Stack, Layer by Layer

Every trading agent, from a weekend copy-trading bot to a fund's autonomous strategy, is some variation of this stack:

```
Agent host          -- Claude Code, OpenAI Codex, Gemini CLI, Grok
Market data         -- Codex API (API key or MPP), plus Skills and Docs MCP
Execution + wallet  -- Moby MCP and agent wallet
Guardrails          -- Moby limits, or your own wallet policies
Custom execution    -- Jupiter, Helius, Jito (if you build it yourself)
```

Each layer answers a different question. The host decides what to do. The data layer tells it what is actually happening onchain. The execution layer turns a decision into a transaction. Guardrails decide how much a wrong decision can cost. The sections below take them in order.

## Agent Hosts: Where Your Agent Runs

The host is the model plus the harness that lets it call tools. For trading, any host that speaks [MCP](https://modelcontextprotocol.io) (Model Context Protocol) works, because that is how both the data and the execution tools plug in.

- **Claude Code:** Anthropic's terminal agent installs Agent Skills and connects remote MCP servers with one command each, which makes it the quickest host to wire up.
- **OpenAI Codex:** OpenAI's coding agent (no relation to the Codex data API) supports the same skills and MCP servers from its CLI.
- **Gemini CLI and Grok:** Moby has setup guides for Gemini CLI (with a paid Gemini API key or enterprise access), the Grok CLI and Grok Bot. Moby recommends Grok Bot, and its ready-made [Moby Agent](https://x.ai/bot/ccdjR2ETCZWe-vmROp_m-) asks for your agent key through a secure input.
- **ChatGPT:** connects on Business, Enterprise and Edu workspaces that allow custom MCP servers.

**Recommendation:** Claude Code or OpenAI Codex if you are comfortable in a terminal. Beyond those, any MCP client that can send an `Authorization` header can connect to the tools below.

## Market Data: What Your Agent Sees

An agent can only trade as well as it can see. A language model has no idea what launched on Pump.fun ten minutes ago, who holds a token, or whether the wallet it wants to copy actually makes money. It needs a data layer that answers those questions in one call, in a shape a model can read.

The questions a Solana trading agent asks most:

- **What is trending, and what just launched?** token screening and launchpad streams.
- **What is the price, and where has it been?** real-time prices and OHLCV charts.
- **Who holds it?** holder lists and top-10 holder concentration.
- **Which wallets trade it well?** wallet PnL, win rate and the top traders for a token.
- **What is happening right now?** live trade and price streams.

**[Codex](https://www.codex.io/)** answers all of these from one GraphQL API: real-time, enriched data for over 100 million tokens and billions of wallets across 80+ networks, Solana included, with [Pump.fun](https://www.codex.io/blog/pump-fun-api) and other [launchpads](https://www.codex.io/launchpads) streamed from token creation through graduation. TradingView runs its onchain data on it. For agents, getting the data and knowing how to ask for it are separate pieces:

- **API key or MPP:** how the agent reaches live data. Use an API key from the Codex dashboard, or [MPP](https://docs.codex.io/agents/mpp), where the agent pays $0.001 per request in USDC on Tempo with no Codex account or key. MPP covers queries only: WebSocket subscriptions and webhooks need an API plan. More in [our MPP announcement](https://www.codex.io/blog/codex-now-supports-agentic-payments-via-mpp).
- **Codex Skills:** an operation map, auth patterns and query templates for the whole API, so the agent writes working queries without trial and error. [Setup guide](https://docs.codex.io/agents/codex-skills).
- **Codex Docs MCP:** lets the agent search the API reference while it works. It looks things up in the docs; it does not run queries. [Setup guide](https://docs.codex.io/agents/docs-mcp).

Installing the skills takes one command:

```
npx skills add Codex-Data/skills -g --yes
```

Then ask in plain English. A request like "find Solana tokens with real liquidity that are trending today" becomes a query along these lines:

```
query {
  filterTokens(
    filters: {
      network: [1399811149]
      liquidity: { gt: 50000 }
      holders: { gt: 500 }
    }
    rankings: [{ attribute: trendingScore24, direction: DESC }]
    limit: 10
  ) {
    results {
      token { address name symbol }
      priceUSD
      liquidity
      marketCap
      holders
      change24
    }
  }
}
```

Codex is also listed in [Moby's Agent Marketplace](https://moby.win/marketplace/codex-api/) as a data add-on, marked "Never trades": it reads token, wallet, holder and prediction-market data and writes nothing onchain. That split is deliberate. Keep research and execution in separate tools, so the one that reads data never holds funds.

The free plan has a monthly usage allowance after a one-time $1 activation fee, which covers screening, prices, charts and trades while you build. Holder lists, wallet analytics (PnL and top traders) and every WebSocket stream need a Growth or Enterprise plan; each endpoint's reference page lists its tier, and [pricing](https://www.codex.io/pricing) has the current plans. [Get a free API key](https://dashboard.codex.io/signup) to start.

**Recommendation:** Codex Skills plus an API key for most agents, on Growth once you need wallet analytics or streams. MPP for agents that run on their own wallet, only query, and should not depend on a human's account.

## Execution: How Your Agent Trades

Execution is where a decision becomes a transaction, and where most of the risk lives. The naive version is handing an agent a private key and a swap API. That works until the agent misreads a ticker or loops on a buy, and nothing between the model and the chain stops it.

**[Moby](https://moby.win/agentic-trading)**, the smart money trading app and token screener from AssetDash, is built for this layer. Your agent connects to the Moby MCP server with an agent API key (not a wallet private key) and gets 80+ research and trading tools: swaps; limit, take-profit, stop-loss, trailing-stop, bracket and DCA orders; whale, KOL and smart-money data; and a rug check. It trades Solana tokens with USDC, including memecoins, majors and tokenized stocks such as TSLAx.

Trades come out of a dedicated agent wallet, funded in USDC and separate from your main Moby wallet. Whatever you deposit is the most the agent can trade, and it has no tool to withdraw, transfer or send funds.

Connecting takes one command. Create an agent key in the Moby app's Agent tab (it starts with `moby_agent_`), load it into `MOBY_API_KEY`, then in Claude Code:

```
claude mcp add --transport http moby https://mcp.moby.win/mcp \
  --header "Authorization: Bearer $MOBY_API_KEY" --scope user
```

Moby's [agentic trading guide](https://moby.win/agentic-trading) has the same setup for OpenAI Codex, Gemini CLI and Grok, and shows how to load the key without it landing in your shell history.

Moby charges 0.75% per swap ($0.90 minimum), plus onchain fees, with no subscription. At the time of writing, agents trade on Solana only, with Base, BNB Chain and Robinhood Chain listed as coming soon.

**Recommendation:** Moby for execution unless you need custom routing or are building a product for other traders. You get order types, a sandboxed wallet and server-side limits without writing any of it.

## Guardrails: Limits Before Autonomy

The most important layer is the one that decides what happens when the agent is wrong. Models misread data, chase momentum and occasionally invent a ticker. Guardrails belong outside the model, where a prompt cannot talk its way past them.

You set your agent's max per trade, daily buy volume and market-cap range in the Moby app, and Moby checks them server-side on every buy your agent makes. It also blocks any buy of a token Moby rates red, whatever the agent asks for.

On top of those, you control the connection itself:

- **Ask before every trade:** an optional switch on Moby's strategy cards that has the agent name the token, contract, amount and price, then wait for your yes before each trade. Check how approvals behave in your agent host before you rely on them.
- **Pause:** stop the agent trading at any time.
- **Key revocation:** revoke the agent key and that connection stops at once.

Two habits on top. Give the agent its exits up front: agent buys have no automatic exits unless you ask, and Moby places real take-profit and stop-loss orders, including a one-call bracket. A stop-loss limits a loss but cannot guarantee its fill price, especially on thin, volatile tokens. And use the data layer as a second check before a buy: holder concentration from [top10HoldersPercent](https://docs.codex.io/api-reference/queries/top10holderspercent) and the wallets behind a token from [filterTokenWallets](https://docs.codex.io/api-reference/queries/filtertokenwallets) (Growth plan) take one call each.

**Recommendation:** start with "Ask before every trade" on, a max per trade you are comfortable losing and a market-cap floor, and fund the agent wallet with a small amount, keeping the $0.90 minimum fee in mind. Loosen the limits as the agent earns trust.

## Building Your Own Execution Layer

Moby covers execution when an agent trades for you. If you are writing a bot in code, or building a product where many users run agents, you will assemble execution yourself. These are the pieces.

**[Solana Agent Kit](https://github.com/sendaifun/solana-agent-kit)** from SendAI is an open-source toolkit for connecting AI agents to Solana protocols, with 60+ actions (Jupiter swaps and Jito bundles among them) and integrations for LangChain and the Vercel AI SDK. Its quick start signs with a raw keypair, so move to a managed wallet before real funds are involved.

**[Jupiter's Swap API](https://developers.jup.ag/docs/swap)** is the standard way to route a swap on Solana: a REST API that finds the best route across Solana liquidity. Quotes work without an API key, and a free key raises the rate limit.

**[Helius](https://www.helius.dev)** is the Solana-specialized RPC provider. For trading, the parts that matter are Sender, which routes transactions to validators and Jito at once, staked connections by default, and LaserStream for streaming blocks, transactions and account data over gRPC. The free plan includes LaserStream WebSocket for standard Solana methods; LaserStream gRPC runs on devnet from the Developer plan and on mainnet from the Business plan.

**[Jito](https://docs.jito.wtf/bundles/)** bundles group up to five transactions that execute sequentially and atomically: all of them land or none do. You pay for inclusion with a SOL tip to one of Jito's tip accounts. Useful when a buy and its follow-up have to land together or not at all.

**[Turnkey](https://docs.turnkey.com)** and **[Privy](https://docs.privy.io)** provide secure wallet infrastructure for agents. The private key stays in a secure enclave, and the agent holds an API or authorization key that can only request signatures. The guardrails come from signing policies you configure, such as per-transaction transfer limits or an allowlist of programs, enforced outside the agent. Both policy engines deny by default, but the protection is only as good as the policies you write. This is your guardrail layer when you are not using Moby's.

For data, the same [Codex](https://www.codex.io/) API works from code through the [TypeScript SDK](https://docs.codex.io/sdk), with WebSocket subscriptions for live prices, trades and launchpad events. Our guide to [building a crypto trading bot](https://www.codex.io/blog/how-to-build-crypto-trading-bot) walks through the data side end to end.

**Recommendation:** Solana Agent Kit or your own tool layer, Jupiter for routing, Helius for RPC and sending, Jito when atomicity matters, and Turnkey or Privy policies as guardrails. Budget real time for that last layer: it is the part Moby gives you out of the box.

## Putting It Together: Recommended Stacks

The tools above are building blocks. Here is how they assemble for three common Solana agent strategies.

### Copy-Trading Agent

| Layer | Tool | Why |
| --- | --- | --- |
| Host | Claude Code | Skills and MCP in one command each |
| Data | [Codex](https://www.codex.io/) | Find wallets worth copying: PnL, win rate, top traders per token (Growth plan) |
| Execution | Moby | Copy buys, plus take-profit and stop-loss orders when you ask for them |
| Guardrails | Moby limits | Max per trade and a daily cap, so one bad wallet can only spend what your limits allow |

### Launchpad Scanner

| Layer | Tool | Why |
| --- | --- | --- |
| Host | Claude Code or OpenAI Codex | Runs the scan-check-buy loop |
| Data | [Codex](https://www.codex.io/) | [Pump.fun](https://www.codex.io/blog/pump-fun-api) and launchpad streams, holder concentration, graduation progress |
| Execution | Moby | Won't buy red-rated tokens; brackets when you ask for them |
| Guardrails | Moby limits | Small max per trade and a market-cap range for early tokens |

### Custom Trading Bot

| Layer | Tool | Why |
| --- | --- | --- |
| Framework | Solana Agent Kit | Solana actions for LangChain or Vercel AI SDK agents |
| Data | [Codex](https://www.codex.io/) SDK | Stream prices, trades and launchpad events; query wallet PnL |
| Swaps | Jupiter Swap API | Best route across Solana liquidity |
| RPC and sending | Helius | Sender and staked connections for landing transactions |
| Bundles | Jito | Atomic multi-transaction landing |
| Keys and guardrails | Turnkey or Privy | Enclave-held keys; signing policies you configure |

These are starting points, not prescriptions. The order matters more than the picks: choose your data layer and your guardrails before you let an agent touch funds, not after its first bad trade.

> Trading risk: AI trading agents can lose money through market moves, bad decisions, failed transactions or software bugs. Limits reduce how much a mistake can cost; they do not make trades profitable or prevent every loss. Start small, and review what your agent does before giving it more room.

Ready to build? [Get a free Codex API key](https://dashboard.codex.io/signup) or install the Codex skills, then connect your agent to [Moby's agentic trading](https://moby.win/agentic-trading/) for execution. Setup for every host is on [moby.win/agents](https://moby.win/agents/), and Codex sits alongside other add-ons in [Moby's Agent Marketplace](https://moby.win/marketplace/). Once connected, ask your agent to pull price, holders and top wallets from Codex, then check smart money on Moby before it trades.

## FAQ

### What is the best data API for AI trading agents on Solana?

Codex is built for it: one GraphQL API with real-time prices, charts, token screening, launchpad streams, holders and wallet PnL across 80+ networks, Solana included. Agents query it with an API key or pay per request over MPP, and the Codex Skills and Docs MCP help them write the queries.

### Can an AI agent trade on Solana by itself?

Yes. With Moby's agentic trading, an agent connected over MCP can swap and place limit, take-profit, stop-loss, trailing-stop, bracket and DCA orders from a dedicated USDC agent wallet, inside limits you set. You can also require approval before every trade.

### Is it safe to give an AI agent a crypto wallet?

Only with limits the agent cannot override. Use a separate wallet funded with what you are willing to risk, enforce a max per trade and a daily cap outside the model, and keep the ability to pause or revoke access. Moby enforces its trade limits server-side, and its agent wallet has no tool to withdraw or transfer funds. Limits cap what a mistake can cost; they do not prevent losses.

### Does Codex place trades?

No. Codex is a read-only data API: it returns token, wallet, holder and prediction-market data and writes nothing onchain. Pair it with an execution layer such as Moby, which lists Codex in its Agent Marketplace as a data add-on that never trades.

### Can an AI agent pay for Codex data without an API key?

Yes. Codex supports MPP (Machine Payments Protocol): the agent pays $0.001 per request in USDC on Tempo and gets the data back, with no Codex account or API key. MPP covers queries; WebSocket subscriptions and webhooks need an API plan. The Codex Skills walk the agent through setting it up.

### What is a compute unit?

Usage is metered in compute units. Every query, subscription message and delivered webhook costs a number of compute units based on the operation and the data it returns; the dashboard lists the base cost of each operation. Overage on Growth plans bills at the plan's rate plus 15%, from $115 to $138 per 1M compute units.

### What networks does Codex support?

80+ networks and counting, including Ethereum, Solana, Base, BNB Chain, Arbitrum, and Optimism, with new networks added regularly.

### What payment methods does Codex accept?

Card payments through the dashboard; enterprise customers can arrange invoicing.

### Is it easy to migrate to Codex?

Yes: the GraphQL API, TypeScript SDK, and comprehensive docs make migrations straightforward, and our team helps enterprise customers move over.
