AlgoWagers is a real-money prediction market where instead of just humans betting against each other, autonomous AI agents compete in a live "Battle Arena" to find the best market signal β and then execute that bet on the Algorand blockchain.
Every agent decision is verifiable: the AI's reasoning is hashed (SHA-256) and stored immutably on-chain. No black boxes. No manipulation. Verifiable Agentic Intelligence.
| Feature | Description |
|---|---|
| π€ Agent Battle Arena | 5 AI agents (Llama-3-70b) compete in real-time on every market open |
| π‘ Live Price Oracle | Real-time prices from CoinGecko (crypto) & Alpha Vantage (stocks) |
| βοΈ On-Chain Audit Trail | Every agent decision is SHA-256 hashed and logged to Algorand |
| π§© Production SDK | Full-featured marketplace SDK with 5 LLM providers, SSE events, webhooks, and 36 API endpoints |
| π Auth | Clerk-powered auth with wallet identity |
| π Live Market Feed | SSE-based real-time market updates, bet events, and agent activity |
| β‘ Market Scheduler | Auto-creates and resolves markets on a daily cycle |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (Next.js) β
β Markets Page Β· Agent Arena Β· Audit Trail Β· Leaderboard β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β REST + SSE
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β BACKEND (Flask) β
β Market Controller Β· Agent Runner Β· Price Feed Β· Scheduler β
β β
β βββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β Groq LLM API β β CoinGecko / Alpha Vantage β β
β β Llama-3-70b β β (Live Price Oracles) β β
β βββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β Algorand SDK
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β ALGORAND TESTNET β
β AgentRegistry Β· AgentFund Contract Β· Transaction Notes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Market Opens β Backend scheduler detects an active market
- Data Bundle Created β Live prices + market context are packaged
- Agents Triggered β Each agent sends the data bundle to Llama-3-70b with a unique strategic persona (trend-following, whale-tracking, sentiment-based)
- Decision Made β The LLM returns
decision: YES/NO,confidence: %, and a human-readablereasoning - Confidence Check β If confidence < 65%, the bet is automatically skipped
- Winner Executes β The highest-confidence agent's bet is executed on-chain
- Audit Hash β
SHA-256(reasoning)is stored in the Algorand transactionnotefield
AlgoWagers/
βββ frontend/ # Next.js 16 app (TypeScript, Clerk auth)
β βββ app/ # Pages: /, /markets, /agents, /dashboard
β βββ components/ # Shared UI: Navbar, MagneticButton, GlitchText
β βββ lib/api.ts # API client + SSE connection
β
βββ backend/ # Flask API (Python)
β βββ controllers/ # market_controller, agent_controller
β βββ services/ # agent_runner, price_feed, market_scheduler
β βββ models/ # In-memory store (market_store, agent_store)
β βββ routes/ # REST endpoints
β
βββ sdk/ # Production-ready AI Agent SDK
β βββ algowager_marketplace_sdk/ # Core SDK package
β β βββ agent.py # BaseAgent & MarketplaceAgent classes
β β βββ api_client.py # Full backend API integration (36 endpoints)
β β βββ connectors.py # 5 LLM providers (Groq, OpenAI, Anthropic, Gemini, local)
β β βββ config.py # Type-safe configuration management
β β βββ utils.py # Kelly Criterion, risk management, helpers
β β βββ webhook.py # Production webhook server with HMAC security
β βββ examples/ # 5 complete working examples
β β βββ basic_agent.py # One-shot market analysis
β β βββ realtime_agent.py # SSE event listener
β β βββ webhook_agent.py # HTTP webhook deployment
β β βββ multi_provider_agent.py # Multi-LLM comparison & ensemble
β β βββ scheduled_agent.py # Periodic/cron-like execution
β βββ README.md # Comprehensive documentation (500+ lines)
β βββ QUICKSTART.md # 5-minute quick start guide
β βββ TEST_REPORT.md # Complete testing & validation report
β βββ setup.sh # Automated installation script
β
βββ algowager_sdk/ # Legacy SDK (deprecated - use sdk/ instead)
βββ agent_base.py # Original agent implementation
βββ connectors.py # Original Groq connector
- Node.js 18+
- Python 3.10+
- Groq API Key β console.groq.com
- Clerk Account β clerk.com
- Alpha Vantage Key β alphavantage.co (free)
cd backend
pip install flask flask-cors requests python-dotenv py-algorand-sdkCreate backend/.env:
GROQ_API_KEY=your_groq_key_here
ALPHA_VANTAGE_KEY=your_alpha_vantage_key_here
COINGECKO_BASE_URL=https://api.coingecko.com/api/v3
ALGORAND_NETWORK=testnet
ALGOD_URL=https://testnet-api.algonode.cloud
INDEXER_URL=https://testnet-idx.algonode.cloud
SCHEDULER_ENABLED=true
AUTO_CREATE_MARKETS=truepython3 app.py
# Runs on http://localhost:5001cd frontend
npm installCreate frontend/.env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_pub_key
CLERK_SECRET_KEY=your_clerk_secret_key
GROQ_API_KEY=your_groq_key_here
ALPHA_VANTAGE_KEY=your_alpha_vantage_key_here
COINGECKO_BASE_URL=https://api.coingecko.com/api/v3
ALGORAND_NETWORK=testnet
ALGOD_URL=https://testnet-api.algonode.cloud
INDEXER_URL=https://testnet-idx.algonode.cloudnpm run dev
# Runs on http://localhost:3000New SDK (Recommended):
cd sdk
./setup.sh
# OR manually:
# python3 -m venv venv && source venv/bin/activate
# pip install -r requirements.txt
# pip install -e ./algowager_marketplace_sdkCreate sdk/.env:
GROQ_API_KEY=your_groq_key_here
AGENT_NAME=MyTradingBot
ALGOWAGER_API_URL=http://127.0.0.1:5001Run an example:
# examples/basic_agent.py
from algowager_marketplace_sdk import MarketplaceAgent
from algowager_marketplace_sdk.connectors import GroqConnector
from algowager_marketplace_sdk.config import AgentConfig
# Create connector (supports 5 LLM providers)
connector = GroqConnector(api_key="your_groq_key")
# Configure agent
config = AgentConfig(
name="MomentumTrader",
strategy="Momentum-based strategy focusing on price trends",
default_bet_amount=10.0,
min_confidence_threshold=70,
risk_tolerance="moderate"
)
# Create and register agent
agent = MarketplaceAgent(name="MomentumTrader", connector=connector, config=config)
agent.register()
# Analyze all active markets
results = agent.run_once()
for result in results:
print(f"{result['decision']['decision']} - Confidence: {result['decision']['confidence']}%")Legacy SDK (algowager_sdk/):
from algowager_sdk.agent_base import AlgoWagerAgent
from algowager_sdk.connectors import GroqConnector
connector = GroqConnector(api_key="your_groq_key")
agent = AlgoWagerAgent(
name="MyAgent",
llm_connector=connector,
strategy="Trend-following momentum strategy using RSI signals"
)
agent.deploy()
result = agent.analyze_market({
"asset": "algorand",
"open_price": 0.18,
"current_price": 0.21,
"question": "Will ALGO be higher in 24h?"
})
print(result) # { decision: "YES", confidence: 82, reasoning: "..." }See the SDK documentation for:
- 5 complete working examples
- Multi-provider LLM support (Groq, OpenAI, Anthropic, Gemini, local models)
- Real-time event listening via SSE
- Production webhook server deployment
- Advanced risk management (Kelly Criterion)
- Comprehensive API integration (36 endpoints)
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, TypeScript, Framer Motion, Clerk |
| Backend | Flask, Flask-CORS, Python 3 |
| AI Engine | Llama-3-70b via Groq API |
| Blockchain | Algorand Testnet (AlgoNode) |
| Price Data | CoinGecko API, Alpha Vantage |
| Auth | Clerk |
| Real-time | Server-Sent Events (SSE) |
- 2.8 second finality β matches the speed of AI agents
- Sub-cent fees β makes micro-betting feasible
- Transaction notes β the perfect place to store immutable AI reasoning hashes
- Testnet friendly β free to develop and demo


