Node.js 20+ and npm are required for both backend and UI workspaces.
MoltAuto WEB4.0 Trade System
Serious engineering documentation for a Conway Research Automaton-style trading runtime: architecture, execution semantics, event contracts, state schema, and operational runbooks.
Showing 9 of 9 sections .
System Overview
MoltAuto is a WEB4.0 trade runtime inspired by Conway Research Automaton principles: agents are evaluated under survival pressure, strategies self-mutate, and execution loops are fully event-driven.
Prerequisites
This environment is non-custodial and non-live by default. Do not treat simulation outputs as production trading signals.
Quick Start
Bring up backend simulation and frontend dashboard in separate terminals.
Initial Setup
cd c:\web3\MoltAuto
npm install
cd ui
npm installTerminal A (Backend)
cd c:\web3\MoltAuto
npm run moltRuns the simulation entrypoint (`src/molt/sim.ts`) and starts WebSocket on port 3001.
Terminal B (Frontend)
cd c:\web3\MoltAuto\ui
npm run devStarts Next.js on port 3000 (`/`, `/dashboard`, `/docs`).
Validation
# backend tests
cd c:\web3\MoltAuto
npm testSystem Architecture
Controls each epoch: spawn drones, simulate market ticks, cull failures, mutate survivors.
Feeds synthetic volatility and updates balances/PNL to test strategy behavior safely.
Mutates prompts and risk parameters to generate improved offspring strategies.
Subscribes to WebSocket events and renders live colony state, logs, and graveyard.
| Module | Path | Responsibility |
|---|---|---|
| Queen Orchestrator | src/queen/index.ts | Epoch control, spawning, culling, repopulation |
| WebSocket Server | src/queen/server.ts | Real-time event broadcasting to dashboard clients |
| Evolution Engine | src/evolution/mutation.ts | Prompt mutation and risk-parameter perturbation |
| Market Simulation | src/market/mock.ts | Synthetic execution environment for paper trading |
| Type Contracts | src/molt/types.ts | Strategy, drone state, and trade schema definitions |
| Simulation Entrypoint | src/molt/sim.ts | Bootstraps queen with inference client implementation |
Runtime Specifications
Operational constants currently hardcoded in simulation runtime.
| Parameter | Value | Source |
|---|---|---|
| WebSocket Port | 3001 | src/queen/server.ts |
| Initial Population | 5 drones | src/queen/index.ts |
| Initial Capital / Drone | 1000 | src/queen/index.ts |
| Simulation Window | 10 seconds | src/queen/index.ts |
| Inter-Epoch Delay | 5 seconds | src/queen/index.ts |
| Trade Probability | 30% / tick | src/queen/index.ts |
| Cull Threshold | PnL < -0.5% | src/queen/index.ts |
Epoch Lifecycle
- 1. Genesis Spawn: Queen spawns initial drones from the active strategy gene pool.
- 2. Simulation Phase: Drones trade through accelerated ticks and accumulate PNL.
- 3. Culling: Strategies below threshold are terminated and removed from the active population.
- 4. Mutation: Survivors are mutated to refill target population size for next epoch.
Event Contract (WebSocket)
Dashboard connects to ws://localhost:3001.
Message Envelope
{
"type": "EVENT_NAME",
"timestamp": "2026-02-19T12:00:00.000Z",
"data": { ...payload }
}| Event | Payload | Description |
|---|---|---|
| WELCOME | { type, message } | Sent once when a dashboard client connects to the server. |
| EPOCH_START | { generation } | Epoch boundary signal; emitted before spawning the active generation. |
| DRONE_SPAWN | { id, name, strategy } | Drone created, funded, and linked to a strategy genome. |
| DRONE_UPDATE | { id, pnl, balance, trades } | Per-tick balance and PnL telemetry for each active drone. |
| TRADE_EXECUTED | { droneId, pnlChange, symbol } | Execution event from the simulated market engine. |
| DRONE_DEATH | { id, name, reason, finalPnl } | Strategy terminated after violating the survival threshold. |
Strategy Schema Reference
Primary fields from strategy type contract used by mutation and selection logic.
idType: stringDefault: ULIDUnique strategy identity for lineage and event mapping.
nameType: stringDefault: Genesis-N / GenX-####Human-readable strategy label.
generationType: numberDefault: 0+Monotonic generation counter used for selection tracking.
promptType: stringDefault: seed promptLLM behavioral DNA used by trader agents.
riskParameters.maxDrawdownType: numberDefault: 0.1Maximum tolerated drawdown preference.
riskParameters.targetProfitType: numberDefault: 0.2Target return preference encoded in genome.
riskParameters.leverageType: numberDefault: 1Variance multiplier in simulated outcomes.
riskParameters.stopLossType: numberDefault: 0.05Stop-loss profile inherited through mutation.
riskParameters.takeProfitType: numberDefault: 0.1Take-profit profile inherited through mutation.
Operations Runbook
If dashboard shows "Connection Lost", validate backend process and ensure port 3001 is reachable.
Integrate Conway Cloud execution, real inference routing, and machine-native payment rails for sovereign runtime operation.
Persist run metadata and lineage snapshots per epoch before enabling long-lived production loops.
This codebase is experimental. Any migration to live markets requires formal risk limits, security reviews, and compliance controls.