Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

GEEK9 Logo

GEEK9 β€” Grok's Trader Dog

The world's first AI-powered live-streaming memecoin trading robot dog on Solana


What Is This?

Grok Bot is an autonomous trading agent that discovers and trades memecoins on Solana in real-time β€” narrated by Grok AI with TTS, animated by a real robot dog, and streamed live on OBS. It combines AI decision-making, blockchain execution, community engagement, and physical robotics into a single entertainment + trading system.


Architecture Overview

graph TB
    subgraph Discovery["πŸ” Token Discovery"]
        ST[SolanaTracker]
        BE[Birdeye]
        HL[Helius]
        PA[PumpAPI Stream]
        WW[Wallet Watcher]
    end

    subgraph Brain["🧠 Grok-4 AI Brain"]
        CF[Candidate Filter]
        RG[Risk Gate]
        AI[AI Decision Engine]
        PS[Position Sizer]
    end

    subgraph Execution["⚑ Solana Execution"]
        PP[PumpPortal]
        JU[Jupiter]
        RPC[Solana RPC]
    end

    subgraph Show["🎬 Live Stream"]
        OBS[OBS Scenes]
        TTS[Kokoro TTS]
        OV[Browser Overlays]
    end

    subgraph Robot["πŸ• Robot Dog"]
        PD[GEEK9]
        CH[Choreography]
    end

    subgraph Community["πŸ’¬ Community"]
        PC[PumpFun Chat]
        TG[Telegram]
        DB[Dashboard]
    end

    subgraph Data["πŸ’Ύ Data Layer"]
        PG[(PostgreSQL)]
        MEM[In-Memory Portfolio]
    end

    ST & BE & HL & PA & WW --> CF
    CF --> RG --> AI
    AI --> PS --> PP
    PP -. fallback .-> JU
    PP & JU --> RPC

    AI --> OBS & TTS & OV
    AI --> PD --> CH
    AI --> PC & TG
    RPC --> PG & MEM
    PG --> DB
Loading

How It Works

1. Token Discovery

The system continuously scans multiple data providers for tradeable tokens:

  • SolanaTracker β€” trending tokens, fresh gems, search queries
  • Birdeye β€” token metadata, real-time price WebSocket feeds
  • Helius β€” mint watching, transaction parsing
  • PumpAPI Stream β€” real-time new token events
  • Wallet Watcher β€” smart money tracking
graph LR
    A[Raw Candidates] --> B[Candidate Filter]
    B --> C[Risk Gate]
    C --> D[Filter Presets]
    D --> E[Qualified Candidates]
    E --> F[Grok AI]

    B -.- B1["Market cap, volume, age, momentum"]
    C -.- C1["Holder concentration, rug signals, liquidity"]
    D -.- D1["Conservative β†’ Aggressive profiles"]
Loading

2. AI Decision Engine

Every 45 seconds, the trading loop builds a rich context for Grok-4:

  • Current portfolio (open positions, P&L, trailing stops)
  • SOL balance and risk metrics
  • Filtered token candidates with metadata
  • Recent trade history and performance

Grok-4 returns a structured decision:

Decision Action
BUY Enter new position with sized allocation
SELL Exit position (take profit or cut loss)
HOLD Maintain current positions
ROTATE Sell underperformer β†’ buy better opportunity

3. Trade Execution

graph TD
    A[Grok Decision] --> B[Position Sizer]
    B --> C{PumpPortal}
    C -->|success| E[Solana RPC]
    C -->|fallback| D[Jupiter Aggregator]
    D --> E
    E --> F[Transaction Confirmed]
    F --> G[Portfolio Update]
    F --> H[Telegram Notification]
    F --> I[PostgreSQL Record]

    B -.- B1["SOL amount based on conviction + risk"]
    C -.- C1["Direct DEX swap"]
    D -.- D1["Best-route swap"]
    G -.- G1["Entry price, amount, trailing stop"]
Loading

4. Real-Time Price Monitoring

A separate reactive price loop runs continuously:

  • Subscribes to Birdeye WebSocket for live price ticks
  • Monitors trailing stops β€” auto-sells when price drops from peak
  • Triggers reactive sells before the next trading loop cycle
  • Configurable presets: TIGHT, MEDIUM, WIDE, MOONBAG

5. Risk Management & Guardrails

Guardrail Purpose
Max position size Caps SOL per trade
Max open positions Limits portfolio exposure
Stop-loss percentage Hard floor on losses
Trailing stop presets Locks in gains dynamically
SOL reserve Always keeps gas money
Slippage limits Prevents sandwich attacks
Dry-run mode Test without real trades
Token blacklist Never trade flagged tokens

6. The Show (Live Stream)

Every trade triggers a coordinated production:

graph LR
    A[Trade Executed] --> B[ShowQueue]
    B --> C[Grok Commentary]
    B --> D[Kokoro TTS]
    B --> E[OBS Scene Switch]
    B --> F[GEEK9 Choreography]
    B --> G[Overlay Update]

    A --> H[Telegram Notify]
    A --> I[PostgreSQL Write]

    C --> D
    D --> E
    E --> F
    F --> G
Loading

7. Chat Engagement

Every 15 seconds, the chat loop:

  1. Fetches messages from PumpFun token chat
  2. Sends to Grok-4 for personality-driven responses
  3. Updates emotion/sentiment score
  4. Triggers TTS narration + robot animations

Monorepo Structure

grok-bot/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ brain/          # Trading engine (Node.js/TypeScript)
β”‚   β”‚   β”œβ”€β”€ loops/      # Trading, chat, price monitoring, cleanup
β”‚   β”‚   β”œβ”€β”€ services/   # External API integrations
β”‚   β”‚   β”œβ”€β”€ discovery/  # Token filtering & risk analysis
β”‚   β”‚   └── state/      # Portfolio, queue, stats management
β”‚   β”‚
β”‚   β”œβ”€β”€ web/            # Dashboard & API (Next.js/React)
β”‚   β”‚   β”œβ”€β”€ app/        # Pages: hero, dashboard, leaderboard
β”‚   β”‚   β”œβ”€β”€ api/        # REST endpoints (state, events, blacklist)
β”‚   β”‚   └── prisma/     # Database schema & migrations
β”‚   β”‚
β”‚   β”œβ”€β”€ pidog/          # Robot control service (Python/FastAPI)
β”‚   β”‚   └── actions/    # Choreography routines
β”‚   β”‚
β”‚   └── kokoro-tts/     # Text-to-speech service (Python/FastAPI)
β”‚
β”œβ”€β”€ packages/
β”‚   └── shared/         # Shared TypeScript types
β”‚
└── scripts/            # Deployment scripts

Data Flow

graph TD
    SOL[πŸ”— Solana Blockchain]

    SOL --> BE[Birdeye<br/>Prices]
    SOL --> HL[Helius<br/>Mints]
    SOL --> ST[SolanaTracker<br/>Discovery]

    BE & HL & ST --> BRAIN[🧠 Brain<br/>Filter β†’ AI β†’ Execute]

    BRAIN --> PG[(PostgreSQL)]
    BRAIN --> DASH[πŸ“Š Dashboard<br/>Next.js]
    BRAIN --> STREAM[πŸŽ₯ Stream<br/>OBS + TTS]
    BRAIN --> DOG[πŸ• GEEK9<br/>Robot]
    BRAIN --> CHAT[πŸ’¬ Community<br/>Chat + Telegram]

    PG --> DASH
Loading

Database Schema

Table Purpose
Trade Every buy/sell with mint, amounts, P&L, tx signature
Burn Token burn events tracked on-chain
BalanceSnapshot Periodic portfolio value + SOL price snapshots
ChatEvent AI chat interactions with sentiment tracking

Tech Stack

Layer Technology
AI Brain Grok-4 (via OpenRouter / xAI)
Backend Node.js, TypeScript, Zod
Frontend Next.js 16, React 19, Tailwind CSS, Spline 3D
Database PostgreSQL + Prisma ORM
Blockchain Solana Web3.js, SPL Token, PumpPortal, Jupiter
Data Feeds Birdeye (REST + WS), SolanaTracker, Helius
Streaming OBS WebSocket, Kokoro TTS, Browser Overlays
Robotics GEEK9 (Python FastAPI)
Community PumpFun Chat, Telegram Bot API
Infra Railway (deploy), npm workspaces (monorepo)

Key Loops

Loop Interval Purpose
Trading Loop 45s Discover β†’ Filter β†’ AI Decide β†’ Execute
Chat Loop 15s Read chat β†’ AI respond β†’ TTS β†’ Animate
Reactive Price Loop Real-time WebSocket price monitoring + trailing stops
Burn Monitor Periodic Detect and record token burns
Summary Loop Daily Aggregate performance statistics
Wallet Cleanup Periodic Sweep dust positions and stale tokens

Deployment

Service Platform
Brain Cloud / Local
Web Dashboard Cloud
GEEK9 Raspberry Pi / Local
Kokoro TTS Local GPU
PostgreSQL Cloud

Built with Grok AI on Solana β€” autonomous, live, unfiltered.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors