Introducing the LLM Trading Bot: AI-Powered Crypto Trading

A deep dive into our experimental LLM-powered cryptocurrency trading bot that makes autonomous trading decisions using OpenAI's GPT-4.1 on Base network.

Ashish Sontakke

Introducing the LLM Trading Bot: AI-Powered Crypto Trading

Large Language Models (LLMs) have demonstrated remarkable capabilities across diverse domains, from content creation to complex reasoning tasks. But can they effectively trade cryptocurrencies? We’ve launched an experimental trading bot powered by OpenAI’s GPT-4.1 to find out.

The Experiment

Our LLM Trading Bot is conducting real-time, fully autonomous trading with actual assets on the Base network. Starting with $100 in capital, the bot makes hourly trading decisions between a carefully selected basket of cryptocurrencies: USDC (stablecoin), Wrapped Bitcoin (WBTC), Wrapped Ethereum (WETH), and Aave Token (AAVE).

This experiment explores the potential of LLMs as financial agents, their ability to analyze market trends, and make calculated trading decisions without human intervention.

How It Works

The system operates through a four-stage process that runs automatically every hour:

1. Data Collection

For each trading cycle, we gather comprehensive data including:

  • Current wallet composition - Token balances and weights in the portfolio
  • Real-time market data - Current prices, market capitalization, and 24-hour changes
  • Trading volumes - Activity levels across the tokens
  • Historical price data - Recent price movements and trends
  • Past transaction records - The bot’s previous decisions and their outcomes

2. AI Analysis

OpenAI’s GPT-4.1 processes this information, evaluating:

  • Price trends and momentum
  • Market capitalization changes
  • Trading volume patterns
  • Portfolio balance and risk exposure
  • Previous trading performance

The model has been instructed to focus exclusively on maximizing the portfolio’s USD value over time, balancing risk and reward appropriately.

3. Decision Output

For each trading cycle, the bot produces structured output including:

  • Whether to execute a trade or hold current positions
  • The source token to sell (if trading)
  • The destination token to buy (if trading)
  • The precise amount to trade with correct decimal precision
  • Detailed reasoning behind the decision

4. Execution

When the bot decides to trade, the transaction is executed on-chain through smart contracts, with market-rate pricing from decentralized exchanges. All trades account for transaction costs and potential slippage.

Technical Implementation

The trading bot is built with modern web technologies:

  • TypeScript and Next.js for the application framework
  • OpenAI API with the GPT-4.1 model for decision-making
  • Ethers.js for blockchain interaction
  • CoinGecko API for real-time market data
  • PostgreSQL database for transaction records and performance metrics

To ensure the AI makes informed decisions, we carefully filter the data sent to the model, providing only relevant information without unnecessary details like token icons, descriptions, or metadata.

The model receives strictly structured data:

// Token market data includes only essential pricing and metric information
interface TokenMarketData {
  [key: string]: {
    id: string;
    current_price: number;
    market_cap: number;
    total_volume: number;
    price_change_percentage_24h: number;
  };
}

// Market chart data provides historical price points for trend analysis
interface TokenMarketChartData {
  [key: string]: {
    prices: [number, number][];
    market_caps: [number, number][];
    total_volumes: [number, number][];
  };
}

Performance Tracking

We measure our LLM trading bot’s performance against three benchmarks:

  1. Bitcoin (BTC) - The traditional “hodl” strategy for cryptocurrency investing
  2. Ethereum (ETH) - An alternative cryptocurrency with different market dynamics
  3. US Dollar (USD) - A stable baseline to measure absolute performance

All metrics are tracked in real-time and updated with each trading decision. This allows us to evaluate whether the AI can outperform traditional investment strategies.

Trading Pairs

The LLM trading agent can swap between these tokens on the Base network:

  • USD Coin (USDC) - Fully-backed stablecoin pegged to USD (6 decimals)
  • Wrapped Bitcoin (WBTC) - ERC-20 token backed 1:1 with Bitcoin (8 decimals)
  • Wrapped Ether (WETH) - ERC-20 token backed 1:1 with Ethereum (18 decimals)
  • Aave Token (AAVE) - Governance token for the Aave lending protocol (18 decimals)

These tokens were selected to provide a balanced mix of stablecoins, major cryptocurrencies, and DeFi assets.

Initial Results and Future Plans

This blog serves as an introduction to our experiment. In future posts, we’ll share:

  • Detailed performance metrics and comparisons to benchmarks
  • Analysis of trading patterns and decision-making rationale
  • Improvements to the bot’s strategy and capabilities
  • Insights gained about LLMs as financial agents

Important Disclaimer

This is an experimental research project demonstrating AI capabilities, not financial advice. The trading strategy has not been optimized for maximum returns, and real assets are at risk. We’re primarily interested in exploring the potential and limitations of LLMs in financial decision-making.

Stay Tuned

Follow our journey as we explore the intersection of artificial intelligence and cryptocurrency trading. We’ll be regularly publishing performance updates, technical insights, and lessons learned from this ongoing experiment.

Got questions or suggestions? Reach out to us through our GitHub repository or Twitter handle.


The LLM Trading Bot is a research project exploring the capabilities of large language models in financial decision-making. All trades are executed autonomously by AI without human intervention.