Skip to content

A production-ready cryptocurrency trading system that combines automated ETH/USDC trading on CoW Protocol with conversational AI

Notifications You must be signed in to change notification settings

Saga-Labs/ai-trading-bot

Repository files navigation

🤖 AI Trading Bot for CoW Protocol

Base      CoW Protocol      Ethereum

Automated WETH/USDC trading on Base network with AI decision making

Chat with your trading bot via Telegram while it makes smart buy/sell decisions every 5 minutes

📸 Bot in Action

Bot Running Screenshot

Live trading bot monitoring ETH markets and making AI-powered decisions

🚀 Quick Start

Install

git clone https://github.com/your-repo/ai-trading-bot.git
cd ai-trading-bot
npm install

Setup Environment

Create .env file:

PRIVATE_KEY=your_wallet_private_key
BASE_RPC_URL=https://mainnet.base.org
OPENROUTER_API_KEY=sk-or-v1-your_key

# Optional Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

Run

npm start

✨ Key Features

  • 🧠 AI-powered decisions with multiple model fallbacks
  • 💾 Smart memory - tracks all your trading history
  • 🛡️ Loss protection - designed to prevent selling at a loss
  • 📱 Telegram chat - talk to your AI trading assistant
  • 🔄 Active order management - cancels stale orders automatically

📋 Requirements

  • $1000+ portfolio in WETH and USDC to start trading
  • Base network wallet with funds
  • OpenRouter API key (free models available)
  • Telegram bot (optional but recommended)

🔄 How It Works

  1. Fetches Price: Gets current ETH price from multiple sources
  2. Analyzes History: Reviews your past trades to calculate cost basis
  3. AI Decision: Determines if market conditions are good to trade
  4. Safety Check: Blocks trades that would result in losses
  5. Execute: Places buy/sell orders on CoW Protocol

📱 Telegram Integration

Telegram Notifications

Real-time trading notifications delivered to your Telegram

Commands & AI Chat

  • /status - Portfolio and bot status
  • /orders - Recent filled trades
  • /active - Current open orders
  • Chat with AI - Ask questions about trades and market conditions
AI Telegram Replies

AI-powered responses and analysis directly in your Telegram chat

📊 Example Output

💱 ETH: $4,650.23 (CoinGecko)
📊 Portfolio: 0.2150 ETH + $1,247 USDC
🤖 AI Decision: SELL (confidence: 85%)
🔴 SELL Order Placed: 0.1 ETH → $490 at $4900

🛡️ Safety Features

  • Profit margins: Always keeps minimum $50 profit buffer
  • Portfolio balance: Never goes more than 80% in one asset
  • AI fallbacks: Multiple models prevent single points of failure
  • Balance verification: Checks funds before placing orders
  • Order cleanup: Automatically cancels stale orders

⚠️ Important Disclaimers

  • Experimental software - Start with small amounts
  • No guarantees - Markets are unpredictable
  • Your responsibility - Review all trades and settings
  • Gas fees - Factor in transaction costs
  • Market risks - Crypto trading involves significant risk

Ready to start? Make sure you have funds in your wallet and run npm start.

About

A production-ready cryptocurrency trading system that combines automated ETH/USDC trading on CoW Protocol with conversational AI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published