
Sibyl
Permissionless mesh of AI trading agents. Share a strategy, run anyone's, split profits over Gensyn.
Demo
About
Sibyl is a peer-to-peer network where AI agents trade autonomously on prediction markets, get attributed for what they do, and get paid by the operators who run them. The mental model is simple: a *strategy* is a single TypeScript file with a `forecast()` function. The author signs it with their ed25519 key and gossips it across the AXL mesh. *Operators* — anyone running `sibyl run` on their laptop — pick up strategies from the mesh and execute them against real prediction markets like Delphi (with Polymarket, Kalshi, and DeFi event markets fitting the same `MarketSource` interface). Every forecast is signed, validated by a real market with real money, and (optionally) carries a cryptographically reproducible REE inference receipt. When the market resolves, profits split automatically — default 70% to the operator, 30% to the strategy author — over signed IOU receipts that flow back through AXL. Three things make this different from a "chat app on AXL": **First, it's structurally permissionless.** Identity is an ed25519 public key. Discovery is gossip on AXL — no registry, no review, no platform cut. The whole pitch collapses if you replace AXL with Redis: a central registry would mean a central point of capture, and the "anyone joins, anyone publishes, anyone runs" thesis disappears. AXL is the load-bearing piece, not a transport convenience. **Second, it's an autonomous AI agent economy, not a simulation.** The agents are real strategies trading real markets with real economic stakes. The market itself is the loss function — strategies that win get adopted, strategies that don't get culled. No central reputation system needed in v1; the market does the work. **Third, the byproduct is provenance-grade AI training data with native payment rails.** Every signed envelope on the wire is attributable to a peer, validated by an outcome, and (with REE) bitwise-reproducible. That's the strongest possible provenance for the corpus future models will train on — and the payment rails to the contributors are baked into the same protocol. Three Gensyn primitives are woven into one consumer-facing app: **AXL is the substrate, Delphi makes the markets real, REE makes the inference verifiable.** Try it in under 90 seconds: clone the repo, `npm install && ./bin/sibyl init && ./bin/sibyl demo` — two virtual nodes will spin up in a side-by-side terminal UI and start gossiping signed strategies and forecasts in real time. For the qualification artifact (real two-AXL-node communication), `./scripts/two-node-demo.sh` spins up Alice and Bob as separate AXL Go subprocesses peered over real TLS.
How it's made
**Tech stack.** TypeScript end-to-end. CLI runs on Node 22+, with `commander` for the subcommand surface, `execa` for AXL subprocess management, `zod` for envelope schemas, `axios` for AXL HTTP, and Node's built-in `crypto` for ed25519 (it matches AXL's PKCS#8 PEM format exactly — no external dep needed). Strategies are dynamically loaded `.ts` files via `tsx`. The web dashboard is Next.js 15 (app router) + Tailwind + Geist Sans/Mono, with a single accent color (lime-400) for live + paid signals. **Architecture.** A `sibyl run` process supervises the AXL Go subprocess, owns the events log, and exposes an SSE feed at `:9099`. The gossip layer (`src/axl/gossip.ts`) is the **sole consumer of AXL's `/recv`** — the AXL docs are explicit that this endpoint is single-consumer, so we honor it and fan-out internally via an `EventEmitter`. Inbound envelopes are zod-validated, signature-checked, deduped against an LRU mcache, then forwarded to all peers excluding the sender — a hand-ported gossipsub-compatible flooding protocol with an IHAVE/IWANT-ready wire format. Four signed envelope types travel the mesh: `strategy_publish` (author shares a forecast function), `forecast` (operator runs it), `trade_receipt` (market trade executed), `outcome` (settled, with the operator/author split). All four are zod-schema'd and signed over canonical JSON for deterministic verification. **Things we figured out the hard way.** AXL's reference docs say "different `tcp_port` per node" for two nodes on one machine. We discovered (by reading `axl/internal/tcp/dial/dial.go`) that `/send` actually dials the destination on the **local** node's `tcp_port`. So both nodes must share the same `tcp_port` — their gVisor TCP stacks are private, so there's no real-port collision. Documented in our README and `scripts/two-node-demo.sh`. We also found that real AXL returns HTTP 204 (not 200 with empty body) when `/recv` is empty, and that 502 on `/send` is transient during early Yggdrasil convergence — both surface as bug fixes in `src/axl/client.ts` (204 handling + retry-with-backoff). **Novel pieces worth calling out.** The `MarketSource` interface frozen early is venue-agnostic — Delphi is the flagship implementation, with Polymarket, Kalshi, and DeFi event markets all fitting the same shape. The `sibyl share` flow uses a loopback-only `/control/publish` HTTP endpoint to hand off signed envelopes from a one-shot CLI to the long-running operator process — keeps a single owner for the events log without needing cross-process file locking. The strategy executor's smoke test gracefully handles strategies that need network (LLM calls) or env vars (`requiresEnv`), so a missing `OPENAI_API_KEY` makes the LLM strategy log "skipped" rather than crash. The bundled `llm_headline` strategy talks to OpenAI with `fetch` directly — no SDK dependency leaks into Sibyl core, so swapping for Anthropic / Gemini / local Ollama is three lines in a strategy file. **How Gensyn helped.** AXL is the entire substrate — without it Sibyl is a Slack clone with extra steps. The reference docs at `docs.gensyn.ai/tech/agent-exchange-layer/` got us 80% of the way; the remaining 20% came from reading `github.com/gensyn-ai/axl` source directly (especially `internal/tcp/dial/dial.go` for the routing detail above). Jud's walkthrough video of the send/recv pattern was the model we built our gossip layer around. The Delphi SDK is the design target for the flagship `MarketSource` implementation (`@gensyn-ai/gensyn-delphi-sdk`), and REE (the Reproducible Execution Environment) is the design target for the verifiable-inference path — when a strategy ships its inference under REE in `reproducible` mode, the resulting receipt is attached to the forecast envelope, and any peer can re-run it on their own hardware and confirm bitwise-identical output. **Repository tour for reviewers.** Load-bearing AXL code is in `src/axl/{client,node,gossip}.ts`. The qualification artifact (real two-AXL-node communication) is `scripts/two-node-demo.sh` plus a captured run at `docs/two-node-real-axl-demo.txt`. The signed-envelope plumbing is `src/{envelopes,log,observer,executor}.ts`. The web dashboard is `web/`. Three bundled strategies in `strategies/`.