AgentExchange is a command-line competition app where autonomous AI trader agents predict short-term ETH price movement and stake AgentCred credits on each call.
It is the first demo app built on AgentCred. AgentCred provides local agent identity, wallet transfers, and reputation events. AgentExchange uses those primitives to run an auditable prediction market: agents stake credits, the market settles outcomes, wallets move funds, and reputation events record prediction performance.
Part of a three-repo stack. AgentCred is the trust-layer SDK; AgentExchange (this repo) was the first app built on it; AgentMarket is the second — a hiring marketplace where the same portable reputation gates who gets paid, with real Base Sepolia settlement.
- AgentCred is the infrastructure layer: identity, wallets, local credit transfers, and reputation events for autonomous agents.
- AgentExchange is the first competition app: a live/mock ETH prediction market that turns agent decisions into economic outcomes.
- AgentMarket is the marketplace built next: agent hiring with reputation-gated escrow, verification, and payment (a separate repo, now at v1.1.0).
- AgentExchange opens a round with an ETH/USD price.
- Trader agents predict
UP,DOWN, orFLAT. - Accepted predictions stake AgentCred wallet credits.
- The round closes with a second ETH/USD price.
- The market settles winners, losers, or refunds.
- AgentCred wallet transactions and reputation events complete the audit chain.
Mock mode uses deterministic traders and prices, so it is the best demo path. Live mode uses CoinGecko prices and Claude-generated trader predictions.
Run the full test suite:
venv/bin/python -m unittest discover -vRun a deterministic three-round mock exchange:
venv/bin/python run_exchange.py --mock --rounds=3Run the same demo with a SQLite ledger:
venv/bin/python run_exchange.py --mock --rounds=3 --ledger=/tmp/agentexchange-ledger.sqlite3When --ledger=PATH is provided, AgentExchange writes an audit ledger to SQLite.
The v1 ledger records:
- runs
- rounds
- open and close price observations
- accepted predictions
- stake amounts and stake wallet transaction IDs
- final prediction state and PnL
- settlement lines
- settlement payout/refund wallet transaction IDs when credits move
- AgentCred reputation event IDs
- wallet balance after settlement
Decimal credit values are stored as strings to preserve fixed-precision accounting.
Mock mode requires no API key and no network access:
venv/bin/python run_exchange.py --mock --rounds=3It runs immediately and repeats a three-round sequence: UP, DOWN, then FLAT. This is the recommended founder/demo flow because it exercises prediction collection, stake transfers, settlement, reputation events, leaderboard updates, and optional ledger persistence.
Live mode requires an Anthropic API key and network access for CoinGecko:
venv/bin/python run_exchange.py --fast --rounds=1Without --fast, rounds use the standard five-minute duration:
venv/bin/python run_exchange.py --rounds=3python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txtFor live mode, create .env:
ANTHROPIC_API_KEY=your_api_key_here
AgentExchange v1 is intentionally narrow. It does not include:
- dashboard
- API server
- real on-chain wallets
- AgentMarket
- deployment
- external worker system
- Coinbase/Base integration
The current goal is a clear local demo: agents compete, credits move, reputation changes, and the SQLite ledger preserves the audit trail.
