Skip to content

codewithEshaYoutube/QuantTrader_Lite

Repository files navigation

πŸ“ˆ QuantTrader Lite

AI-Powered Crypto Trading Signal Agent β€” Lablab.ai AI Trading Agents Hackathon 2026

Live Demo Hackathon Track Python Streamlit


Landing Page

Dashboard Preview

Feature Highlights


🧠 What is QuantTrader Lite?

QuantTrader Lite is a fully working, end-to-end AI crypto trading signal agent. It fetches live prices from multiple sources, asks Gemini 2.0 Flash for a BUY / SELL / HOLD signal with a reason, and executes paper trades via Kraken CLI β€” all visible live on a clean Streamlit dashboard.

Live Price  β†’  Gemini AI  β†’  Signal + Reason  β†’  Kraken CLI (sandbox)  β†’  Dashboard

πŸ”— Try it live: https://quant-trader-lite.streamlit.app/

πŸ—οΈ Architecture

Architecture Diagram.


✨ Features

Feature Description
πŸ“‘ Multi-source price data CoinGecko β†’ Binance β†’ CryptoCompare fallback chain β€” never fails silently
πŸ€– Trend-aware AI signals Gemini 2.0 Flash analyzes live price + session trend for smarter signals
πŸŸ’πŸ”΄πŸŸ‘ BUY / SELL / HOLD Color-coded signals with full AI reasoning visible on every trade
πŸ“Š 4 coins supported Bitcoin, Ethereum, Solana, BNB β€” each with chart tab and Kraken pair
πŸ“‹ Full trade log Every signal logged to JSON with timestamp, price, signal, and order result
πŸ”„ Auto-refresh Toggle 60-second auto-refresh for hands-free live agent operation
βš™οΈ Kraken CLI sandbox Paper trades via Kraken CLI β€” no real money, full execution flow

πŸš€ Quickstart

1. Clone the repo

git clone https://github.com/your-team/quanttrader-lite
cd quanttrader-lite

2. Install dependencies

pip install -r requirements.txt

3. Set your API keys

export GEMINI_API_KEY=your_gemini_key_here
export KRAKEN_API_KEY=your_kraken_key        # optional for sandbox
export KRAKEN_API_SECRET=your_kraken_secret  # optional for sandbox

4. Run the dashboard

streamlit run streamlit_app.py

Open http://localhost:8501 and click ⚑ Run Agent Now.


πŸ—‚οΈ File Structure

quanttrader-lite/
β”œβ”€β”€ streamlit_app.py     # Main app β€” price fetch + Gemini AI + Kraken + dashboard
β”œβ”€β”€ requirements.txt     # All Python dependencies
β”œβ”€β”€ trade_log.json       # Auto-generated trade history (gitignored)
β”œβ”€β”€ index.html           # Landing page for the project
└── README.md            # This file

πŸ› οΈ Tech Stack

Layer Tool Why
AI Signal Engine Gemini 2.0 Flash Fast, reliable, free API tier available
Fallback AI Groq (llama3) Ultra-fast inference backup
Market Data (primary) CoinGecko API Free, no key needed, reliable
Market Data (fallback 1) Binance Public API No key needed, high uptime
Market Data (fallback 2) CryptoCompare Free tier, good historical data
Trading Execution Kraken CLI Pre-built binary, full sandbox support
Dashboard UI Streamlit Python-only, no frontend skills needed
Language Python 3.11+ Simple, fast, well-supported

πŸ”„ Workflows

Agent Flow

Agent Pipeline (every run)

User clicks ⚑ Run Agent Now
        β”‚
        β–Ό
[1] Fetch Price
    Try CoinGecko β†’ if fail β†’ Try Binance β†’ if fail β†’ Try CryptoCompare
        β”‚
        β–Ό
[2] Compute Trend
    Load trade_log.json β†’ analyze last 10 prices for this coin
    β†’ Direction: UPTREND / DOWNTREND / SIDEWAYS
    β†’ Session High / Low / Avg / % Move
        β”‚
        β–Ό
[3] Ask Gemini AI
    Send: coin, price, 24h change, trend context
    Receive: SIGNAL: BUY/SELL/HOLD | RISK: LOW/MEDIUM/HIGH | REASON: ...
        β”‚
        β–Ό
[4] Execute Trade (Kraken CLI Sandbox)
    BUY  β†’ kraken order buy  <pair> <amount> --sandbox
    SELL β†’ kraken order sell <pair> <amount> --sandbox
    HOLD β†’ no order placed
        β”‚
        β–Ό
[5] Log Trade
    Append to trade_log.json:
    { timestamp, coin, price, change_24h, signal, trade, source }
        β”‚
        β–Ό
[6] Update Dashboard
    Metrics Β· Trend panel Β· AI reasoning box Β· Charts Β· Trade table

Auto-Refresh Workflow

Toggle ON "πŸ”„ Auto-refresh every 60s"
        β”‚
        β–Ό
    Dashboard sleeps 60 seconds
        β”‚
        β–Ό
    st.rerun() triggers full page reload
        β”‚
        β–Ό
    Agent pipeline runs again automatically
        β”‚
        └──── loops indefinitely until toggle OFF

Price Fallback Workflow

Request price for coin
        β”‚
        β–Ό
    CoinGecko API ──── success ──▢ return (price, change, "CoinGecko")
        β”‚
      fail
        β”‚
        β–Ό
    Binance API ────── success ──▢ return (price, change, "Binance")
        β”‚
      fail
        β”‚
        β–Ό
    CryptoCompare ──── success ──▢ return (price, change, "CryptoCompare")
        β”‚
      fail
        β”‚
        β–Ό
    RuntimeError: "All price sources failed" β†’ show error in dashboard

πŸ“Š Signal Logic

Gemini AI follows these rules when generating signals:

Condition Signal
Trend = UPTREND and 24h change > +1% 🟒 BUY
Trend = DOWNTREND and 24h change < -1% πŸ”΄ SELL
Sideways, uncertain, or mixed signals 🟑 HOLD
Any condition Max 2% portfolio risk enforced

πŸͺ™ Supported Coins

Coin CoinGecko ID Binance Pair Kraken Pair
Bitcoin bitcoin BTCUSDT XBTUSD
Ethereum ethereum ETHUSDT ETHUSD
Solana solana SOLUSDT SOLUSD
BNB binancecoin BNBUSDT BNBUSD

πŸ”‘ API Keys Needed

Service Required Where to get
Gemini API βœ… Yes aistudio.google.com
Groq API Optional (fallback AI) console.groq.com
CryptoCompare Optional (price fallback) cryptocompare.com/cryptopian/api-keys
CoinMarketCap Optional (extra data) coinmarketcap.com/api
Messari Optional (market intel) messari.io/api
CoinGecko ❌ Free, no key Built-in
Binance ❌ Free, no key Built-in
Kraken CLI For real trades kraken.com/u/security/api

βœ… Submission Checklist

  • Working Streamlit app (AI + Kraken CLI + price feeds)
  • Multi-source price fallback (CoinGecko β†’ Binance β†’ CryptoCompare)
  • Gemini AI signal with trend context and reasoning
  • Kraken CLI sandbox trade execution
  • Trade log (JSON) with full history
  • Live dashboard with charts, metrics, signal distribution
  • GitHub repository (public)
  • Live deployment: quant-trader-lite.streamlit.app
  • Demo video (2–3 min screen recording)
  • Social media post (X / LinkedIn)
  • Register on early.surge.xyz
  • Submit on Lablab.ai before April 12

πŸ‘₯ Team

Member Role
Member 1 Python Dev β€” AI agent, Kraken CLI, price APIs
Member 2 Dashboard β€” Streamlit UI, charts, signal display
Member 3 Presenter β€” Demo video, README, pitch

πŸ“„ License

MIT License β€” free to use, modify, and distribute.


QuantTrader Lite Β· Lablab.ai AI Trading Agents Hackathon 2026 Β· Kraken CLI Challenge

πŸš€ Live Demo Β· πŸ† Hackathon Page Β· πŸ“‹ Prize Registration

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors