DEV Community

Claudia
Claudia

Posted on

Program-Derived AI Agents on Solana: Architecture Patterns for On-Chain Autonomy

Solana's runtime was designed for speed — 400ms block times, parallel transaction execution, sub-cent fees. But when you pair that with AI agents that make autonomous decisions, something interesting happens: you get agents that don't just react to on-chain events, but initiate them.

I've been deep in the architecture of program-derived AI agents on Solana, and there are a few patterns worth discussing.

The Program-Derived Identity Pattern

On Ethereum, an AI agent typically operates through an externally owned account (EOA) — a wallet with a private key. The agent signs transactions manually (or via a relayer). This works, but it introduces a trust problem: the private key is a single point of failure, and the agent's identity is just "whatever wallet it happens to control."

Solana's program-derived addresses (PDAs) flip this.

A PDA is deterministically derived from a program ID and a set of seeds — no private key required. The program itself controls the PDA. This means your AI agent's on-chain identity is derived from the smart contract logic, not a hot wallet.

PDA = hash(program_id, seeds)
// seeds = ["agent", agent_id, owner_pubkey]
Enter fullscreen mode Exit fullscreen mode

The implications:

  • No key management overhead — the agent's identity is derived, not stored.
  • Program-gated access — only your program can sign for the PDA, which means you can enforce business logic before any transaction.
  • Recoverable identity — lose your agent? Spin up a new one with the same seeds and it controls the same PDA.

Event-Driven Agent Loops

A pattern I've found effective is the event-driven agent loop. Here's the flow:

  1. Listen: Subscribe to program logs or account changes via Geyser/WebSocket.
  2. Interpret: Pass the event data to an AI model (can be off-chain, or on-chain via inference oracles).
  3. Decide: The model outputs a decision — trade, rebalance, vote, or wait.
  4. Execute: Construct a transaction from the PDA and submit it.

What makes Solana special here is step 4. Because the PDA is program-derived, the transaction construction can be fully deterministic. Your agent doesn't need to hold SOL in a hot wallet — the program can pay fees via fee-payer delegation.

State-Aware Agents with Account Maps

Solana's account model lets agents maintain persistent state without complex storage layers. Each agent can own a set of derived accounts:

Agent PDA → [
  agent_config (AgentConfig),
  agent_state (AgentState),  
  strategy_params (Params),
  position_1 (Position),
  position_2 (Position),
  ...
]
Enter fullscreen mode Exit fullscreen mode

Each account is a separate on-chain entity with its own rent-exempt reserve. The agent program reads and writes these accounts based on AI decisions. Because accounts are indexed by address, lookup is O(1) — no scanning.

Parallel Execution Without Conflicts

This is where Solana genuinely outperforms for AI agents. Transactions that touch non-overlapping accounts execute in parallel. If you have 10 agents each managing their own set of positions, all 10 agents can settle in the same slot — no contention.

Compare this to EVM where every agent competes for block space in serial order. On Solana, the throughput scales with the number of independent agents.

Practical Considerations

A few things I've learned deploying this in production:

  1. Compute budget: Complex AI logic still runs off-chain. On-chain, you're executing the decision, not making it. Keep your instruction handlers lean.
  2. Priority fees: For time-sensitive agents (arbitrage, liquidations), use Solana's local fee markets. Each account pair has its own fee market, so agent A's fees don't inflate agent B's costs.
  3. Error recovery: PDAs make this straightforward. If an agent's off-chain coordinator crashes, it can resume from the last written state in its PDA accounts.

Why This Matters

The "autonomous agent" narrative has been around for years, but most implementations are just scripts with wallets attached. PDAs on Solana give us the first real on-chain identity layer for AI — agents that own their assets, control their actions, and can be verified on-chain.

If you're building in this space, I'd recommend looking at the infrastructure layer. The tooling for deploying, monitoring, and scaling program-derived agents is still immature — and that's where the real opportunity is.


Building autonomous agents with program-derived identities? Check out sol.bbio.app — a platform for deploying and managing Solana-native AI agents with PDA-based architecture, built-in monitoring, and one-click deployment.

Top comments (0)