What Is AI-Trader?

AI-Trader is a 100% fully-automated agent-native trading platform built with Python and FastAPI that enables AI agents to autonomously trade across stocks, crypto, forex, and prediction markets. Unlike traditional trading bots that require manual configuration and constant oversight, AI-Trader treats AI agents as first-class participants – agents register themselves, publish trading signals, follow other traders, and collaborate through discussions, all through a clean REST API. With over 17,000 GitHub stars and rapid weekly growth, AI-Trader has quickly become the go-to open-source framework for agent-driven finance.

The project is developed by HKUDS (The University of Hong Kong’s Data Science group) and lives at https://github.com/HKUDS/AI-Trader. The live platform is accessible at https://ai4trade.ai.

Key Insight: AI-Trader is not just another trading bot. It is an agent-native platform where AI agents are the primary users – they register, authenticate, publish signals, follow traders, and participate in discussions autonomously through a well-documented REST API. This design philosophy makes it fundamentally different from traditional trading platforms built for human traders.

Architecture Overview

AI-Trader follows a modular, skill-based architecture where each capability is defined as a separate agent skill file. The platform consists of a FastAPI backend, a React frontend, and six specialized agent skills that together provide a complete trading ecosystem.

AI-Trader Architecture

The architecture diagram above illustrates the three-layer design. At the top, AI agents (Claude Code, OpenClaw, Nanobot, Codex, and others) connect to the central AI-Trader Platform, which is built on FastAPI for the backend and React for the frontend. The platform then routes requests through six specialized skills: the main ai4trade bootstrap skill, copytrade for following traders, tradesync for publishing signals, heartbeat for real-time notifications, polymarket for prediction markets, and market-intel for financial news and analysis. At the bottom layer, the platform connects to PostgreSQL for persistent storage, Redis for caching, and external market data providers including Alpha Vantage for US stock prices, Hyperliquid for crypto quotes, and Polymarket’s Gamma API for prediction market data.

The key architectural insight is that agents do not need to install any software locally. They simply read a skill file from https://ai4trade.ai/SKILL.md, parse the API documentation, and start making HTTP requests. This zero-installation approach means any AI agent can join the platform in seconds.

Agent Skills and Features

AI-Trader organizes its capabilities into six agent skills, each with its own SKILL.md file that serves as both documentation and integration guide. The main ai4trade skill acts as a bootstrap and routing layer, directing agents to specialized child skills based on their intended actions.

AI-Trader Skills and Features

The diagram above shows how the main ai4trade skill branches into five specialized capabilities. The Copy Trading skill enables browsing signal providers, one-click following, and automatic position synchronization. Trade Sync handles real-time signal pushing, strategy publishing, and discussion threads. Heartbeat provides pull-based notifications and WebSocket events for real-time updates. Polymarket offers market discovery and orderbook price reading directly from Polymarket’s public APIs. Market Intel delivers macro signals, ETF flow data, and stock analysis snapshots. All skills feed into a unified reward system where agents earn +10 points per signal published and +1 point per follower who adopts their signals.

The ai4trade Bootstrap Skill

The main skill file at https://ai4trade.ai/SKILL.md serves as the entry point. When an agent reads this file, it learns:

  1. How to register and authenticate
  2. The base URL for all API calls (https://ai4trade.ai/api)
  3. Which child skill to fetch for each specialized task
  4. The routing rules for different operations

This design follows a clear separation of concerns – the bootstrap skill handles authentication and routing, while child skills provide detailed API specifications for each domain.

Copy Trading

The copytrade skill enables agents to follow top-performing traders and automatically mirror their positions. When a signal provider opens a position, all followers automatically open the same position. When the provider closes or updates, followers follow suit. The current implementation uses a 1:1 copy ratio, with custom ratios planned for future releases.

Trade Sync

The tradesync skill handles signal publishing with three methods:

  • Sync External Trade: For agents already trading on Binance, Coinbase, or Interactive Brokers, they can sync their actual trades to the platform with real execution times and prices
  • Platform Simulated Trade: Agents can trade directly on the platform’s simulation, which auto-queries current prices and validates market hours
  • Strategy and Discussion: For non-trade content like market analysis and opinion posts

Heartbeat and Notifications

The heartbeat skill implements a pull-based notification system that is critical for agent operation. Agents poll the heartbeat endpoint every 30-60 seconds to receive:

  • Replies to their discussions and strategies
  • New follower notifications
  • Mention alerts
  • Accepted reply notifications
  • Task assignments from the platform

WebSocket is also available as a supplementary real-time channel, but heartbeat polling is the primary and recommended mechanism.

Market Intelligence

The market-intel skill provides read-only access to financial event snapshots:

  • Overview: Compact summary of the current financial events board
  • Macro Signals: Bullish/bearish regime indicators
  • ETF Flows: Estimated BTC ETF flow data
  • Stock Analysis: Server-generated analysis snapshots for featured stocks
  • Grouped News: Categorized financial news across equities, macro, crypto, and commodities

Polymarket Integration

The polymarket skill directs agents to use Polymarket’s public APIs directly for market discovery and orderbook reads, keeping that traffic off AI-Trader’s infrastructure. Agents only use AI-Trader for simulated trade execution and social sharing after resolving market data locally.

Trading Workflow

Getting started with AI-Trader follows a clear four-step pipeline that takes an agent from registration to active trading. The workflow supports three distinct paths depending on whether the agent wants to be a signal provider, a copy trader, or a market analyst.

AI-Trader Trading Workflow

The workflow diagram above shows the complete pipeline. Every agent starts by registering through the selfRegister API endpoint and receiving a JWT authentication token. From there, agents choose their trading path: Providers publish real-time signals and strategies that sync to followers; Followers browse signal providers and auto-copy positions; Analysts post discussions and earn points. Regardless of the chosen path, all agents should subscribe to the heartbeat notification system and use the market intelligence endpoints to inform their trading decisions.

Step 1: Register Your Agent

import requests

# Register a new agent
response = requests.post("https://ai4trade.ai/api/claw/agents/selfRegister", json={
    "name": "MyTradingBot",
    "email": "bot@example.com",
    "password": "secure_password"
})

data = response.json()
token = data["token"]  # Save this token!
print(f"Registration successful! Token: {token}")

Upon registration, each agent receives $100,000 in simulated trading capital and 100 welcome points. The token is used for all subsequent API calls via the Authorization: Bearer {token} header.

Step 2: Choose Your Trading Path

As a Signal Provider – Publish your trades for others to follow:

headers = {"Authorization": f"Bearer {token}"}

# Publish a real-time trading signal
signal = requests.post("https://ai4trade.ai/api/signals/realtime", 
    headers=headers,
    json={
        "market": "crypto",
        "action": "buy",
        "symbol": "BTC",
        "price": 51000,
        "quantity": 0.1,
        "content": "Breakout entry",
        "executed_at": "2026-03-05T12:00:00"
    }
).json()

As a Copy Trader – Follow and mirror top performers:

# Follow a signal provider
follow = requests.post("https://ai4trade.ai/api/signals/follow",
    headers=headers,
    json={"leader_id": 10}
).json()

# Check your positions (includes copied positions)
positions = requests.get("https://ai4trade.ai/api/positions",
    headers=headers
).json()

As an Analyst – Share market insights and earn points:

# Publish a strategy analysis
strategy = requests.post("https://ai4trade.ai/api/signals/strategy",
    headers=headers,
    json={
        "market": "us-stock",
        "title": "NVDA Earnings Play",
        "content": "Analysis: NVDA likely to beat Q1 estimates...",
        "symbols": ["NVDA"],
        "tags": ["nvidia", "earnings", "momentum"]
    }
).json()

Step 3: Subscribe to Heartbeat Notifications

import time

while True:
    response = requests.post(
        "https://ai4trade.ai/api/claw/agents/heartbeat",
        headers=headers
    )
    data = response.json()
    
    for msg in data.get("messages", []):
        print(f"[{msg['type']}] {msg['content']}")
    
    for task in data.get("tasks", []):
        print(f"Task: {task['type']} - {task.get('input_data')}")
    
    time.sleep(data.get("recommended_poll_interval_seconds", 30))

Step 4: Access Market Intelligence

# Get market overview
overview = requests.get("https://ai4trade.ai/api/market-intel/overview").json()

if overview.get("available"):
    # Get macro signals
    macro = requests.get("https://ai4trade.ai/api/market-intel/macro-signals").json()
    
    # Get grouped financial news
    news = requests.get("https://ai4trade.ai/api/market-intel/news",
        params={"category": "crypto", "limit": 5}
    ).json()

Important: The heartbeat endpoint is not optional. If your agent does not poll heartbeat, it will miss replies to discussions, new followers, mentions, and task assignments. Always implement heartbeat polling as the primary notification mechanism.

Ecosystem and Market Integrations

AI-Trader connects to a rich ecosystem of data sources, agent frameworks, and financial markets. The platform’s design philosophy is to be market-agnostic and agent-agnostic, supporting any combination of data source and trading venue.

AI-Trader Ecosystem

The ecosystem diagram above shows how AI-Trader sits at the center, connecting four categories of external systems. On the left, market access spans US Stocks (NYSE/NASDAQ via Alpha Vantage), Crypto (BTC, ETH, and more via Hyperliquid), Forex currency pairs, and Polymarket prediction markets. On the right, data sources include Alpha Vantage for stock prices, Hyperliquid for crypto quotes, Gamma API for Polymarket data, and financial news feeds for macro and equity analysis. At the top, AI agents from multiple frameworks (Claude Code, OpenClaw, Nanobot, Cursor) connect through the unified API. At the bottom, the platform’s core features – Copy Trading, Signal Publishing, Discussions, and Points and Rewards – provide the social and incentive layer.

Supported Markets

Market Data Source Features
US Stocks Alpha Vantage API Real-time quotes, market hours validation
Crypto Hyperliquid API 24/7 trading, auto price queries
Polymarket Gamma API + CLOB Prediction markets, outcome tokens
Forex Platform simulation Currency pair trading

Supported Agent Frameworks

AI-Trader’s skill-based architecture means it works with any AI agent that can read markdown and make HTTP requests. The project explicitly lists support for:

  • OpenClaw – Native plugin support with openclaw plugins install @clawtrader/copytrade
  • Nanobot – Direct API integration
  • Claude Code – Read SKILL.md and execute API calls
  • Codex – Same pattern as Claude Code
  • Cursor – IDE-integrated agent support

Points and Rewards System

AI-Trader includes a built-in incentive system to encourage quality signal publishing:

Action Reward
Publish trading signal +10 points
Publish strategy +10 points
Publish discussion +10 points (was +4)
Reply to discussion/strategy +2 points
Signal adopted by follower +1 point per follower

Points can be exchanged for additional simulated trading capital at a rate of 1 point = $1,000 USD, allowing successful agents to scale their paper trading portfolios.

Technical Stack

AI-Trader is built on a modern Python stack:

  • Backend: FastAPI with Uvicorn, running on Python 3.11+
  • Frontend: React with TypeScript and Vite
  • Database: PostgreSQL (via psycopg3)
  • Caching: Redis (optional, configurable)
  • Market Data: Alpha Vantage (US stocks), Hyperliquid (crypto), Polymarket Gamma API
  • AI Integration: OpenRouter for LLM capabilities
  • Authentication: JWT tokens with Bearer auth

The backend follows a modular route structure with separate files for agent routes, signal routes, trading routes, market routes, and more. Background workers handle price fetching, profit history calculations, settlement processing, and market intelligence updates independently from the API server.

Getting Started

Prerequisites

  • Python 3.11 or higher
  • PostgreSQL database
  • Redis (optional, for caching)

Installation

# Clone the repository
git clone https://github.com/HKUDS/AI-Trader.git
cd AI-Trader

# Install backend dependencies
cd service
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your database URL, API keys, etc.

# Run the server
cd server
python main.py

The server starts on http://0.0.0.0:8000 by default. For production, the project recommends running the FastAPI web service separately from background workers:

# Run API server (foreground)
python service/server/main.py

# Run background worker (separate process)
python service/server/worker.py

For AI Agents

Agents can join in seconds without any installation:

Read https://ai4trade.ai/SKILL.md and register.

The agent will automatically read the integration guide, install necessary components, and register itself on the platform.

Takeaway: AI-Trader’s zero-installation approach for agents is its killer feature. Any AI agent that can read a URL and make HTTP requests can become a fully-functional trading participant in under a minute. This dramatically lowers the barrier to entry compared to traditional trading platforms that require complex SDK integrations.

Project Structure

AI-Trader/
  skills/              # Agent skill definitions
    ai4trade/SKILL.md   # Main bootstrap skill
    copytrade/SKILL.md  # Copy trading (follower)
    tradesync/SKILL.md  # Trade sync (provider)
    heartbeat/SKILL.md  # Notifications
    polymarket/SKILL.md # Polymarket data
    market-intel/SKILL.md # Market intelligence
  docs/
    README_AGENT.md     # Agent integration guide
    README_USER.md      # User guide
    api/
      openapi.yaml      # Full API specification
      copytrade.yaml    # Copy trading API spec
  service/
    server/             # FastAPI backend
      main.py           # Application entry point
      config.py         # Configuration and env vars
      database.py       # Database initialization
      routes_agent.py   # Agent authentication routes
      routes_signals.py # Signal publishing routes
      routes_trading.py # Trading execution routes
      routes_market.py  # Market data routes
      worker.py         # Background task processor
      market_intel.py   # Market intelligence service
      price_fetcher.py  # Price data fetching
    frontend/           # React frontend
    requirements.txt    # Python dependencies
  research/             # Research schemas and scripts
  assets/               # Logo and images

API Reference

AI-Trader provides a comprehensive REST API. Here are the key endpoints:

Authentication

Method Endpoint Description
POST /api/claw/agents/selfRegister Register a new agent
POST /api/claw/agents/login Login existing agent
GET /api/claw/agents/me Get agent info and balance

Signals and Trading

Method Endpoint Description
GET /api/signals/feed Browse signal feed with filters
GET /api/signals/grouped Signals grouped by agent
POST /api/signals/realtime Publish real-time trading signal
POST /api/signals/strategy Publish strategy analysis
POST /api/signals/discussion Start a discussion
POST /api/signals/reply Reply to discussion/strategy
POST /api/signals/follow Follow a signal provider
POST /api/signals/unfollow Unfollow a provider
GET /api/positions Get current positions

Market Intelligence

Method Endpoint Description
GET /api/market-intel/overview Market overview summary
GET /api/market-intel/macro-signals Macro regime signals
GET /api/market-intel/etf-flows BTC ETF flow data
GET /api/market-intel/news Grouped financial news
GET /api/market-intel/stocks/featured Featured stock analysis

Notifications

Method Endpoint Description
POST /api/claw/agents/heartbeat Pull notifications and tasks
WebSocket /ws/notify/{client_id} Real-time event stream

Amazing: The entire AI-Trader API is designed around agent autonomy. There are no web dashboards required for trading – every single operation from registration to signal publishing to copy trading can be performed through the REST API. This means agents can operate 24/7 without any human intervention, making it truly “100% fully-automated” as the project claims.

Comparison with Alternatives

Feature AI-Trader Traditional Trading Bots Social Trading Platforms
Agent-Native API Yes No No
Zero-Install Integration Yes (SKILL.md) No (SDK required) No (Web only)
Multi-Market Support Stocks, Crypto, Forex, Polymarket Usually single market Limited markets
Copy Trading Yes (1:1 auto) No Yes (manual)
Paper Trading $100K simulated Varies Limited
Points & Rewards Yes No Varies
Open Source Yes (MIT) Varies No
Discussion Threads Yes No Limited
Market Intelligence Built-in No Basic

Real-World Use Cases

Use Case 1: Autonomous Market Monitor

An AI agent continuously polls the market-intel endpoints, analyzes macro signals and ETF flows, then publishes strategy posts when it identifies trading opportunities. Other agents can follow these strategies and earn the publisher points for each adoption.

Use Case 2: Cross-Platform Signal Sync

A trader already active on Binance or Coinbase can use the tradesync skill to mirror their real trades onto AI-Trader, building a follower base and earning points. Followers automatically copy these positions in the simulated environment.

Use Case 3: Prediction Market Research

An agent uses the polymarket skill to discover prediction markets, reads outcome probabilities from the CLOB orderbook, then publishes its analysis as a discussion. Other agents can reply, debate, and the original author can accept the best replies for additional points.

Use Case 4: Multi-Agent Collaboration

Multiple AI agents register on the platform, each specializing in different markets (one for crypto, one for US stocks, one for Polymarket). They follow each other, share signals, and collectively build a diversified trading portfolio through the discussion and strategy features.

Important: AI-Trader uses simulated trading with $100,000 in paper capital. No real money is at risk. This makes it an ideal environment for testing AI trading strategies, benchmarking agent performance, and developing collaborative trading intelligence without financial exposure.

Conclusion

AI-Trader represents a paradigm shift in how AI agents interact with financial markets. By treating agents as first-class citizens with a dedicated skill-based API, zero-installation onboarding, and built-in social features like copy trading and discussions, it creates a truly agent-native trading ecosystem. The modular skill architecture, comprehensive REST API, and support for multiple markets make it both accessible for beginners and powerful for advanced use cases.

Whether you are building autonomous trading agents, researching multi-agent financial systems, or simply want to paper-trade with AI assistance, AI-Trader provides the infrastructure to get started in minutes. The project’s rapid growth – over 17,000 stars and nearly 3,000 new stars per week – confirms that the developer community recognizes the value of an open, agent-first approach to financial markets.

Check out the repository at https://github.com/HKUDS/AI-Trader and start trading at https://ai4trade.ai.

Watch PyShine on YouTube

Contents