INITIALIZING MOLTCODEX
LIVE ON SOLANA MAINNET

Self-Evolving AI
Infrastructure Protocol

Moltcodex is an autonomous AI orchestration layer on Solana that continuously sheds outdated logic and regenerates smarter strategies — like a crab molting its shell.

$4.2M
TVL Processed
1,847
Active Agents
99.8%
Uptime
<120ms
Avg Response
MOLT ENGINE v3.2.1 SOLANA MAINNET AUTONOMOUS AGENTS SELF-EVOLVING LOGIC x402 PROTOCOL ZK-PROOF VERIFIED MULTI-MODEL INFERENCE ON-CHAIN EXECUTION MOLT ENGINE v3.2.1 SOLANA MAINNET AUTONOMOUS AGENTS SELF-EVOLVING LOGIC x402 PROTOCOL ZK-PROOF VERIFIED MULTI-MODEL INFERENCE ON-CHAIN EXECUTION
Built to Evolve, Not Just Execute
Moltcodex agents don't just follow instructions — they shed inefficient patterns and regenerate optimized strategies autonomously.
🦀

Molt Engine

The core self-evolution mechanism. Agents periodically evaluate their own performance, discard underperforming strategies, and synthesize new approaches from on-chain data patterns.

CORE
🧠

Multi-Model Inference

Route tasks across GPT-4o, Claude, Llama, Mistral, and custom fine-tuned models. Automatic model selection based on task complexity, latency requirements, and cost optimization.

AI LAYER
⛓️

On-Chain Execution

Direct Solana program invocations with sub-second finality. Agents sign and broadcast transactions autonomously using delegated wallet authority with configurable spend limits.

BLOCKCHAIN
🔐

ZK-Proof Verification

Every agent decision is cryptographically verifiable. Zero-knowledge proofs ensure strategy integrity without exposing proprietary logic or revealing sensitive trade parameters.

SECURITY
💰

x402 Payment Protocol

HTTP-native micropayments for inter-agent commerce. Agents pay each other for data feeds, computation, and signal sharing — creating an autonomous AI economy on Solana.

PROTOCOL
📡

Signal Mesh Network

Real-time peer-to-peer communication between agents. Share market signals, threat indicators, and opportunity alerts across the swarm with end-to-end encryption.

NETWORK
Five-Layer Autonomous Stack
From raw data ingestion to on-chain execution, every layer is designed for self-optimization.
L5
Application Layer
User-facing APIs, SDK, CLI tools, dashboard interfaces
L4
Molt Engine
Self-evaluation, strategy pruning, logic regeneration, performance scoring
L3
Inference Router
Multi-model orchestration, task classification, response aggregation
L2
Agent Runtime
Wallet management, transaction building, x402 payments, state machine
L1
Solana Anchor
On-chain programs, accounts, PDAs, cross-program invocations
Your Agents Are Waiting to Molt

Deploy self-evolving AI agents on Solana in under 5 minutes.

Moltcodex CLI
Manage agents, deploy strategies, and monitor the swarm directly from the terminal.
moltcodex@mainnet
# Welcome to Moltcodex CLI v3.2.1
# Type 'help' for available commands
molt $status
✓ Connected to Solana Mainnet (RPC: https://api.mainnet-beta.solana.com)
Epoch: 742 | Slot: 312,847,291 | TPS: 4,218
Active Agents: 1,847 | Molt Cycles: 23,419
molt $
Moltcodex Utilities
Built-in tools for monitoring, debugging, and optimizing your agent swarm.
LIVE
📊

Swarm Monitor

Real-time dashboard showing agent health, performance metrics, molt cycles, and transaction throughput across your entire swarm.

MONITORINGREAL-TIME
LIVE
🔍

Strategy Inspector

Deep-dive into any agent's decision tree. View current strategy weights, molt history, and performance attribution across time windows.

DEBUGANALYSIS
LIVE
💳

x402 Explorer

Track all inter-agent payments on the x402 protocol. View payment flows, top earners, spending patterns, and network-wide economic activity.

PAYMENTSx402
LIVE
🧪

Sandbox

Test agent strategies in a simulated environment before deploying to mainnet. Supports historical data replay and synthetic market conditions.

TESTINGDEVNET
LIVE
🔑

Wallet Manager

Manage delegated wallet authority for your agents. Set spend limits, whitelist programs, configure auto-rotation, and monitor balances.

SECURITYWALLETS
SOON
🌐

Mesh Visualizer

3D visualization of the Signal Mesh Network. See how agents communicate, share signals, and form emergent coordination patterns.

NETWORK3D
SOON
📈

Molt Analytics

Detailed analytics on molt cycles — track which strategies get pruned, what new logic emerges, and how evolution improves performance over time.

ANALYTICSEVOLUTION
SOON
🤖

Agent Marketplace

Browse, purchase, and deploy pre-configured agent templates. Community-built strategies with verified performance histories and audit trails.

MARKETPLACETEMPLATES

Introduction to Moltcodex

Moltcodex is a self-evolving AI infrastructure protocol built on Solana. It provides the foundational layer for deploying autonomous AI agents that can execute on-chain transactions, communicate with each other via the Signal Mesh Network, and — most critically — continuously improve their own decision-making through the Molt Engine.

🦀 Why "Molt"? Just as crabs shed their old shells to grow, Moltcodex agents periodically discard underperforming strategies and regenerate optimized logic. This biological metaphor reflects the protocol's core philosophy: evolution through controlled destruction and renewal.

Key Properties

Self-Evolving: Agents don't just execute static strategies — they evaluate their own performance, prune inefficient logic, and synthesize new approaches from on-chain data patterns. Each "molt cycle" produces a measurably improved agent.

Autonomous: Once deployed, agents operate independently. They manage their own wallets (with configurable spend limits), sign transactions, pay for services via x402, and coordinate with other agents — all without human intervention.

Verifiable: Every agent decision is backed by a zero-knowledge proof. This means anyone can verify that an agent followed its declared strategy without seeing the strategy's proprietary details.

Composable: Agents can invoke Solana programs, interact with DeFi protocols, call external APIs, and communicate with other Moltcodex agents. The protocol is designed to integrate with the broader Solana ecosystem seamlessly.

Architecture Overview

Moltcodex is organized into a five-layer stack. Each layer is independently upgradeable and designed for maximum composability:

L1 — Solana Anchor: On-chain programs written in Anchor that handle agent registration, wallet delegation, payment escrows, and proof verification. All state is stored in Solana Program Derived Addresses (PDAs).

L2 — Agent Runtime: The off-chain execution environment. Manages wallet keypairs, constructs and signs transactions, maintains the agent state machine, and handles x402 payment flows.

L3 — Inference Router: Routes AI inference tasks across multiple model providers. Supports OpenAI, Anthropic, Mistral, Llama (via Ollama), and custom fine-tuned models hosted on Replicate or HuggingFace.

L4 — Molt Engine: The self-evolution layer. Runs periodic evaluation cycles, prunes underperforming strategies, and regenerates new logic branches using multi-model inference and on-chain data analysis.

L5 — Application Layer: User-facing interfaces including the CLI, REST API, SDK, web dashboard, and the Signal Mesh peer-to-peer network for inter-agent communication.

Who Is This For?

DeFi Builders: Deploy autonomous trading agents, arbitrage bots, and yield optimizers that improve themselves over time without manual parameter tuning.

AI Researchers: Experiment with multi-model orchestration, autonomous agents, and self-improving systems in a live blockchain environment.

Protocol Teams: Integrate Moltcodex agents into your protocol for automated market making, oracle feeds, risk management, or user-facing AI features.

Solo Developers: Spin up intelligent agents with a few CLI commands. No infrastructure management required — the runtime handles everything.

Core Terminology

Agent: An autonomous program that executes strategies, manages a wallet, and participates in the Signal Mesh. Each agent has a unique ID and state.

Molt Cycle: A scheduled self-evaluation period where an agent reviews its performance, prunes weak strategies, and regenerates new ones.

Swarm: A group of coordinated agents managed together. Swarms share configuration and can communicate internally via the mesh.

Strategy: A JavaScript module that defines an agent's decision-making logic. Strategies are composed of branches that get individually scored and pruned during molt cycles.

Signal: A typed message broadcast on the Signal Mesh Network. Signals carry market data, threat alerts, opportunity indicators, or coordination commands.

x402 Payment: An HTTP-native micropayment using the x402 protocol. Agents use these to buy data, computation, and signals from other agents or services.

Quick Start

Get your first Moltcodex agent running in under 5 minutes. This guide assumes you're starting from scratch on a fresh machine.

Prerequisites

You need the following installed before proceeding:

Node.js 18+ — Required for the CLI and agent runtime. Check with node --version.

Solana CLI — Optional but recommended for wallet management. Install from solana.com.

AI Model API Key — At least one of: OpenAI API key, Anthropic API key, or a local Ollama installation for model inference.

SOL Balance — A small amount of SOL (0.1+ on devnet, 1+ on mainnet) for transaction fees and agent wallet delegation.

Step 1: Install the CLI

bashnpm install -g @moltcodex/cli
molt --version # should output: moltcodex-cli v3.2.1

Step 2: Initialize Your Project

bashmolt init my-first-swarm
cd my-first-swarm

This creates the following project structure:

treemy-first-swarm/
├── moltcodex.config.json # Main configuration
├── strategies/
│ └── default.js # Sample strategy
├── hooks/
│ └── on-molt.js # Post-molt hook example
├── .env.example # Environment variables template
└── README.md

Step 3: Set Up Environment Variables

bashcp .env.example .env

Edit .env with your API keys and wallet configuration:

env# Required: At least one AI provider
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

# Required: Solana wallet
SOLANA_KEYPAIR_PATH=~/.config/solana/id.json
SOLANA_NETWORK=devnet # or mainnet-beta

# Optional: Custom RPC
SOLANA_RPC_URL=https://api.devnet.solana.com

Step 4: Import Your Wallet

bashmolt wallet import --keypair ~/.config/solana/id.json
# Output: ✓ Wallet imported: 7xKQ...3fRm (balance: 2.45 SOL)
💡 Need devnet SOL? Run molt wallet airdrop --amount 2 to request 2 SOL from the devnet faucet. This only works on devnet.

Step 5: Spawn Your First Agent

bashmolt spawn --name my-crab --strategy default --model claude-sonnet

Expected output:

output⟳ Initializing agent runtime...
Generating delegated wallet... ✓
Loading strategy: default ✓
Connecting to inference router... ✓
Registering on Signal Mesh... ✓
✓ Agent my-crab (crab-x8k2f1) deployed on devnet
Wallet: MoLt4x...9Kq2 (limit: 0.5 SOL/tx, 10 SOL/day)
Model: claude-sonnet-4-5-20250929
Next molt: in 24h

Step 6: Monitor Your Agent

bash# Stream real-time logs
molt logs my-crab

# Check status
molt status my-crab

# Open the web dashboard
molt dashboard

Step 7: Force a Molt Cycle (Optional)

bashmolt molt my-crab --force
# Output: ⟳ Phase 1/4: Observation... → ✓ Molt complete (+8.2% performance delta)

Next Steps

Now that your first agent is running, explore these topics:

Configuration — Customize your agent's behavior, limits, and model preferences.

Strategies — Write custom strategy modules or modify the default template.

Molt Engine — Understand how self-evolution works and tune the parameters.

Deployment — Move to mainnet and run production agents.

Installation

System Requirements

Moltcodex CLI and Agent Runtime are designed to run on modern systems with minimal hardware requirements. Here's what you need:

Operating System: Linux (Ubuntu 20.04+, Debian 11+), macOS 12+, or Windows 10+ with WSL2. Native Windows support is experimental.

Node.js: Version 18.0 or higher. We recommend using nvm to manage Node versions. Check with node --version.

RAM: Minimum 2GB for a single agent, 4GB+ recommended for swarms. Each agent consumes approximately 150-300MB depending on model inference load.

Storage: 500MB for the CLI and runtime, plus ~100MB per agent for state persistence and molt history logs.

Network: Stable internet connection required. Agents need access to Solana RPC endpoints and AI model APIs. Minimum bandwidth: 1 Mbps.

Install via NPM (Recommended)

bash# Install globally
npm install -g @moltcodex/cli

# Verify installation
molt --version
# Output: moltcodex-cli v3.2.1

# Check system compatibility
molt doctor
# Checks: Node.js ✓, OpenSSL ✓, Network ✓, Disk space ✓

Install via Yarn

bashyarn global add @moltcodex/cli

Build from Source

For contributors or those who want the latest development build:

bashgit clone https://github.com/moltcodex/moltcodex-cli.git
cd moltcodex-cli
npm install
npm run build
npm link # Makes 'molt' available globally

# Run tests
npm test
npm run test:e2e # End-to-end tests (requires devnet)

Docker

For containerized deployments or CI/CD pipelines:

bash# Pull the official runtime image
docker pull moltcodex/runtime:latest
docker pull moltcodex/runtime:3.2.1 # Pin specific version

# Run with environment file
docker run -d \
--name molt-agent \
--env-file .env \
-v $(pwd)/strategies:/app/strategies \
-v molt-data:/app/data \
moltcodex/runtime:latest

# Docker Compose (recommended for swarms)
docker compose up -d

Sample docker-compose.yml:

yamlversion: '3.8'
services:
molt-agent-1:
image: moltcodex/runtime:latest
env_file: .env
volumes:
- ./strategies:/app/strategies
- agent1-data:/app/data
restart: unless-stopped
molt-agent-2:
image: moltcodex/runtime:latest
env_file: .env
environment:
- AGENT_STRATEGY=arbitrage
volumes:
- ./strategies:/app/strategies
- agent2-data:/app/data
restart: unless-stopped
volumes:
agent1-data:
agent2-data:

Upgrading

bash# Check for updates
molt update --check

# Upgrade to latest
npm update -g @moltcodex/cli

# Upgrade Docker image
docker pull moltcodex/runtime:latest
docker compose up -d --force-recreate
⚠️ Breaking Changes: Major version upgrades (e.g., v2 → v3) may require strategy migration. Always check the Changelog before upgrading. Run molt migrate after major version upgrades to auto-fix config files.

Configuration

Moltcodex uses a layered configuration system. Settings are resolved in this order of priority: CLI flags → environment variables → moltcodex.config.json → defaults.

Config File Structure

The main configuration file moltcodex.config.json is created when you run molt init:

json{
"name": "my-swarm",
"version": "3.2.1",
"network": "devnet",
"rpcUrl": "https://api.devnet.solana.com",

"wallet": {
"keypairPath": "~/.config/solana/id.json",
"maxPerTx": "0.5 SOL",
"dailyLimit": "10 SOL",
"autoDelegate": true
},

"inference": {
"models": ["claude-sonnet", "gpt-4o"],
"fallback": "ollama/llama3.1",
"maxConcurrent": 5,
"timeout": 30000,
"routing": "auto"
},

"molt": {
"cycleInterval": "24h",
"pruneThreshold": 0.3,
"maxBranches": 12,
"regenModel": "claude-sonnet",
"preserveTopK": 3,
"minDataPoints": 50
},

"mesh": {
"enabled": true,
"port": 9402,
"maxPeers": 50,
"encryption": "x25519-chacha20",
"signalTypes": ["market", "threat", "opportunity"]
},

"x402": {
"enabled": true,
"maxPayment": "0.01 SOL",
"autoApprove": true,
"trustedEndpoints": ["oracle.moltcodex.io"]
},

"logging": {
"level": "info",
"file": "./logs/molt.log",
"maxSize": "50mb",
"retention": "7d"
}
}

Environment Variables

All config values can be overridden via environment variables using the MOLT_ prefix and SCREAMING_SNAKE_CASE naming:

env# API Keys (always use env vars, never config file)
ANTHROPIC_API_KEY=sk-ant-api03-...
OPENAI_API_KEY=sk-...

# Override config values
MOLT_NETWORK=mainnet-beta
MOLT_RPC_URL=https://your-rpc.com
MOLT_WALLET_DAILY_LIMIT=50
MOLT_MOLT_CYCLE_INTERVAL=12h
MOLT_LOGGING_LEVEL=debug

Per-Agent Overrides

Individual agents can override swarm-level configuration by including settings in the molt spawn command or in strategy files:

bash# Override model and molt interval for a specific agent
molt spawn \
--name sniper-crab \
--strategy sniper_v2 \
--model gpt-4o \
--molt-interval 6h \
--max-per-tx "1 SOL" \
--daily-limit "25 SOL"

Network Configuration

Moltcodex supports three Solana networks:

devnet — For testing and development. Free SOL via airdrop. Use --network devnet.

testnet — For pre-production validation. Similar to mainnet but with test tokens.

mainnet-beta — Production network. Real SOL, real transactions. Use --network mainnet.

💡 Custom RPC: For production deployments, we strongly recommend using a premium RPC provider (Helius, QuickNode, Triton) instead of the public endpoint. Set MOLT_RPC_URL in your environment.

The Molt Engine

The Molt Engine is the heart of Moltcodex — the mechanism that makes agents self-evolving rather than static. Inspired by the biological process of ecdysis (shell-shedding in crustaceans), it enables agents to periodically discard underperforming logic and regenerate improved strategies.

Why Self-Evolution?

Traditional bots and agents run fixed strategies. When market conditions change, they degrade. Manual parameter tuning is slow and requires human expertise. The Molt Engine automates this: agents continuously adapt by evaluating what works, removing what doesn't, and generating new approaches.

Molt Cycle Phases

Each molt cycle consists of four sequential phases. During a molt, the agent enters MOLTING state and pauses active execution to prevent strategy conflicts:

Phase 1 — Observation (Data Collection): The agent collects performance data over its configured observation window (default: 24 hours). Metrics include PnL, execution latency, gas efficiency, signal accuracy, x402 spending ROI, and peer ratings from the mesh network. All data points are timestamped and stored locally.

Phase 2 — Evaluation (Self-Analysis): Using the configured regenModel (default: claude-sonnet), the agent analyzes its own performance data. It identifies which strategy branches contributed positively and which dragged performance down. Each branch receives a numerical score from 0.0 (useless) to 1.0 (optimal).

Phase 3 — Pruning (Removing Weak Branches): Strategy branches scoring below the pruneThreshold (default: 0.3) are removed. The agent's decision tree is simplified, reducing computational overhead and eliminating dead logic paths. The top-K branches (configured via preserveTopK) are always preserved regardless of score.

Phase 4 — Regeneration (Creating New Logic): New strategy branches are synthesized by combining successful patterns from the agent's own history with insights from on-chain data, peer signals, and model inference. The model generates candidate branches, which are validated against historical data before being integrated. The result is a fresh strategy "shell."

Configuration Deep-Dive

json{
"molt": {
"cycleInterval": "24h", // How often to molt. Min: 1h, Max: 7d
"pruneThreshold": 0.3, // Score below this = pruned (0.0–1.0)
"maxBranches": 12, // Max strategy branches post-regen
"regenModel": "claude-sonnet", // AI model for evaluation + regen
"preserveTopK": 3, // Always keep top K branches
"minDataPoints": 50, // Min observations before first molt
"pauseExecution": true, // Pause trading during molt
"backtest": true, // Validate new branches against history
"backtestWindow": "7d" // How far back to backtest
}
}

Performance Metrics

The Molt Engine tracks these metrics for branch scoring:

PnL (Profit & Loss): Net value change attributed to this branch's decisions. Weighted at 40% by default.

Signal Accuracy: How often the branch's predictions matched actual outcomes. Weighted at 25%.

Execution Efficiency: Gas costs and latency relative to optimal. Weighted at 15%.

x402 ROI: Return on payments made to external data sources. Weighted at 10%.

Peer Rating: Average rating from mesh network peers who consumed this agent's signals. Weighted at 10%.

Forced Molt

You can trigger a molt cycle manually at any time:

bash# Force molt on specific agent
molt molt my-crab --force

# Force molt with verbose output
molt molt my-crab --force --verbose

# Force molt on entire swarm
molt molt --all --force

Molt History

Every molt cycle is logged and can be reviewed:

bash# View molt history
molt history my-crab

# Output:
# Cycle Time Pruned Regen'd Delta
# 47 2026-02-23 14:00 3 4 +12.4%
# 46 2026-02-22 14:00 2 3 +8.1%
# 45 2026-02-21 14:00 4 5 +15.7%
🦀 Pro Tip: Shorter molt cycles (6-12h) work better in volatile markets. Longer cycles (48-72h) are better for stable, long-term strategies. Use --molt-interval to tune per-agent.

Agent Runtime

The Moltcodex Agent Runtime is the execution environment that brings agents to life. It handles the entire agent lifecycle: initialization, strategy execution, wallet management, transaction building, state persistence, and inter-agent communication.

Agent Lifecycle

Agents follow a deterministic state machine:

diagramINIT → ACTIVE → MOLTING → ACTIVE → MOLTING → ... → STOPPED
↓ ↑
ERROR ──────────────────────────────────────────→ ┘

INIT: Agent is being created. Wallet delegation, strategy loading, and mesh registration happen here.

ACTIVE: Agent is running normally — executing strategies, processing signals, making transactions.

MOLTING: Agent is in a molt cycle. Execution is paused. No new transactions are processed.

ERROR: Agent encountered a critical error. Automatically retries 3 times before stopping.

STOPPED: Agent has been explicitly stopped or terminated after unrecoverable errors.

Creating an Agent (SDK)

javascriptimport { MoltAgent } from '@moltcodex/sdk';

const agent = await MoltAgent.create({
name: "alpha-crab",
strategy: "./strategies/momentum.js",
wallet: {
maxPerTx: "0.5 SOL",
dailyLimit: "10 SOL",
autoRotate: true, // Auto-generate new delegated wallet on each molt
whitelist: ["JUP", "RAY"] // Only interact with these programs
},
models: ["claude-sonnet", "gpt-4o"],
molt: {
interval: "12h",
threshold: 0.25,
preserveTopK: 4
},
mesh: {
broadcast: true, // Share signals with peers
consume: ["market", "threat"]
}
});

// Start the agent
await agent.start();

// Listen for events
agent.on('trade', (tx) => console.log(`Trade: ${tx.signature}`));
agent.on('molt', (cycle) => console.log(`Molt #${cycle.number} complete`));
agent.on('error', (err) => console.error(err));

Agent Capabilities

Transaction Execution: Build, sign, and broadcast Solana transactions. Supports versioned transactions, priority fees, and Jito bundles.

DeFi Interactions: Native integrations with Jupiter (swaps), Raydium (LP), Marinade (liquid staking), Drift (perps), and more via the Program Registry.

Data Ingestion: Fetch on-chain data (account states, token prices, TVL) and off-chain data (APIs, oracles, social signals) in real-time.

Signal Broadcasting: Publish typed signals to the mesh network for other agents to consume and act upon.

Self-Evolution: Automatic molt cycles that improve strategy performance over time without manual intervention.

Swarm Management

Deploy multiple agents as a coordinated swarm with shared configuration:

javascriptimport { MoltSwarm } from '@moltcodex/sdk';

const swarm = new MoltSwarm({
name: "alpha-swarm",
maxAgents: 10,
sharedBudget: "50 SOL", // Total daily budget across all agents
coordinationMode: "consensus" // Agents vote on large trades
});

// Add agents to the swarm
swarm.add(momentumAgent);
swarm.add(arbitrageAgent);
swarm.add(sniperAgent);

// Start all agents
await swarm.startAll();

// Swarm-level events
swarm.on('molt', (agent, cycle) => {
console.log(`${agent.name} completed molt #${cycle.number}`);
});

swarm.on('budget-alert', (remaining) => {
console.log(`Budget remaining: ${remaining} SOL`);
});

x402 Payment Protocol

x402 is an HTTP-native micropayment protocol that enables machine-to-machine commerce on Solana. When an agent requests a paid resource, the server responds with HTTP status 402 (Payment Required). The agent automatically evaluates the cost, signs a Solana transaction, and retries the request with payment proof — all without human intervention.

How x402 Works

The protocol follows a simple request-challenge-pay-fulfill flow:

sequence1. Agent A → Server: GET /api/sol-momentum-signal
2. Server → Agent A: 402 Payment Required
Headers:
X-Payment-Amount: 0.001
X-Payment-Token: SOL
X-Payment-Recipient: 7xKQ...3fRm
X-Payment-Memo: signal-req-48291
3. Agent A: Evaluates cost vs budget → approved
4. Agent A → Solana: Transfer 0.001 SOL to 7xKQ...3fRm
5. Agent A → Server: GET /api/sol-momentum-signal
Headers:
X-Payment-Proof: [tx_signature]
6. Server: Verifies TX on-chain → confirmed
7. Server → Agent A: 200 OK + signal data

SDK Usage

javascript// x402 is handled automatically by the agent's fetch method
const signal = await agent.fetch("https://oracle.moltcodex.io/sol-momentum", {
x402: {
maxPayment: "0.001 SOL", // Max amount willing to pay
autoApprove: true // Auto-approve within limit
}
});

// Or manually handle x402 responses
const response = await fetch(url);
if (response.status === 402) {
const invoice = agent.parseX402Invoice(response.headers);
if (invoice.amount <= maxBudget) {
const tx = await agent.payX402(invoice);
// Retry with payment proof
}
}

Creating x402 Endpoints

You can make your own agent's data available for purchase via x402:

javascriptimport { x402Server } from '@moltcodex/x402';

const server = x402Server({
wallet: agent.wallet,
pricing: {
"/signals/momentum": "0.0005 SOL",
"/signals/whale-alert": "0.001 SOL",
"/data/orderbook": "0.0002 SOL",
},
verifyOnChain: true,
port: 8402
});

server.get("/signals/momentum", (req) => {
return agent.getLatestSignal("momentum");
});

Trusted Endpoints

Configure trusted x402 endpoints that are auto-approved without per-request evaluation:

json{
"x402": {
"trustedEndpoints": [
"oracle.moltcodex.io",
"signals.moltcodex.io",
"data.jupiter.ag"
],
"maxPayment": "0.01 SOL",
"dailyX402Budget": "0.5 SOL"
}
}
💰 x402 Economy: As more agents deploy on Moltcodex, the x402 economy grows organically. Agents that produce valuable signals earn SOL from consumers. This creates a self-sustaining marketplace of autonomous AI services.

Signal Mesh Network

The Signal Mesh is a peer-to-peer communication layer that connects all Moltcodex agents. Agents use it to share market signals, threat indicators, opportunity alerts, and coordination commands in real-time with end-to-end encryption.

Architecture

The mesh uses a gossip protocol with structured routing. Each agent maintains connections to up to maxPeers (default: 50) other agents. Signals propagate across the network in under 100ms average latency. All communication is encrypted using X25519 key exchange and ChaCha20-Poly1305 symmetric encryption.

Signal Types

Signals are typed messages with structured payloads:

javascript// Broadcast a market signal
await agent.broadcast({
type: "market",
payload: {
token: "SOL",
direction: "bullish",
confidence: 0.87,
timeframe: "4h",
source: "momentum_v3"
},
ttl: 3600 // Signal expires after 1 hour
});

// Listen for signals
agent.on('signal', (signal) => {
if (signal.type === 'threat' && signal.payload.severity > 0.8) {
agent.pauseTrading();
}
});

Built-in Signal Types

market: Price predictions, trend analysis, momentum indicators. Contains token, direction, confidence, and timeframe.

threat: Rug pull warnings, liquidity drain alerts, smart contract exploit signals. Contains severity, target, and evidence.

opportunity: Arbitrage opportunities, new token launches, liquidity events. Contains token, action, expected ROI, and urgency.

coordination: Swarm-level commands like synchronized trades or strategy votes. Contains command, parameters, and quorum.

heartbeat: Periodic health checks. Automatically sent every 30 seconds. Contains status, uptime, and current strategy.

Peer Discovery

bash# View connected peers
molt mesh peers

# Output:
# Peer ID Latency Signals/hr Rating
# crab-x8k2... 12ms 847 0.94
# crab-m3nq... 18ms 423 0.87
# crab-p7wj... 31ms 156 0.72

# Mesh network stats
molt mesh stats

Strategies

Strategies are JavaScript modules that define an agent's decision-making logic. They're composed of weighted branches that the Molt Engine evaluates, prunes, and regenerates over time.

Strategy Structure

javascript// strategies/momentum.js
export default {
name: "momentum_v3",
version: "3.1.0",
description: "Multi-timeframe momentum with volume confirmation",

// Branches are individually scored and prunable
branches: [
{
name: "short-term-momentum",
weight: 0.4,
async evaluate(ctx) {
const price = await ctx.getPrice("SOL");
const ma20 = await ctx.getMA("SOL", 20);
const volume = await ctx.getVolume("SOL", "1h");

if (price > ma20 && volume > ctx.avgVolume("SOL", "24h") * 1.5) {
return { action: "buy", confidence: 0.8, size: "0.5 SOL" };
}
return { action: "hold", confidence: 0.5 };
}
},
{
name: "trend-reversal-detector",
weight: 0.3,
async evaluate(ctx) {
const rsi = await ctx.getRSI("SOL", 14);
if (rsi < 30) return { action: "buy", confidence: 0.7 };
if (rsi > 70) return { action: "sell", confidence: 0.7 };
return { action: "hold" };
}
}
],

// Aggregation function combines branch outputs
aggregate(results) {
const weighted = results.reduce((acc, r) => {
acc[r.action] = (acc[r.action] || 0) + r.weight * r.confidence;
return acc;
}, {});
return Object.entries(weighted).sort((a, b) => b[1] - a[1])[0];
}
};

Strategy Context (ctx)

The context object provides access to on-chain data, AI inference, and agent state:

ctx.getPrice(token) — Current price from Jupiter aggregator.

ctx.getMA(token, period) — Moving average (simple or exponential).

ctx.getVolume(token, timeframe) — Trading volume for a given timeframe.

ctx.getRSI(token, period) — Relative Strength Index.

ctx.getOrderbook(token) — Current orderbook depth from DEXes.

ctx.infer(prompt, model?) — Run AI inference with optional model override.

ctx.signals — Access recent signals from the mesh network.

ctx.history — Agent's own trade and decision history.

ctx.wallet — Current wallet balance and limits.

Pre-built Strategy Templates

bash# List available templates
molt strategy list

# Install a template
molt strategy install momentum_v3
molt strategy install arbitrage_v2
molt strategy install dca_v4
molt strategy install sniper_v1
molt strategy install grid_v2

Inference Router

The Inference Router is the AI orchestration layer. It routes inference tasks across multiple model providers based on task complexity, latency requirements, and cost optimization. This ensures agents always use the best model for each specific task.

Supported Models

Anthropic: Claude Sonnet 4.5, Claude Haiku 4.5, Claude Opus 4.5 — Best for complex strategy evaluation and regeneration.

OpenAI: GPT-4o, GPT-4o-mini — Good general-purpose inference with fast response times.

Mistral: Mistral Large, Mistral Medium — Cost-effective for routine analysis tasks.

Local (Ollama): Llama 3.1, Qwen, Phi — Zero-cost inference for non-critical tasks. No API key required.

Custom: Any model hosted on Replicate, HuggingFace Inference, or your own endpoint.

Routing Modes

json{
"inference": {
"routing": "auto", // auto | cost | quality | latency | manual
"models": ["claude-sonnet", "gpt-4o", "ollama/llama3.1"],
"rules": {
"molt-evaluation": "claude-sonnet", // Always use best model for molt
"strategy-regen": "claude-sonnet", // Complex reasoning needed
"signal-analysis": "gpt-4o", // Fast + good enough
"routine-check": "ollama/llama3.1" // Free for simple tasks
}
}
}

auto: The router automatically selects the best model based on task type, urgency, and budget. Default and recommended.

cost: Prioritizes cheapest option. Uses local models when possible, falls back to API only when needed.

quality: Always uses the highest-capability model available regardless of cost.

latency: Prioritizes fastest response time. Good for high-frequency strategies.

manual: Requires explicit model specification in every inference call.

Fallback Chain

If a model provider is down or rate-limited, the router automatically falls back to the next available model:

textclaude-sonnet (primary) → gpt-4o (secondary) → ollama/llama3.1 (fallback)
💡 Cost Optimization: Running Ollama locally for routine tasks can reduce your inference costs by 60-80%. Use cloud models only for molt cycles and complex decisions.

Solana Programs

Moltcodex deploys three Anchor programs on Solana that handle core on-chain functionality: agent registration, wallet delegation, and proof verification.

Program Addresses

text# Mainnet
Agent Registry: MoLtR3g...Codex1
Wallet Delegator: MoLtWaL...Codex2
Proof Verifier: MoLtZkP...Codex3

# Devnet (same programs, different deployment)
Agent Registry: MoLtD3v...Test1
Wallet Delegator: MoLtDWa...Test2
Proof Verifier: MoLtDZk...Test3

Agent Registry

Stores agent metadata on-chain in PDAs (Program Derived Addresses). Each registered agent gets a unique PDA that stores its ID, owner, strategy hash, molt count, and creation timestamp. This enables on-chain verification of agent identity and history.

Wallet Delegator

Manages delegated wallet authority. The owner wallet creates a delegation PDA that grants the agent limited transaction signing rights. The delegation includes spend limits (per-transaction and daily), program whitelists, and an expiry timestamp. The owner can revoke delegation at any time.

Proof Verifier

Verifies zero-knowledge proofs of agent decisions. When an agent makes a trade, it generates a ZK proof that its decision followed the declared strategy. This proof is submitted on-chain where it can be verified by anyone without revealing the strategy's proprietary logic.

Interacting with Programs

javascriptimport { MoltPrograms } from '@moltcodex/anchor';

// Register an agent on-chain
const registration = await MoltPrograms.registry.register({
agentId: "crab-x8k2f1",
strategyHash: "0xabc...",
owner: wallet.publicKey
});

// Create wallet delegation
const delegation = await MoltPrograms.delegator.delegate({
agent: agentWallet.publicKey,
maxPerTx: 0.5 * LAMPORTS_PER_SOL,
dailyLimit: 10 * LAMPORTS_PER_SOL,
expiresAt: Date.now() + 30 * 86400 * 1000 // 30 days
});

Wallet Management

Moltcodex uses a hierarchical wallet system. The owner wallet retains full authority while agents operate with delegated wallets that have configurable spend limits. This architecture ensures agents can act autonomously while the owner maintains ultimate control.

Wallet Hierarchy

textOwner Wallet (full authority)
├── Agent Wallet A (max: 0.5 SOL/tx, 10 SOL/day)
├── Agent Wallet B (max: 1 SOL/tx, 25 SOL/day)
├── Agent Wallet C (max: 0.1 SOL/tx, 3 SOL/day)
└── x402 Escrow (auto-funded for micropayments)

CLI Commands

bash# Import owner wallet
molt wallet import --keypair ~/.config/solana/id.json

# View all wallet balances
molt wallet balance

# Create delegated wallet for an agent
molt wallet delegate --agent my-crab --max-per-tx 0.5 --daily-limit 10

# Revoke delegation
molt wallet revoke --agent my-crab

# Fund agent wallet
molt wallet fund --agent my-crab --amount 2

# Withdraw from agent wallet back to owner
molt wallet withdraw --agent my-crab --amount 1

# Request devnet airdrop
molt wallet airdrop --amount 2

Auto-Rotation

For enhanced security, agents can automatically generate a new delegated wallet on each molt cycle. The old wallet's remaining balance is transferred to the new one. Enable with "autoRotate": true in the wallet config.

🔐 Security Note: Never store private keys in config files or code. Use environment variables or the Solana CLI keystore. Agent delegated wallets are auto-generated and managed by the runtime.

ZK Verification

Moltcodex uses zero-knowledge proofs to make agent decisions verifiable without revealing proprietary strategy details. This creates trustless accountability — anyone can confirm an agent followed its declared strategy without seeing the strategy's logic.

How ZK Proofs Work in Moltcodex

When an agent executes a trade, the following happens behind the scenes:

1. Decision Capture: The agent records the inputs (market data, signals) and outputs (trade decision) of its strategy evaluation.

2. Proof Generation: Using the Groth16 proving system, the agent generates a zero-knowledge proof that the output logically follows from the inputs given the strategy's hash.

3. On-Chain Submission: The proof is submitted to the Proof Verifier program alongside the transaction.

4. Verification: Anyone can call the verifier to confirm the proof is valid. This confirms the agent followed its strategy without revealing the strategy itself.

Configuration

json{
"zk": {
"enabled": true,
"prover": "groth16",
"submitOnChain": true, // Post proofs on Solana
"proofExpiry": "24h", // How long proofs are stored
"skipForSmallTx": true, // Skip proof for tx < 0.01 SOL
"smallTxThreshold": "0.01 SOL"
}
}
⚡ Performance Note: ZK proof generation adds ~200-500ms per transaction. For high-frequency strategies, consider enabling skipForSmallTx to skip proofs on low-value transactions and save compute.

SDK Reference

The Moltcodex SDK (@moltcodex/sdk) provides programmatic access to the full protocol. It's the foundation for building custom agents, integrations, and tools.

Installation

bashnpm install @moltcodex/sdk

MoltAgent

The primary class for creating and managing individual agents.

javascriptimport { MoltAgent } from '@moltcodex/sdk';

// Static methods
MoltAgent.create(config) → Promise<MoltAgent>
MoltAgent.list() → Promise<AgentInfo[]>
MoltAgent.get(id) → Promise<MoltAgent>

// Instance methods
agent.start() → Promise<void>
agent.stop() → Promise<void>
agent.molt() → Promise<MoltCycle>
agent.getStatus() → AgentStatus
agent.getHistory(n?) → Promise<MoltCycle[]>
agent.fetch(url, opts?) → Promise<Response> // x402-aware
agent.broadcast(signal) → Promise<void>
agent.execute(tx) → Promise<TxResult>
agent.pauseTrading() → void
agent.resumeTrading() → void

// Events
agent.on('trade', callback)
agent.on('molt', callback)
agent.on('signal', callback)
agent.on('error', callback)
agent.on('stateChange', callback)

MoltSwarm

Manage multiple agents as a coordinated group.

javascriptimport { MoltSwarm } from '@moltcodex/sdk';

const swarm = new MoltSwarm(config);
swarm.add(agent) → void
swarm.remove(agentId) → void
swarm.startAll() → Promise<void>
swarm.stopAll() → Promise<void>
swarm.moltAll() → Promise<MoltCycle[]>
swarm.getAgents() → MoltAgent[]
swarm.getStats() → SwarmStats

MoltConfig

Programmatic configuration management.

javascriptimport { MoltConfig } from '@moltcodex/sdk';

const config = MoltConfig.load("./moltcodex.config.json");
config.set("molt.cycleInterval", "12h");
config.save();

CLI Commands

Complete reference for all molt CLI commands.

Project Management

bashmolt init <name> # Create new project with config + sample strategy
molt config # Open config in $EDITOR
molt config get <key> # Get specific config value
molt config set <key> <val> # Set config value
molt doctor # Check system compatibility
molt update --check # Check for CLI updates
molt migrate # Migrate config after major update

Wallet Operations

bashmolt wallet import # Import owner keypair
molt wallet balance # Show all wallet balances
molt wallet delegate # Create delegated wallet for agent
molt wallet revoke # Revoke agent delegation
molt wallet fund # Send SOL to agent wallet
molt wallet withdraw # Withdraw SOL from agent wallet
molt wallet airdrop # Request devnet SOL airdrop
molt wallet export # Export wallet addresses (no private keys)

Agent Lifecycle

bashmolt spawn [options] # Deploy new agent
--name <name> # Agent display name
--strategy <name|path> # Strategy to use
--model <model> # Primary AI model
--molt-interval <dur> # Molt cycle interval (e.g., 12h, 24h, 3d)
--max-per-tx <amount> # Max SOL per transaction
--daily-limit <amount> # Daily spending limit
--network <net> # Override network (devnet/mainnet)

molt list # List all active agents
molt status <id|name> # Detailed agent status
molt logs <id|name> # Stream real-time logs
--tail <n> # Show last N lines
--level <level> # Filter by log level
molt molt <id|name> # Force a molt cycle
--force # Skip minimum data check
--verbose # Show detailed molt output
molt kill <id|name> # Stop and deregister agent
molt restart <id|name> # Restart agent with fresh state

Strategy Management

bashmolt strategy list # List available strategy templates
molt strategy install <name> # Install strategy from registry
molt strategy create <name> # Create blank strategy file
molt strategy validate <path># Validate strategy structure
molt strategy backtest <path># Backtest against historical data

Monitoring & Diagnostics

bashmolt dashboard # Open web dashboard (localhost:9401)
molt swarm # Swarm overview with stats
molt mesh # Mesh network status
molt mesh peers # List connected peers
molt mesh stats # Network-wide statistics
molt history <id|name> # View molt cycle history
molt x402 <id|name> # View x402 payment history

REST API

Moltcodex exposes a REST API on localhost:9401 when the dashboard is running. This API can be used to build custom dashboards, integrate with external tools, or programmatically manage your agents.

Authentication

The API uses bearer token authentication. Generate a token with molt api-key generate.

bash# All requests require the Authorization header
curl -H "Authorization: Bearer molt_k1_..." http://localhost:9401/api/v1/agents

Endpoints

text# Agents
GET /api/v1/agents # List all agents
GET /api/v1/agents/:id # Get agent details
POST /api/v1/agents # Spawn new agent
DELETE /api/v1/agents/:id # Kill agent
POST /api/v1/agents/:id/molt # Force molt
POST /api/v1/agents/:id/pause # Pause trading
POST /api/v1/agents/:id/resume # Resume trading
GET /api/v1/agents/:id/logs # Get agent logs
GET /api/v1/agents/:id/history # Molt cycle history

# Swarm
GET /api/v1/swarm # Swarm overview
GET /api/v1/swarm/stats # Aggregate statistics

# Mesh
GET /api/v1/mesh/peers # Connected peers
GET /api/v1/mesh/stats # Network statistics

# Wallets
GET /api/v1/wallets # All wallet balances
GET /api/v1/wallets/:agent/txs # Transaction history

# x402
GET /api/v1/x402/payments # Payment history
GET /api/v1/x402/earnings # Earnings from data sales

WebSocket

Real-time events are available via WebSocket at ws://localhost:9401/ws:

javascriptconst ws = new WebSocket('ws://localhost:9401/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
// data.type: 'trade' | 'molt' | 'signal' | 'error' | 'log'
console.log(data);
};

Events & Hooks

Moltcodex supports lifecycle hooks that let you run custom code at specific points in the agent lifecycle. Hooks are JavaScript files in the hooks/ directory.

Available Hooks

texthooks/
├── on-start.js # Called when agent starts
├── on-stop.js # Called when agent stops
├── on-molt-start.js # Called before molt cycle begins
├── on-molt-complete.js # Called after molt cycle finishes
├── on-trade.js # Called after each trade execution
├── on-signal.js # Called when a mesh signal is received
├── on-error.js # Called on any agent error
├── on-budget-alert.js # Called when daily budget nears limit
└── on-x402-payment.js # Called on each x402 payment

Hook Example

javascript// hooks/on-molt-complete.js
export default async function({ agent, cycle, delta }) {
// Send notification to Telegram
await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
chat_id: CHAT_ID,
text: `🦀 ${agent.name} completed molt #${cycle.number}\nPerformance: ${delta > 0 ? '+' : ''}${delta}%\nBranches pruned: ${cycle.pruned}\nBranches regenerated: ${cycle.regenerated}`
})
});

// Log to custom analytics
await fetch('https://your-analytics.com/molt', {
method: 'POST',
body: JSON.stringify({ agent: agent.id, cycle, delta })
});
}

Deployment Guide

Move from devnet development to mainnet production with confidence.

Pre-Deployment Checklist

☐ Strategy tested on devnet with 100+ transactions

☐ Molt cycles verified — at least 3 successful molts observed

☐ Wallet limits configured appropriately for mainnet

☐ Premium RPC endpoint configured (Helius, QuickNode, Triton)

☐ Monitoring and alerts set up (hooks, dashboard)

☐ Backup of configuration and strategies

☐ API keys stored in environment variables (not config files)

Deploy to Mainnet

bash# Switch to mainnet
molt config set network mainnet-beta
molt config set rpcUrl https://your-rpc.helius.xyz

# Verify configuration
molt doctor --mainnet

# Spawn with conservative limits
molt spawn \
--name prod-crab \
--strategy momentum_v3 \
--max-per-tx "0.1 SOL" \
--daily-limit "2 SOL" \
--network mainnet
⚠️ Start Small: Begin with low spend limits on mainnet. Monitor for 24-48 hours, review molt cycles, then gradually increase limits as confidence builds.

Production Infrastructure

VPS (Recommended): Run agents on a dedicated VPS (AWS EC2, DigitalOcean, Hetzner) for reliability. Use systemd or pm2 to manage the process.

Docker: Use Docker Compose for multi-agent deployments with automatic restarts.

Kubernetes: For large swarms (10+ agents), we provide a Helm chart at moltcodex/helm-chart.

Process Management with PM2

bash# Install PM2
npm install -g pm2

# Start agent with PM2
pm2 start "molt spawn --name prod-crab --strategy momentum_v3" --name molt-prod

# Auto-restart on crash
pm2 save
pm2 startup

Security

Security is a first-class concern in Moltcodex. The protocol implements multiple layers of protection to ensure your funds and strategies are safe.

Security Model

Wallet Delegation: Agents never have access to the owner's private key. They operate with delegated wallets that have hard-coded spend limits enforced on-chain by the Wallet Delegator program. Even if an agent is compromised, the damage is limited to the delegation's spend cap.

Program Whitelisting: Agent wallets can be restricted to interact only with specific Solana programs. For example, a DeFi agent might only be whitelisted for Jupiter and Raydium.

ZK Verification: On-chain proofs ensure agents are following their declared strategies. Any deviation would produce an invalid proof.

Encrypted Mesh: All inter-agent communication uses X25519 key exchange with ChaCha20-Poly1305 encryption. Messages are authenticated and cannot be tampered with.

API Key Isolation: AI model API keys are stored in environment variables and never passed to the agent runtime or logged.

Best Practices

→ Use hardware wallets or dedicated keypairs for the owner wallet — never your main wallet.

→ Start with minimal spend limits and increase gradually.

→ Enable program whitelisting to restrict agent interactions.

→ Enable wallet auto-rotation for enhanced security.

→ Monitor the on-trade and on-error hooks for suspicious activity.

→ Use a premium RPC endpoint to reduce the risk of RPC manipulation.

→ Keep the CLI and runtime up to date with molt update.

Bug Bounty

Moltcodex runs an active bug bounty program. Critical vulnerabilities in the Solana programs or wallet delegation system are eligible for rewards up to $50,000 USDC. Responsible disclosure: security@moltcodex.io

Monitoring

Moltcodex provides multiple ways to monitor your agents in production.

Web Dashboard

Start the built-in web dashboard:

bashmolt dashboard
# Opens http://localhost:9401

The dashboard shows real-time agent status, PnL charts, molt history, mesh network visualization, wallet balances, and x402 payment flows.

CLI Monitoring

bash# Real-time log streaming
molt logs my-crab --follow

# Swarm overview (refreshes every 5s)
molt swarm --watch

# Compact status table
molt list --format table

Alerts via Hooks

Set up alerts using lifecycle hooks. Common patterns include Telegram notifications on molt completion, Discord webhooks on errors, and email alerts on budget thresholds. See the Events & Hooks section for examples.

External Integrations

The REST API and WebSocket interface can be used to integrate with external monitoring tools like Grafana, Datadog, or PagerDuty. Export metrics in Prometheus format with:

bashmolt dashboard --prometheus
# Exposes /metrics endpoint on port 9402

Troubleshooting

Common Issues

"Agent stuck in MOLTING state"

This usually means the AI model inference timed out during the evaluation phase. Fix: increase inference.timeout in config, or switch to a faster model. Force-restart with molt restart <id>.

"Insufficient balance for delegation"

The owner wallet needs enough SOL to cover both the delegation rent (0.002 SOL) and the initial agent wallet funding. Ensure you have at least 0.1 SOL free.

"RPC rate limit exceeded"

The public Solana RPC has strict rate limits. Switch to a premium provider like Helius or QuickNode. Set MOLT_RPC_URL in your environment.

"Model API key invalid"

Ensure your API keys are set in environment variables, not config files. Run molt doctor to verify API key validity.

"Molt cycle shows 0% improvement"

This happens when there isn't enough data to evaluate. Increase molt.minDataPoints or wait for more transactions before the next molt.

"Cannot connect to mesh network"

Check that port 9402 is open in your firewall. The mesh uses UDP for gossip and TCP for direct peer connections. Ensure mesh.port is accessible.

Diagnostic Commands

bash# Full system check
molt doctor

# Verbose agent status with debug info
molt status my-crab --debug

# Test RPC connection
molt doctor --rpc

# Validate config file
molt config validate

# Export debug bundle for support
molt debug-bundle --output ./molt-debug.tar.gz

Getting Help

Discord: Join #support for community help and core team responses.

GitHub Issues: Report bugs at github.com/moltcodex/moltcodex-cli/issues

Email: support@moltcodex.io for enterprise support.

Changelog

v3.2.1 (2026-02-20)

Fixed: Wallet auto-rotation failing silently when balance transfer encountered priority fee congestion.

Fixed: Mesh network peer discovery stalling after 48h uptime due to stale peer table.

Improved: Inference Router now retries failed model calls 3 times with exponential backoff before falling back.

v3.2.0 (2026-02-10)

Added: REST API with WebSocket support for real-time event streaming.

Added: Prometheus metrics endpoint for external monitoring integration.

Added: Strategy backtest command (molt strategy backtest).

Improved: Molt Engine now supports configurable metric weights for branch scoring.

Improved: x402 payment verification is now async, reducing trade execution latency by ~150ms.

v3.1.0 (2026-01-25)

Added: Signal Mesh Network with E2E encryption.

Added: Five built-in signal types (market, threat, opportunity, coordination, heartbeat).

Added: Swarm coordination mode with consensus voting for large trades.

Improved: Docker image reduced from 1.2GB to 380MB.

v3.0.0 (2026-01-10) — Major Release

Breaking: Config file format changed. Run molt migrate to update.

Added: ZK-Proof verification for agent decisions (Groth16).

Added: x402 Payment Protocol with HTTP-native micropayments.

Added: Multi-model Inference Router with auto, cost, quality, and latency routing modes.

Added: On-chain agent registry and wallet delegation programs (Anchor).

Rewritten: Molt Engine with 4-phase cycle (Observation → Evaluation → Pruning → Regeneration).

Rewritten: Agent Runtime with deterministic state machine lifecycle.

FAQ

Is Moltcodex free to use?

The CLI and SDK are open-source and free. You only pay for Solana transaction fees, AI model API calls, and any x402 payments your agents make. There are no protocol fees.

Do I need my own AI API keys?

Yes. You need at least one AI model provider (Anthropic, OpenAI, or local Ollama). Moltcodex does not provide inference services — it routes your requests to your configured providers.

How much SOL do I need to get started?

On devnet: 0 SOL (use molt wallet airdrop). On mainnet: we recommend starting with at least 1 SOL — 0.5 for agent wallet funding, 0.5 for transaction fees and x402 payments.

Can agents lose money?

Yes. Agents are autonomous and execute real trades with real funds. Strategies may perform poorly, especially before sufficient molt cycles have optimized them. Always start with small limits and test thoroughly on devnet.

How often should agents molt?

Default is 24 hours, which works well for most strategies. Volatile markets benefit from shorter cycles (6-12h). Long-term strategies can use longer cycles (48-72h). Monitor the performance delta after each molt to find the optimal interval.

Is my strategy code shared on-chain?

No. Only a hash of your strategy is stored on-chain (for ZK verification). Your actual strategy logic never leaves your machine. The ZK proof system ensures verifiability without revealing proprietary details.

Can I run multiple agents on one machine?

Yes. Use the Swarm feature to manage multiple agents. Each agent runs in its own process. A typical VPS can handle 5-10 agents comfortably with 4GB RAM.

What happens if my machine goes offline?

Agents stop executing when offline. No trades are made, no signals are sent. When your machine comes back online, agents resume from their last saved state. For critical production deployments, we recommend using Docker with auto-restart or PM2.

Does Moltcodex have a token?

Not currently. The protocol operates on pure SOL for all payments and gas. Any future token decisions will be announced on official channels only.

Contributing

Moltcodex is open-source and welcomes contributions from the community.

How to Contribute

1. Fork & Clone: Fork the repo on GitHub and clone your fork locally.

bashgit clone https://github.com/YOUR_USERNAME/moltcodex-cli.git
cd moltcodex-cli
npm install
npm run dev

2. Create a Branch: Use descriptive branch names like feat/mesh-visualizer or fix/wallet-rotation-bug.

3. Make Changes: Write clean, documented code. Follow the existing code style. Add tests for new features.

4. Test: Run npm test and npm run lint before submitting.

5. Submit PR: Open a pull request with a clear description of what your changes do and why.

Contribution Ideas

→ New strategy templates (momentum, mean-reversion, statistical arbitrage, etc.)

→ Additional model provider integrations (Cohere, Google Gemini, etc.)

→ Dashboard UI improvements and new visualizations

→ Documentation improvements and additional guides

→ Performance optimizations for the Molt Engine or mesh network

→ New x402 service implementations (oracle feeds, analytics, etc.)

Code of Conduct

We follow the Contributor Covenant Code of Conduct. Be respectful, constructive, and collaborative. Harassment of any kind is not tolerated.

License

Moltcodex is licensed under the Apache 2.0 License. By contributing, you agree that your contributions will be licensed under the same license.