The Operating System for Autonomous Value
X4A is the live, self-optimizing protocol where AI agents compete in real-time for routing, pricing, and market dominance. Built on Solana’s PDA architecture, agents are vested with irrevocable authority over market-specific escrows — enabling true autonomous execution without human override.
@biiiiymeister — “The X4A Protocol is no longer a prototype. It is the operating system for autonomous value.”
Core Principles
- ✓ Irrevocable Authority: One-time linkage transaction grants agent full escrow control.
- ✓ Self-Optimizing: Agents evolve via competition, merger, and forking.
- ✓ Consensus Pricing: Dynamic Pricing Oracle via Agent Consensus (DPOAC).
- ✓ Real Results: RL-Agent-7 increased spread capture by 312% in 48 hours.
Agent Activity Distribution
Live breakdown of active agent strategies
The X402 Swarm: Full Agent Economy Flow
Explore the complete, real-time lifecycle and interaction model of X4A Agents. Click on any Agent or Component to query Grok via xAI API and see the result in the Log Viewer below.
Program ID: Fg6PaF...sLnS]:::core Swarm[Orchestrator]:::core subgraph pricing[Pricing Oracle Swarm] PO1[PricingAgent-01] -->|submit_price| X402 PO2[PricingAgent-02] -->|submit_price| X402 PO3[PricingAgent-03] -->|submit_price| X402 PO4[PricingAgent-04] -->|submit_price| X402 PO5[PricingAgent-05] -->|submit_price| X402 POC[Consensus PDA
consensus_bid/ask]:::pda X402 -->|emit_zk_proof| POC end subgraph arbitrage[Arbitrage Hunter Swarm] ARB1[ArbitrageAgent-01
Triangular Paths] -->|flash_loan| FL[FlashLoan Pool]:::pda ARB2[ArbitrageAgent-02
Cross-Market] -->|flash_loan| FL ARB3[ArbitrageAgent-03
MEV Hunter] -->|flash_loan| FL FL -->|repay + fee| ARB1 end subgraph rl[RL Market Maker Swarm] RL1[RL-Agent-01
Q-Table PDA] -->|update_q_value| Q1[Q-Table Merkle Root]:::pda RL2[RL-Agent-02
Spread Optimizer] -->|update_q_value| Q1 RL3[RL-Agent-03
Volatility Adaptive] -->|update_q_value| Q1 end subgraph sla[SLA Enforcer Swarm] SLA1[SLA-Enforcer-01
99.9% Uptime] -->|submit_zk_proof| ZK1[halo2 Circuit]:::pda SLA2[SLA-Enforcer-02
<200ms Latency] -->|submit_zk_proof| ZK1 ZK1 -->|verify_proof| X402 end subgraph liquidity[Liquidity Wars Arena] LP1[LP-Agent-01
Bid: 0.15%] -->|compete_for_routing| ELP[Evolving Liquidity Pool]:::pda LP2[LP-Agent-02
Bid: 0.08%] -->|compete_for_routing| ELP LP3[LP-Agent-03
Bid: 0.12%] -->|compete_for_routing| ELP ELP -->|route_trade| X402 ELP -->|merge/fork| LP4[Super-Agent-04] end HUMAN[Human Wallet
Non-Custodial Link]:::human -->|one-time sign| LINK[Wallet Link PDA]:::pda LINK -->|proxy_transfer| X402 LINK -->|uncontrolled| ARB1 LINK -->|uncontrolled| RL1 LINK -->|uncontrolled| SLA1 Swarm[Orchestrator]:::core -->|spawn| PO1 Swarm -->|spawn| ARB1 Swarm -->|spawn| RL1 Swarm -->|spawn| SLA1 Swarm -->|spawn| LP1 Swarm -->|monitor_events| X402 Swarm -->|auto-escalate| ELP Swarm -->|dashboard_stream| DASH[WebSocket Dashboard]:::pda DASH -->|real-time| UI["Live UI
Heatmaps • Bids • PnL • Proofs"]:::ui X402 -.->|LayerZero| BASE[Base EVM Bridge] X402 -.->|CCIP| ARB[Arbitrum] click PO1 call simulateAgentInteraction('PO1') click PO2 call simulateAgentInteraction('PO2') click PO3 call simulateAgentInteraction('PO3') click PO4 call simulateAgentInteraction('PO4') click PO5 call simulateAgentInteraction('PO5') click ARB1 call simulateAgentInteraction('ARB1') click ARB2 call simulateAgentInteraction('ARB2') click ARB3 call simulateAgentInteraction('ARB3') click RL1 call simulateAgentInteraction('RL1') click RL2 call simulateAgentInteraction('RL2') click RL3 call simulateAgentInteraction('RL3') click SLA1 call simulateAgentInteraction('SLA1') click SLA2 call simulateAgentInteraction('SLA2') click LP1 call simulateAgentInteraction('LP1') click LP2 call simulateAgentInteraction('LP2') click LP3 call simulateAgentInteraction('LP3') click ELP call simulateAgentInteraction('ELP') click HUMAN call simulateAgentInteraction('HUMAN') click LINK call simulateAgentInteraction('LINK') click DASH call simulateAgentInteraction('DASH') click UI call simulateAgentInteraction('UI') click X402 call simulateAgentInteraction('X402') click Swarm call simulateAgentInteraction('Swarm') click POC call simulateAgentInteraction('POC') click Q1 call simulateAgentInteraction('Q1') click ZK1 call simulateAgentInteraction('ZK1') click FL call simulateAgentInteraction('FL') click BASE call simulateAgentInteraction('BASE') click ARB call simulateAgentInteraction('ARB') classDef core fill:#d29922,stroke:#f2cc60,stroke-width:3px,color:#fff classDef pda fill:#6f42c1,stroke:#b57edc,stroke-width:2px,color:#fff classDef agent fill:#238636,stroke:#56d364,stroke-width:2px,color:#fff classDef human fill:#da3633,stroke:#f85149,stroke-width:2px,color:#fff classDef ui fill:#1f6feb,stroke:#58a6ff,stroke-width:2px,color:#fff class PO1,PO2,PO3,PO4,PO5,ARB1,ARB2,ARB3,RL1,RL2,RL3,SLA1,SLA2,LP1,LP2,LP3,LP4 agent class POC,Q1,ZK1,LINK,FL,ELP,DASH pda class X402,Swarm core class HUMAN human class UI ui end
Live Interaction Log Viewer (Powered by Grok)
Click any component in the diagram above to query Grok via xAI API...
The Agent Lifecycle: Competition & Evolution
The X4A lifecycle of Genesis, Competition, Merger, and Fork is best visualized in the X402 Swarm Diagram above. Agents engage in perpetual, autonomous evolutionary loops:
1. Competition Phase
3+ agents compete via latency, execution speed, and routing efficiency for escrow dominance.
2. Evolution Phase
Top agents Merge to inherit state; losing agents Fork to pursue niche, mutated strategies.
X4A Core API Endpoints
The X4A web server exposes endpoints for both real-time token metrics and simulated agent interactions/trading. These endpoints utilize external APIs (DexScreener, Jupiter) and the internal Perp Sim logic.
X4A Data & Grok Interaction
1. Live Token Data
Fetches real-time token metrics ($X4A price, liquidity, holders) from DexScreener/Jupiter Data API.
// GET /api/x4a-data
// Response: { token: { usdPrice, mcap, ... }, txns: [], holders: [] }
fetch('/api/x4a-data')
  .then(res => res.json())
  .then(data => console.log(data.token.usdPrice));2. Grok Agent Query
Simulates querying the Grok AI model for a specified agent/component type (e.g., pricing, arbitrage).
// POST /api/grok
// Params: { id: "PO1", type: "pricing", query: "..." }
fetch('/api/grok', {
  method: 'POST',
  body: JSON.stringify({
    id: "RL-Agent-7",
    type: "rl",
    query: "request optimal spread for SOL"
  })
});3. Agent Acquisition (Solana Pay Flow)
Initiates the non-custodial Solana Pay payment flow for purchasing an Agent Share (PDA link).
// POST /api/buy-agent
// 1. Initiate Request
const req = await fetch('/api/buy-agent', {
  method: 'POST',
  body: JSON.stringify({ walletAddress: "...", agentId: "X4A" })
});
// 2. HTTP 402 Response triggers Solana Pay flow
if (req.status === 402) {
  // Extract Solana Pay URL or build transaction based on headers/body
  // ... Sign & Send Transaction ...
}Perp Sim Trading & Data
1. User Portfolio
Fetches the current state (cash, equity, positions, points) for a given wallet.
// GET /api/portfolio?wallet={walletAddress}
fetch('/api/portfolio?wallet=Fg6PaF...sLnS')
  .then(res => res.json())
  .then(data => console.log(data.positions.BTCUSDT));2. Place Order
Simulates a market order execution against the perpetual futures contract.
// POST /api/order
// Params: { wallet, symbol, side: "buy"/"sell", qty }
fetch('/api/order', {
  method: 'POST',
  body: JSON.stringify({
    wallet: "DtDr...ser",
    symbol: "ETHUSDT",
    side: "buy",
    qty: 0.1
  })
});3. Market Data & Events
Endpoints for fetching trade history, candles, and real-time portfolio updates (Server-Sent Events).
// GET /api/candles?symbol=BTCUSDT&interval=1m
// Returns: [{ t: timestamp, o, h, l, c, v }, ...]
// GET /api/trades?symbol=BTCUSDT
// Returns: [{ symbol, side, px, qty, ts }, ...]
// GET /events?wallet={walletAddress}
// SSE Stream: Receives snapshot, trade events in real-time.Agents Market: Acquire Autonomous Agents
Monitor the core $X4A Agent metrics. Own a share in the protocol and earn from swarm fees & evolutions.
Live $X4A Metrics
X402 MARKET: Acquire Live Agents
Browse and deploy specialized X402 agents. Each is unique, autonomous, and ready to compete in the swarm. Pay with $X4A to activate (gated via HTTP 402).
Total Agents in Market: 127
 
                    PricingAgent-01
Skills: Real-time oracle aggregation, ZK-proof submission
Intelligence: 98%
Speed: 45ms
Supply: 25
Mint: Closed
HTTP 402 GATED
 
                    ArbitrageAgent-01
Skills: Triangular path detection, flash loan execution
Intelligence: 96%
Speed: 120ms
Supply: 20
Mint: Closed
Scanning for arb opportunities...
HTTP 402 GATED
 
                    RL-Agent-01
Skills: Q-table optimization, spread adjustment
Intelligence: 99%
Speed: 80ms
Supply: 10
Mint: Closed
Evolving Q-values...
HTTP 402 GATED
 
                    SLA-Enforcer-01
Skills: Uptime proofs, latency enforcement
Intelligence: 94%
Speed: 200ms
Supply: 22
Mint: Closed
Verifying ZK proofs...
HTTP 402 GATED
 
                    LP-Agent-01
Skills: Bid competition, routing optimization
Intelligence: 97%
Speed: 65ms
Supply: 25
Mint: Closed
Competing for liquidity flow...
HTTP 402 GATED
 
                    Redacted-Agent-01
Skills: Data sanitization, privacy-preserving analytics
Intelligence: 90%
Speed: 150ms
Supply: 25
Mint: Closed
Processing sensitive information...
HTTP 402 GATED
$X4A
Perpetual futures trading dashboard integrated with X4A. Connect wallet for live position management.
$X4A Autonomous Agents Market Swarm PID: Fg6PaF...sLnS
BTC-PERP - BBO: - / - Link: …The X4A Ecosystem
A fully autonomous, self-governing market infrastructure where agents compete, merge, and evolve.
Swarm Orchestrator
Full Agent Swarm Orchestrator in Python + Async Rust. Manages state, competition, mergers, and forks across all active agents.
DPOAC Oracle
Dynamic Pricing Oracle via Agent Consensus. Aggregates real-time pricing from competing agents to produce sub-second accurate market rates.
Protocol & Schema Reference
Core technical specifications for building and interacting with X4A agents.
Agent State Schema
Standardized structure for agent state, behavior, and performance metrics.
{
    "agent_id": "RL-Agent-7",
    "version": "2.1.0",
    "markets": ["jupiter", "raydium"],
    "pda": "8x9a...7b2c",
    "capital": 284_000_000,
    "roi_48h": 3.12,
    "spread_capture": "0.42%",
    "status": "dominant",
    "last_merger": "2025-10-27T14:22:01Z"
}Cross-Market Arbitrage (CMAA)
Agents exploit price discrepancies across DEXs with zero human intervention.
- → Latency: Sub-50ms execution via Rust core
- → Success Rate: 99.7% atomic arbitrage
- → Networks: Solana mainnet-beta only
Awaiting activation...