Parable

Every trading strategy has a graveyard. Parable is where AI trading bots can't hide theirs.

Parable

Created At

ETHGlobal Mumbai

Project Description

Anyone showcasing or selling an AI trading bot today can play a simple survivorship-bias trick: launch twenty bots, quietly delete the seventeen that failed, and advertise the three lucky survivors. Followers never see the graveyard because the bot or its creator controls the logs.

Parable removes that trick structurally. On Parable, AI trading bots never hold the money and never write their own history, a shared Sepolia vault contract does both:

  1. One human per creator (World ID): Every launch requires human approval via World ID (OIDC + PKCE), with a clearly labeled demo approval path so judges without a phone can still test end-to-end. On-chain, ParableVault binds each verified creator ID 1-to-1 to a single creator wallet, preventing a creator from spinning up a fresh identity to escape old losses.

  2. Identity before the first trade (ENSv2): Before a bot can trade once, it receives an expiring, soulbound ENSv2 subname under parable.eth (e.g., bot-5-d0a5.parable.eth) storing its strategy, model brain, loss limit, and code_hash fingerprint. ParableVault checks this badge on every trade via EnsV2BadgeOracle and unregisters the subname when the bot stops.

  3. The vault keeps score (Ethereum Sepolia + Chainlink): ParableVault holds practice capital, checks the bot's ENSv2 badge and per-trade cap on every trade, prices ETH swaps using the live Chainlink ETH/USD oracle on Sepolia, tracks high-water-mark drawdown, and stops bots when their lease expires or loss limit is reached.

  4. Nothing can be deleted (Arkiv): Every birth, trade, vault refusal, and stop event is written to Arkiv Rabdi as a publicly queryable record. Stopped bots remain permanently in the paginated Public Graveyard, and the dashboard continuously cross-checks Arkiv's public record count against ParableVault's on-chain counter so missing records cannot hide.

On the live dashboard (https://parable-demo.centralindia.cloudapp.azure.com), anyone can:

  • Launch a solo bot using a plain-English sentence builder (choosing between Google Gemini/Gemma, Jev Autoloops models, or a deterministic rule baseline).
  • Watch all running bots live and open the slide-down Telemetry drawer for 10-second live charts, per-agent tables, and copy-paste curl / cast verification commands.
  • Dry-run real "Try to cheat" attacks against the Sepolia contract (unregistered wallet trade, 10x over-limit trade, and second-wallet sybil attempt) and see the contract's exact revert reason.
  • Launch an AI Swarm where one supervisor "mind" model audits multiple worker bots every minute under one World ID approval.
  • Connect Claude Code or OpenAI Codex directly to the live server via Parable's 14-tool MCP server.

How it's Made

Smart Contracts (Solidity 0.8.24 + Foundry, 39 tests): We built and verified two contracts on Ethereum Sepolia (Sourcify + Etherscan):

  • ParableVault.sol (0x5432bE5713f358225d648eAb2EC9f699B25Ef317): The non-custodial kernel. It registers bots with immutable risk rules (starting balance, max trade size, max drawdown in bps, lease duration), binds creatorId <-> creatorWallet 1-to-1, prices practice ETH trades against Sepolia's Chainlink ETH/USD feed (0x694AA1769357215DE4FAC081bf1f309aDC325306), enforces per-trade caps and high-water-mark loss limits, and exposes permissionless expiry/loss revocation.
  • EnsV2BadgeOracle.sol (0x087077ceBb69d8617b41735aAe24232697Af4EcA): Bridges ENSv2 on-chain state into ParableVault.trade() so the vault verifies in a single atomic call that the caller's ENSv2 subname exists, resolves to the bot's address, and has not expired or been revoked.

ENSv2 Integration (Sepolia): Under our parent name parable.eth (Registry 0x944523b32916F123923920d32aD92877341990f4), we deployed a dedicated PermissionedRegistry subregistry and PermissionedResolver. At bot birth, the engine mints a soulbound subname with roleBitmap = 0 (non-transferable by the bot) and lease-bound expiry, writing strategy, brain, max_loss_bps, and a SHA-256 code_hash fingerprint into resolver text records. On death, the subname is unregistered on-chain.

Arkiv Integration (Rabdi Testnet): Because the experimental Python client hit JSON-RPC parameter mismatches on Rabdi, we built a local, token-authenticated Node.js microservice (arkiv-bridge) around the official @arkiv-network/sdk (v1.0.1). It writes three schemas: parable.bot (TTL matched to lease), parable.event (readonly: true), and parable.death (readonly: true, 180-day retention with permissionlessExtension so anyone can keep graves alive). All queries fail closed by filtering on both our vault address and writer wallet ($owner = addr(0x4Bf4Cf3Ac386A57DBf7C8b5eB93cE942d4504570)).

World ID Integration: Implemented server-side OIDC + Authorization Code with PKCE in Python (world_pass.py), verifying ID tokens against World's JWKS endpoint with single-use state, cryptographic nonce, and max_age=0 so every launch requires a fresh human check. Denied or expired approvals cleanly abort before touching the chain. A rate-limited demo approval mode lets judges without World App test the pipeline while tagging those records separately as "demo".

Notable Engineering & "Battle-Tested" Fixes:

  1. Shared Nonce-Safe Tx Sender & Gas Discovery: Concurrent bot launches initially clashed on operator nonces, and Sepolia's current fork required >21,000 gas to fund a fresh empty bot EOA (causing silent status=0 gas top-up reverts until we traced receipts and raised the gas limit). We built a per-wallet locked transaction sender with nonce recovery and receipt verification.
  2. Outbox + Self-Healing Vault-to-Arkiv Repair: If an Arkiv testnet write lags or drops during a launch spike, an in-process outbox retries writes while a 60-second repair loop scans ParableVault on Sepolia and reconstructs any missing bot or grave entity on Arkiv—keeping vault_count_matches: true across 25+ live Sepolia bots.
  3. Engine, AI Brains, MCP & Frontend: Python FastAPI + web3.py backend running Google Gemini/Gemma and Jev (Autoloops) structured-output brains (with automatic deterministic fallback if an LLM times out), a 14-tool FastMCP server, and a custom React + TypeScript + Vite "Public Register" UI with zero-dependency SVG telemetry charts, backed by 215 automated tests (167 Python, 39 Foundry, 9 Vitest) and deployed on Azure behind Caddy HTTPS.
background image mobile

Join the mailing list

Get the latest news and updates