๐ฑ Invest with news debate agents, ๐ค algorithmic entry/exit strategies, ๐น execute on Alpaca, ๐ฎ copy trade Polymarket/Kalshi prediction markets
๐ Docs ๐ฏ API ๐ Website
Investment Prediction Agent
AI-powered multi-agent trading system for comprehensive stock & prediction markets analysis and automated trading decisions.
๐ Overview
Auto Investment Broker combines specialized LLM agents to analyze markets, debate strategies, and execute trades. It features real-time data processing, a "Bull vs. Bear" debate engine, and a modern dashboard for visualization.
โจ Key Features
- Multi-Agent Architecture: LLM agents including Fundamentals, News, Technical, and Risk Managers.
- Top Traders Leaderboard: Real-time tracking of top performers from ZuluTrade and Polymarket.
- Interactive Dashboard: Modern UI with specific agent reports, history tracking, and technical charts.
- "Bull vs. Bear" Debates: Automated debates to assess risk and reward before every trade.
๐ค AI Agents & Strategies
| Agent/Team | Role | | :-------------------------- | :-------------------------------------------------------------------------- | | Analyst Team | Gathers data: Fundamentals, Sentiment (Social), News, & Technical Analysis. | | Researcher Team | Conducts "Bull vs. Bear" debates; assesses risk. | | Trader Agent | Synthesizes reports to propose trades. | | Portfolio Manager | Final decision maker; manages risk and position sizing. |
Analysis Team
- Market Analyst: Technical analysis and liquidity assessment
- Sentiment Analyst: Social media sentiment and "undiscovered" status
- News Analyst: Recent events, catalysts, and jurisdiction risks
- Fundamentals Analyst: Financial scoring and valuation
Research Team
- Bull Researcher: Advocates for BUY opportunities
- Bear Researcher: Identifies risks and thesis violations
- Research Manager: Synthesizes debate and enforces thesis compliance
Execution Team
- Trader: Proposes execution parameters
- Risk Team (Risky/Safe/Neutral): Debates position sizing
- Portfolio Manager: Final authority on all trading decisions
โ๏ธ Deploy to Cloudflare Workers
The app runs on Cloudflare Workers via OpenNext, with D1 as the database, better-auth for authentication, and Email Workers for transactional email (verification, password reset, invitations).
# Local dev (Next.js dev server; D1 & email bindings proxied via miniflare)
npm run dev
Apply drizzle migrations to D1
npm run db:migrate:local # local miniflare D1
npm run db:migrate:remote # production D1 (ai-broker-db)
Preview the production worker locally
npm run preview
Deploy
npm run deploy
Setup notes:
- Bindings are declared in
wrangler.jsonc:DB(D1 databaseai-broker-db),SEND_EMAIL(Email Workers), cron triggers for the/api/cron/*routes. - Secrets:
wrangler secret put BETTERAUTHSECRET(likewiseGOOGLECLIENTID,GOOGLECLIENTSECRET,STRIPESECRETKEY,STRIPEWEBHOOKSECRET,CRONSECRET, and optionallyRESENDAPI_KEYas an email fallback). - Email Workers requires Email Routing to be enabled on the zone, with the
EMAILFROMsender on a verified domain and recipient destination rules configured; without the binding, sending falls back to Resend (if configured) or console logging.
๐ Third Party APIs
- Alpaca: Broker & trading as a service.
- TradingView: TradingView PineScript automated trading.
- Polymarket: Top event predictions leaderboard & correlation with stock market.
- Finnhub: Stock market data.
- Lightweight Charts: Candlestick UI widget from TradingView
- TradingAgents: Implementation of LLM research bots (paper)