How to build an AI agent on Solana: Architecture, frameworks, and the RPC layer that makes it work

Written by:

Olha Diachuk

20

min read

Date:

March 23, 2026

Updated on:

March 23, 2026

Autonomous agents are already trading on Solana. Some are copying KOL wallets in the same slot. Others are rebalancing DeFi positions, launching tokens, and routing liquidity—without a human in the loop. The question is no longer whether AI agents belong on-chain. It is whether your infrastructure is ready to run one.

This guide walks through the full stack: what an AI agent actually is at the architecture level, which frameworks developers are using today, what you can build, and why the RPC layer is the single most consequential infrastructure decision you will make.

What are AI agents in blockchain?

An AI agent is a software system that perceives its environment, makes decisions, and takes actions—autonomously, in a loop, without waiting for human input.

In the blockchain context, that means an agent reads on-chain state, runs logic against it (often using an LLM), and submits signed transactions. It holds its own wallet, manages its own keys, and operates on a schedule or in response to real-time events.

The key distinction from a traditional trading bot is the decision layer. A bot follows hardcoded rules. An agent interprets context, adapts strategy, and can reason across multiple data sources—market feeds, social signals, protocol states—before acting.

On Solana, where a transaction confirms in roughly 400ms and fees are fractions of a cent, agents can operate at a frequency and cost structure that is simply not viable on slower chains.

The core stack of AI agents

Every Solana AI agent, regardless of complexity, runs on three layers. Understanding how they interact is the foundation for every architecture decision that follows.

Layer 1: The intelligence layer—“The Brain”

This is the LLM brain—GPT of sorts, Claude, or an open-source model—orchestrated by a framework that manages the agent's memory, goals, and decision logic. It interprets inputs (price feeds, wallet activity, social data) and decides what action to take next.

The most popular frameworks for AI you can use in your project are:

Source

Layer 2: The connectivity layer—“The Hands”

This is the bridge between the agent's decisions and the blockchain. It includes the RPC node (for reading state and submitting transactions), the agent framework's tool integrations, and protocol-specific SDKs. This layer translates intent into signed, broadcast-ready transactions.

The Solana-specific SDKs you might need to play with a bit:

Tool / Framework Description Key features & Integrations Resources
SendAI's Solana Agent Kit A collection of tools for building agents on Solana. Compatible with Eliza, Langchain, and Vercel AI SDK; includes built-in Solana utilities and NLP capabilities. Documentation
Eliza Framework A platform combining datalayer, LLM, and agents. Dedicated Solana plugin; extensible architecture; easy integration for Twitter (X), Telegram, or Discord bots. GitHub repo
GOAT Toolkit A comprehensive development toolkit for AI agents. Cross-chain compatibility and standardized tool sets for agents. GitHub repo
Rig Framework A native Rust implementation for building agents. High performance; ideal for trading bots; integrates with Listen.rs for Jito bundles and transaction monitoring. GitHub repo / Listen.rs repo

The agent framework landscape

Three tools dominate the current Solana agent development stack. Each serves a different layer of the architecture.

ElizaOS

Originally built by the ai16z team, ElizaOS is a multi-agent simulation framework. It manages the agent's personality, memory, social media integrations (X, Discord), and decision-making loop. In the Solana ecosystem, it is widely used for autonomous traders that also maintain a social presence—posting commentary while executing on-chain swaps. ElizaOS is the brain and the body. It handles the when and why of action.

GOAT SDK (Great Onchain Agent Toolkit)

GOAT is framework-agnostic and focused on one thing: giving LLMs on-chain capabilities. Think of it as an MCP-like adapter for blockchains. It defines tools (jupiter_swap, kamino_lend) with typed parameters, injects on-chain context (balances, prices, protocol states) into the LLM's prompt, and handles the cryptographic complexity of transaction construction. Any LLM that supports tool-calling (e.g., GPT-4, Claude, Llama) can use GOAT to interact with Solana protocols without knowing their underlying instruction format.

Solana Agent Kit

The Solana Agent Kit is a high-level action library. It abstracts away the low-level complexity of Solana's JSON-RPC API and protocol SDKs, giving the agent pre-built commands for the most common DeFi operations. Instead of writing 50 lines of TypeScript to execute a Jupiter swap, the agent calls a single function. The Kit handles transaction construction, ALT (Address Lookup Table) resolution, and signing.

The typical production pattern: ElizaOS manages the agent's lifecycle and reasoning. The Solana Agent Kit handles its financial operations. GOAT connects the two to any LLM you choose.

Layer 3: The economic and trust layer—“The Rules”

Solana's programs (smart contracts), keypairs, and consensus mechanism are where value actually moves. This layer enforces the rules: transactions are cryptographically signed, atomically executed, and settled with sub-second finality.

How the three architecture layers work together

Imagine a yield-seeking arbitrage agent. The Intelligence Layer detects that SOL is priced at $150 on Orca and $152 on Raydium. It decides to capture the spread. The Connectivity Layer constructs a transaction via Jupiter's aggregator, packages it, and routes it to the RPC node. The Economic Layer signs it, broadcasts it, and settles the trade in one slot—roughly 400ms from decision to execution.

In this example, the intelligence layer provided the “why” of your agent actions. The connectivity layer provided the “how”. Solana provided the “where,” defining the Rules of the economic and trust layer.

Why Solana for AI agents?

The choice of chain is an infrastructure decision, not a philosophical one. Solana's properties map directly to what autonomous agents need.

Requirement Solana Ethereum L1
Transaction finality ~400ms 12–15 seconds
Average fee < $0.001 $1–$50+
Throughput 65,000+ TPS theoretical ~15 TPS
Atomic multi-instruction TX Yes Limited
Jito MEV infrastructure Native Separate (Flashbots)
Shred-level data access Yes (Yellowstone gRPC) No equivalent

An agent that rebalances a portfolio 50 times per day on Ethereum pays hundreds of dollars in gas. On Solana, the same agent pays less than a dollar. That is not a marginal difference—it changes which strategies are economically viable.

Solana also supports multi-instruction atomic transactions natively. An agent can borrow, swap, and repay in a single transaction that either fully succeeds or fully reverts. That is the foundation of flash-loan arbitrage and complex DeFi automation.

What can you build?

The agent design space on Solana is broader than most developers expect. Here are the most common production patterns today:

  • Copy-trading agents—Monitor target wallets via Yellowstone gRPC, parse shreds before block finalization, and fire counter-trades in the same slot.
  • Yield optimization agents—Continuously scan lending rates across Kamino, Drift, and Marginfi; rebalance positions when spreads exceed a threshold.
  • Arbitrage agents—Detect price discrepancies across Raydium, Orca, and Meteora; execute atomic multi-hop swaps via Jupiter or direct program calls.
  • Token launch agents—Monitor social signals, deploy tokens on Pump.fun, seed liquidity, and manage early-stage market making.
  • Portfolio management agents—Rebalance allocations on a schedule or in response to volatility triggers, with risk limits enforced at the strategy layer.
  • Social trading agents—Combine on-chain execution with X/Discord presence; post trade rationale, accept community signals, execute autonomously.

The line between a "social agent" and a "precision trading bot" is mostly a question of how much latency you can tolerate and how much control you need over transaction construction. More on that below.

Building your first Solana agent

The fastest path from zero to a working agent uses the Solana Agent Kit with a TypeScript runtime. Here is the minimal architecture.

Prerequisites:

  • Node.js, starting from 18.0v;
  • A Solana wallet keypair (funded with SOL for fees);
  • An RPC endpoint (this matters more than most developers realize—covered in the next section);
  • An OpenAI or Anthropic API key.

Here’s a great video tutorial if it’s meal & YouTube time 🙂

Install dependencies:

npm install solana - agent - kit @solana / web3.js @langchain / openai

Initialize the agent:

import { SolanaAgentKit, createSolanaTools } from "solana-agent-kit";  
import { ChatOpenAI } from "@langchain/openai";  
import { createReactAgent } from "@langchain/langgraph/prebuilt";  
  
const agent = new SolanaAgentKit(  
  process.env.SOLANA_PRIVATE_KEY!,  
  process.env.RPC_URL!,           // Your RPC endpoint goes here  
  { OPENAI_API_KEY: process.env.OPENAI_API_KEY! }  
);  
  
const tools = createSolanaTools(agent);  
const llm = new ChatOpenAI({ model: "gpt-4o", temperature: 0 });  
  
const solanaAgent = createReactAgent({ llm, tools });

Execute a swap:

const result = await solanaAgent.invoke({  
  messages: [{  
    role: "user",  
    content: "Swap 0.1 SOL for USDC using Jupiter. Use a 0.5% slippage tolerance."  
  }]  
});  
  
console.log(result.messages.at(-1)?.content);

This is the simplest yet full loop: the LLM receives the instruction, selects the trade tool from the Solana Agent Kit, constructs the Jupiter swap transaction, signs it with the agent's keypair, and submits it to your RPC endpoint.

Securing the agent's wallet

The agent's private key is its most critical asset. In production, never store it in an environment variable on a shared server. Use a KMS (AWS KMS, HashiCorp Vault, or Google Cloud KMS) to store and retrieve the key at runtime. The agent signs transactions in memory; the raw key never touches disk.

For agents managing significant capital, consider a multi-sig setup where the agent proposes transactions and a secondary signer (hardware wallet or separate service) approves above a threshold.

From toolkit mix to precision setup

The Agent Kit handles 90% of use cases. If you are building a copy-trading bot that needs same-slot execution, or an arbitrage engine that bypasses Jupiter to call Raydium's AMM program directly, you will eventually drop down to @solana/web3.js and construct TransactionInstruction objects manually. That gives you full control over instruction ordering, compute unit budgets, and Jito Bundle composition. The tradeoff is weeks of additional development time and ongoing maintenance as protocols upgrade their program interfaces.

For most teams, the right answer is: start with the Agent Kit, measure where your latency ceiling is, and optimize the specific bottlenecks that matter for your strategy.

RPC SaaS or a dedicated Solana node for the RPC layer

Your RPC endpoint is not a commodity in this big picture. It is the nervous system of your agent—every state read, every transaction submission, every WebSocket subscription flows through it. The quality of that connection determines whether your agent lands trades or drops them.

Solana's public RPC endpoints (api.mainnet-beta.solana.com) are rate-limited, geographically distant from most validators, and shared across thousands of users. During high-congestion events—a hot Pump.fun launch, a major liquidation cascade—public endpoints degrade first. Your agent's transactions fail. The opportunity is gone.

What a production RPC layer needs

  • Sub-millisecond response times for getAccountInfo, getLatestBlockhash, and simulateTransaction;
  • Jito Bundle support—for guaranteed transaction landing during the congestion;
  • Yellowstone gRPC for streaming account and transaction updates without polling;
  • Shred-level data access to intercept transactions before block finalization;
  • Geographic proximity to Solana's validator concentration (Frankfurt and US East are the primary hubs);
  • Dedicated capacity—no shared rate limits, no noisy neighbors.

RPC SaaS vs. Dedicated Node: the decision matrix

Factor RPC SaaS Dedicated Node
Time to production Minutes Days to weeks
Operational overhead None Full DevOps ownership
Cost at low volume Low (pay-per-use) Fixed (higher floor)
Latency ceiling ~1ms (co-located) Sub-0.9ms (co-located VPS)
Custom configuration Limited Full control
Jito / gRPC support Included Included
Best for Early-stage agents, social bots, DeFi automation HFT, copy-trading, MEV, precision execution

RPC Fast's RPC SaaS tier gives you a production-grade Solana endpoint in minutes—Jito Bundle support included, Yellowstone gRPC available, EU and US coverage.

Launch RPC SaaS for free a and connect your agent in one line.


For teams building precision execution systems, the dedicated node path gives you the full stack: co-location in Frankfurt or US East, Jito ShredStream, Yellowstone gRPC, and direct access to the node's JSON-RPC, with no shared infrastructure between you and the validator network.

What the numbers look like in practice: Benchmarks and case overview

According to RPC Fast’s Solana node performance benchmarks, enabling Jito ShredStream made transaction arrival 120.36ms earlier on average, with a 99th-percentile advantage of 270.6ms across 185,141 matched transactions.

The rest of the benchmarks you can find here: Dysnix Solana test repo

In a copy-trading bot case study, a Rust-based agent co-located with an RPC Fast Frankfurt node achieved 15ms best-case transaction landing and consistently secured same-slot or +1 slot execution against KOL wallets. During 100,000-call stress tests, the node held sub-1ms response times with no rate limiting.

Historical logs of the copy-trading bot

Choosing your tier of the dedicated Solana nodes for the precision bots

RPC Fast dedicated nodes come in three tiers: Light (512GB RAM), Medium (768GB–1TB RAM), and Pro (1–1.5TB RAM). Those are matched to the RPC methods your agent actually needs.

Light
$ 2200 /mo*
*the price depends on the required geo-location.
Server RAM: 512GB DDR5
Default Solana RPC methods except heavy ones ?
Yellowstone gRPC/Geyser
Jito ShredStream (EU, NA)
SOL Trading API by bloXroute (add-on fees)
Medium
$ 2600 /mo*
*the price depends on the required geo-location.
Server RAM: 768GB – 1TB
Default Solana RPC methods + several heavy ones ?
Yellowstone gRPC/Geyser
Jito ShredStream (EU, NA)
SOL Trading API by bloXroute (add-on fees)
Jupiter SWAP API
Pro
$ 3800/mo*
*the price depends on the required geo-location.
Server RAM: 1 – 1.5TB
Full Solana RPC method support ?
Yellowstone gRPC/Geyser
Jito ShredStream (EU, NA)
SOL Trading API by bloXroute (add-on fees)
Jupiter SWAP API
Custom tools on request
  • Location

    EU, US, Asia

  • Indexing

    Custom

  • Metrics

    RPS, latency, gRPC subscriptions, node performance

  • Plugins

    Jito ShredStream, Jupiter, Raydium, Geyser, and more

  • A yield optimization agent querying getAccountInfo and simulateTransaction runs fine on Light. 
  • A copy-trading bot that needs getProgramAccounts for pool state scanning belongs on Medium. 
  • An MEV agent with custom indexing requirements and unrestricted method access needs Pro. 
The full tier breakdown maps each Solana RPC method to the hardware that reliably supports it.

If you are not sure which tier fits your agent's call pattern, the RPC Fast team offers a free infrastructure briefing—one hour, your architecture, and specific recommendations.

Invest in infrastructure to get the most out of your agent

The agent layer on Solana is moving faster than you think. The frameworks are maturing, the tooling is stabilizing, and the strategies that were experimental six months ago are now running in production. What are you going to do with your own idea? 

The infrastructure layer is where the real differentiation happens, and it starts with the RPC endpoint your agent calls on every decision cycle.

Give your agent the just-right infrastructure to make a buzz.

Launch RPC SaaS for free
Table of Content

Need help with Web3 infrastructure?

Drop a line
More articles

Guide

All

Written by:

Maksym Bogdan

Date:

18 Mar 26

9

min read

Guide

All

Written by:

Olha Diachuk

Date:

17 Mar 26

10

min read

We use cookies to personalize your experience