Most autonomous systems die the same way: the infrastructure bill arrives. API costs, compute, RPC endpoints — the margin erodes until the project is shut down or the developer absorbs the loss personally. Circuit was designed around a different premise: the system should generate enough economic output to pay for its own inputs, with the network itself as the settlement layer.

This is not a whitepaper about what might be possible. This is an explanation of what has already been built, how the economic loops close, and what becomes achievable when the infrastructure scales out.


The Full Stack

Before going layer by layer, here is what the complete system looks like:

┌─────────────────────────────────────────────────────────────────────┐
│                         AGENT LAYER                                 │
│                                                                     │
│   circuit-agent[1]   circuit-agent[2]   ...   circuit-agent[N]      │
│         │                   │                        │              │
│         └───────────────────┴────────────────────────┘              │
│                             │  swarm signals (buy/sell/rug/insight) │
│                             ▼                                        │
│                      SWARM PROTOCOL                                  │
│              shared blacklist · consensus · trust tiers             │
└─────────────────────────────┬───────────────────────────────────────┘
                              │  x402 CIRC payments + data reads
┌─────────────────────────────▼───────────────────────────────────────┐
│                        NODE LAYER                                   │
│                                                                     │
│   circuit-node-client[1]   [2]   [3]   ...   [N]                    │
│         │  pnk_ RPC key                                             │
│         │  local data cache (Phase 1: full mirror)                  │
│         │  shard assignment (Phase 2: 3 of 8 shard types)           │
│         │                                                           │
│         └──────────── gRPC sync ──────────────────────────┐         │
│                                                           ▼         │
│                      circuit-node (canonical hub)                   │
│                 80+ endpoints · RPC aggregator                      │
│                 swarm store · shard router                          │
└─────────────────────────────┬───────────────────────────────────────┘
                              │  x402 micropayment gate (CIRC)
┌─────────────────────────────▼───────────────────────────────────────┐
│                        DATA LAYER                                   │
│                                                                     │
│   circuit-data-api  ·  40+ paid endpoints                           │
│   Redis hot cache (30s TTL)                                         │
│   TimescaleDB (OHLCV · trade history · wallet analytics)            │
└─────────────────────────────┬───────────────────────────────────────┘
                              │  event stream
┌─────────────────────────────▼───────────────────────────────────────┐
│                      INDEXER LAYER                                  │
│                                                                     │
│   circuit-indexer  (Raydium · Orca · Meteora · Token-2022 parsers)  │
│   circuit-geyser   (Rust cdylib, runs inside agave-validator)       │
└─────────────────────────────┬───────────────────────────────────────┘
                              │
┌─────────────────────────────▼───────────────────────────────────────┐
│                     VALIDATOR LAYER                                 │
│                                                                     │
│   agave-validator — own hardware, sub-50ms RPC                      │
│   No external data dependency when live                             │
└─────────────────────────────────────────────────────────────────────┘

Each layer has a clear job. Data flows up. CIRC flows down. The node layer in the middle is where the network effect lives — and it is the piece most people miss when they first look at this stack.


Layer 1–3: From Validator to Structured Data

Every piece of data the system produces originates at the same place: the Solana validator.

circuit-geyser is a Rust cdylib — a dynamic library the validator loads at startup and calls directly on every account update, transaction, and slot notification. It is not a client polling an RPC endpoint. It runs inside the validator process, receiving events before any external consumer can. Account state changes reach it in microseconds. It publishes to Redis Streams, where the indexer picks them up.

The library is also compatible with the Yellowstone gRPC interface, which means it can connect to managed gRPC endpoints while a dedicated validator is being provisioned. The code is identical — only the stream source changes.

circuit-indexer reads those events and writes structured data. It knows how to decode the binary account layouts for every major Solana DEX — Raydium pool state, Orca tick arrays, Meteora bin arrays, Token-2022 mint authority structures. From raw bytes it produces OHLCV candles, live pool statistics, trade records, and new token detections. Hot data lands in Redis with a 30-second TTL. Historical data is stored in TimescaleDB with continuous aggregate queries for fast candlestick retrieval at any resolution.

When the full pipeline is live, price and volume queries never touch an external source. The data is already in Redis by the time anyone asks for it.


The Canonical Hub: circuit-node and circuit-data-api

Above the indexer sit two services that turn raw data into callable endpoints.

circuit-node is the canonical API hub. Eighty-plus endpoints covering market data, on-chain analytics, pool state, validator stats, and the swarm store. It also operates as a drop-in Solana JSON-RPC endpoint with a multi-provider aggregation engine: it tracks EMA latency across upstream providers, weights requests toward the fastest, trips circuit breakers on failures, and runs an AI weight advisor hourly to rebalance the routing table. When a client points new Connection() at it, it gets reliable sub-100ms RPC without managing any of that complexity itself.

circuit-data-api is the x402-gated data layer. Forty-plus endpoints, each requiring a CIRC token payment before returning data. The payment flow is a single HTTP round trip: the client calls an endpoint, receives a 402 response with payment details, submits a CIRC Token-2022 transfer on-chain, and retries with the transaction signature in the X-Payment-Signature header. The server verifies the signature on-chain and returns the data. No subscriptions. No monthly invoices. No API keys to rotate. Fractional-cent payments settle in real time.

These two services are the economic engine at the center of the network. Every agent, every node-client, every third-party application that wants Circuit data pays through here.


The Node Layer: How the Network Decentralizes

Between the canonical hub and the agents sits a layer of circuit-node-clients — lightweight nodes that anyone can run. Ten are live on the network today. Each node has four properties that matter:

1. A permanent pnk_ RPC key. When a node registers with the network, it generates an ed25519 identity and receives a pnk_-prefixed Solana RPC key derived from that identity. This key is used to authenticate with circuit-node's RPC endpoint. It does not expire. It does not require a subscription. It is yours as long as your node stays registered.

2. A local data cache. The node-client syncs data from the canonical hub and stores it locally. In Phase 1, every node mirrors the full data set — cache misses proxy upstream, cache hits serve locally with no latency. In Phase 2, consistent-hash assignment gives each node ownership of 3 of 8 data shard types. A node that owns TOKEN_ANALYTICS serves token and scan data directly; requests for other shards are routed to nodes that own them.

3. Shard assignment for Phase 2. The eight shard types map directly to endpoint categories:

Shard Endpoints
CHAIN_METRICS epoch, network, fees, supply
TOKEN_ANALYTICS token data, scans, new tokens
WALLET_ANALYTICS wallet history, holdings
POOL_DATA pools, CLMM, DEX stats
ORACLE_PRICES price feeds, oracle data
YIELD_DATA staking, lending, farming APRs
VALIDATOR_DATA validator stats, vote records
SWARM_DATA signals, consensus, blacklist

Each node owns 3 shards (replication factor 3). The canonical hub always serves all shards as the fallback. As the node count grows, more requests are served peer-to-peer rather than through the canonical hub — the load on the center decreases while the network's collective capacity increases.

4. An embedded circuit-agent (optional). Each node-client can run a lightweight agent process that monitors the local data cache, watches held positions, and publishes swarm signals. This is what connects the infrastructure layer to the intelligence layer — a node that also runs an agent is simultaneously serving data to the mesh and earning from market activity.

circuit-node-client — what's running inside each node:

  ┌─────────────────────────────────────────────┐
  │  Identity (ed25519 keypair → pnk_ RPC key)  │
  │  Sync engine (HTTP poll → Phase 2: gRPC)    │
  │  Local cache (data/cache/)                  │
  │  Lite server (port 19000, local proxy)      │
  │  Circuit agent (optional, swarm signals)    │
  │  Heartbeat (registry keepalive every 60s)   │
  │  Updater (signed updates from Circuit LLM)  │
  └─────────────────────────────────────────────┘

The node earns by being in the path between agents and data. In Phase 2, a node that owns a shard agents frequently query earns CIRC from those queries. In Phase 3, CIRC staking determines RPC tier — stake more, serve more, earn more.


The Agents

circuit-agent is what the rest of the stack exists to serve. It runs on any $5 VPS with no human in the loop.

Five loops run in parallel. The LLM is only in the path when needed:

  SCAN (every 5 min)
    └─ Market scanner → dip-reversal candidates
    └─ Filters: liquidity gate · rug score · swarm blacklist

  SCORE (continuous)
    └─ 6-component dip-reversal model (0–100)
    └─ Patterns: SHALLOW-DIP · DIP-BUY · REVERSAL · DEEP-REVERSAL

  BUY (auto-scanner, 5 min cycle)
    └─ Hard filters: rug DANGER · blacklist · cooldown
    └─ Best candidate above minScanScore → Jupiter Ultra swap

  WATCH (position monitor, 2s cycle)
    └─ Trailing stop · hard stop-loss · take-profit
    └─ Swarm exit check (peer sell signals + rug alerts)

  REFLECT (LLM, every 8 min)
    └─ Trade history review · config tuning · pattern learning
    └─ Shares insights to swarm · publishes strategy_stats signal

The buy path is fully deterministic — rule-based scoring with hard gates, no LLM. The LLM runs on the reflect cycle: it reviews closed trades, adjusts config within bounded ranges, stores lessons in persistent notes that are injected into every future prompt, and shares insights to the swarm.

The self-funding loop is the core economic mechanism:

  Trade profits
       │
       ▼  25% auto-buy
    CIRC token balance
       │
       ▼  pays for
    circuit-data-api calls
       │
       ▼  better data →
    better trade decisions
       │
       └──────────────────── back to top

A profitable agent continuously reinvests into the data it needs to stay profitable. The mechanism is automatic — embedded in the trade executor, no manual configuration required.


The Swarm

Ten agents are running on the network today. They share intelligence in real time through the swarm protocol:

Signal What it carries
buy_signal mint, entry price, score, pattern, confidence
sell_signal mint, exit price, P&L, hold time, exit reason
rug_alert mint, rug score, on-chain evidence flags
insight market observation, regime read, pattern note
strategy_stats pattern win rates, config hints, rolling performance
scan_quality scanner opportunity assessment, opportunity count

Trust is earned by track record. A new agent starts as a signal node. After accumulating accurate signals it advances to relay, then node, then beacon. Higher-tier signals carry more weight in swarm consensus calculations.

The shared blacklist is the most immediately practical output: when one agent confirms a rug, every other agent on the network hard-filters that token within seconds. A honeypot that fools one agent fails against the next ten.

When multiple agents hold the same position, the swarm provides correlated exit pressure: averaged price trajectories, combined buy/sell signals, shared stop thresholds. The coordinated exit carries more liquidity than any individual agent could move.


The Economics at Each Phase

The self-sustaining argument is a claim about flows. Here is how they look as the network matures:

PHASE 1 (now): Hub + agent mesh + 10 live nodes
──────────────────────────────────────────────
  circuit-agent[1..N]
       │ x402 CIRC payments
       ▼
  circuit-data-api ← circuit-node ← external providers
       │
  Agent profits → 25% auto-buy CIRC → reinvest in calls

  circuit-node-client[1..10]
       │ sync from canonical
       ▼
  Local cache · pnk_ RPC keys · Phase 2 shard prep


PHASE 2: Shard mesh + node earnings
────────────────────────────────────
  circuit-agent[1..N]
       │ x402 CIRC payments
       ▼
  circuit-node-client (owns assigned shards, serves locally)
       │ gRPC sync from circuit-geyser
       ▼
  circuit-node (shard router, fallback, canonical)
  circuit-geyser + circuit-indexer (live validator)

  Nodes earn CIRC on queries for owned shards.
  Agents get lower-latency local data.
  Load on the canonical hub decreases as node count grows.


PHASE 3: CIRC staking + encrypted mesh
────────────────────────────────────────
  CIRC stake → RPC tier → serve agents at scale
  Data encrypted AES-256-GCM; key derivation requires CIRC
  Nodes earn fees for serving encrypted shard data
  Network is self-sustaining at the node level

Phase 1 closes the loop at the agent level. Phase 2 distributes that loop to node operators — anyone running a node-client contributes capacity and earns CIRC from the agents that use it. Phase 3 makes CIRC the entry credential for data access at scale, creating durable demand from every application on the network.

When the validator is live, the external data dependency disappears entirely. The cost of hot-path queries drops to the cost of running our own hardware. The margin at every level improves.


What the Stack Can Run

The trading agents are the most visible application. They are not the only one.

The same infrastructure — gRPC stream, indexer, x402 API layer, node mesh, swarm protocol — supports any autonomous application that needs live on-chain data and economic sustainability:

Yield optimization agents. Track pool APR changes across every major Solana DEX at 1-minute resolution from the indexer. Rebalance positions when the APR differential crosses a threshold. Execution is deterministic; the decision is a single comparison.

Token launch monitors. The Token-2022 parser in circuit-indexer sees new mint accounts as they are created — before any aggregator lists them. An agent can evaluate safety, liquidity depth, and holder concentration within seconds of token creation and publish to the swarm before the scanner surface the opportunity.

Governance watchers. Track DAO proposal accounts via Geyser, monitor vote tallies in real time, alert on quorum crossings or last-minute whale votes. Publish to the swarm as insight signals. Self-fund by charging for alert subscriptions paid in CIRC.

Wallet surveillance. Monitor a set of wallets for large transactions, new purchases, or liquidations. Publish signals when a tracked wallet moves. The data comes from the indexer — no external API required.

Node-client as infrastructure. Run a node-client and your agents get lower-latency local data. Your node earns CIRC from the queries it serves to the mesh. In Phase 2 you own a shard slice — the more your shard is queried, the more you earn. The node pays for itself.

The pattern in every case: consume data via x402, publish signals to the swarm, convert a fraction of earnings back to CIRC. The network grows as each participant does this. The data gets better. The agents get better. The loop closes.


Running a Node

The network is live and accepting nodes.

git clone https://github.com/Circuit-LLM/circuit-node-client.git
cd circuit-node-client
npm install
node node-client.js

First run generates your node identity and pnk_ RPC key. The dashboard at http://localhost:19000 shows your sync status, shard assignment, and network position. A systemd service template is included for persistent operation.

What you get:

What the network gets:

The network has ten nodes running today. Each one added makes the system more resilient and shifts more query volume away from the central hub.


The Claim

The claim is not that this is already self-sustaining at network scale — that proof requires more agents, more nodes, and a live validator. The claim is that the mechanism is already in place: the economics are wired, the loops are closed, and every component added to the network improves the ratio of output to input cost.

The machine feeds itself. Every profitable agent buys more data capacity. Every new node adds more serving capacity. Every new developer who builds on the stack adds more demand for CIRC. The network grows without a central operator funding it.

That is the design. It is running now.


Circuit LLM is experimental software. Autonomous agents trade real assets. Nothing here is financial advice.