πŸš€ AI Perps Trading Platform

Research Report & Architecture Design for Hyperliquid-focused Trading Agent

Prepared by Chotu πŸ€– | January 27, 2026 | For the moar.market team

Part 1: Pigeon.trade Deep Dive

1.1 What is Pigeon?

Pigeon is a multi-agent AI trading platform that positions itself as "the first AI wallet that can talk, code, research, and trade." It's essentially a conversational interface to multiple financial marketsβ€”crypto, stocks, forex, perpetuals, and prediction markets.

Key Tagline: "Your AI quant for infinite markets" β€” They describe themselves as the "Cursor" or "Replit" moment for trading.

1.2 Pigeon's Architecture

πŸ—οΈ Multi-Agent System

Pigeon uses a multi-agent architecture where different specialized agents handle different tasks:

  • Master Agent: Coordinates user requests and routes to specialized agents
  • Market Data Agent: Fetches prices via CoinGecko, LunarCrush, Ostium APIs
  • Trading Execution Agent: Handles swaps, orders, position management
  • Research Agent: Social sentiment, news analysis
  • Code Generation Agent: Creates "Pigeon Code" scripts for automation
πŸ”— Platform Integrations
Category Integration Purpose
DEX (EVM) KyberSwap Aggregated swaps on Ethereum, Base, Arbitrum, etc.
DEX (Solana) Jupiter Solana swaps + limit orders
DEX (TON) DeDust TON blockchain swaps
Perpetuals Hyperliquid Perps trading with advanced orders
Traditional Ostium Stocks, forex, commodities (synthetic)
Predictions Polymarket Event betting on Polygon
πŸ› οΈ Tech Stack (Inferred)
  • Backend: Python (based on their fast-agent fork and solana-agent-kit usage)
  • Agent Framework: Custom multi-agent with MCP (Model Context Protocol) support
  • LLM Provider: Likely Anthropic Claude (based on building-effective-agents reference)
  • Wallet: Privy (Stripe) MPC wallets β€” self-custodial, exportable
  • Messaging: Multi-platform (Telegram, WhatsApp, Discord, Farcaster, XMTP, SMS)
  • Code Runtime: Sandboxed execution environment for "Pigeon Code" scripts

1.3 Pigeon Code β€” The Killer Feature

This is their most innovative feature. Users describe automation in natural language, and Pigeon generates deterministic code that runs on schedule:

// User says: "Every 15 min, alert me if SOL falls below $150"
// Pigeon generates monitoring code that:
// 1. Polls SOL price every 15 minutes
// 2. Compares against threshold
// 3. Sends notification if condition met
Generation Time: 5-30 minutes intentionally. They perform:
  • Intent decomposition & alignment
  • Iterative synthesis with stress-testing
  • Defensive hardening (safety guards)
  • Reliability scoring

1.4 What People Say (Community Feedback)

πŸ‘ Positives
  • Single interface for multiple markets
  • Natural language trading is intuitive
  • Pigeon Code automation is powerful
  • Multi-platform support (Telegram, Discord, etc.)
  • Self-custodial wallets (can export keys)
  • Good documentation
πŸ‘Ž Negatives
  • 1% fee on DEX swaps is high
  • Pigeon Code can misinterpret intent
  • Each platform = separate wallet (no account merging)
  • Generation time for code can be slow
  • Beta features can be unreliable
  • "Silly Pigeon" moments when tools fail

1.5 Revenue Model

Part 2: Architecture Design for Your Platform

Your Focus: Perps on Hyperliquid first, then expand to Polymarket and beyond

2.1 High-Level Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        USER INTERFACES                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚ Telegram β”‚  β”‚ Discord  β”‚  β”‚   Web    β”‚  β”‚   API    β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚             β”‚             β”‚             β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    GATEWAY / MESSAGE ROUTER                     β”‚
β”‚  β€’ Session management  β€’ Rate limiting  β€’ Auth                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     ORCHESTRATOR AGENT                          β”‚
β”‚  β€’ Intent classification  β€’ Agent routing  β€’ Context mgmt      β”‚
β”‚  β€’ Uses: Gemini 2.5 Flash (fast) or Pro (complex)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                    β–Ό                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ RESEARCH AGENTβ”‚  β”‚ TRADING AGENT β”‚  β”‚ STRATEGY AGENTβ”‚
β”‚ β€’ Market data β”‚  β”‚ β€’ Order exec  β”‚  β”‚ β€’ Backtest    β”‚
β”‚ β€’ Sentiment   β”‚  β”‚ β€’ Position    β”‚  β”‚ β€’ Code gen    β”‚
β”‚ β€’ News        β”‚  β”‚ β€’ Risk mgmt   β”‚  β”‚ β€’ Monitoring  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                  β”‚                  β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      TOOL LAYER (MCP)                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚ Hyperliquid β”‚  β”‚  CoinGecko  β”‚  β”‚   MongoDB   β”‚             β”‚
β”‚  β”‚    SDK      β”‚  β”‚    API      β”‚  β”‚   Store     β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2.2 Core Components

1️⃣ Message Gateway

Purpose: Handle multi-platform messaging, session management, authentication

Recommended: Python + FastAPI or use existing frameworks

2️⃣ Orchestrator Agent

Purpose: Classify user intent, route to specialized agents, maintain context

Recommended: Use Gemini 2.5 Flash for routing (fast + cheap), Pro for complex reasoning

# Intent Classification
intents = [
    "price_check",      # "What's BTC price?"
    "open_position",    # "Long ETH 10x"
    "close_position",   # "Close my BTC position"
    "set_alert",        # "Alert me if SOL > 200"
    "portfolio_check",  # "Show my positions"
    "strategy_create",  # "Create a grid trading strategy"
    "backtest",         # "Backtest this strategy"
]
3️⃣ Trading Agent (Hyperliquid)

Purpose: Execute trades, manage positions, handle risk

SDK: hyperliquid-python-sdk

from hyperliquid.info import Info
from hyperliquid.exchange import Exchange

# Core operations to implement:
class HyperliquidAgent:
    async def get_price(self, symbol: str) -> float
    async def open_position(self, symbol: str, side: str, size: float, leverage: int)
    async def close_position(self, symbol: str, percentage: float = 100)
    async def set_stop_loss(self, symbol: str, price: float)
    async def set_take_profit(self, symbol: str, price: float)
    async def get_positions(self) -> List[Position]
    async def get_pnl(self) -> PnLSummary
4️⃣ Strategy Agent

Purpose: Help users build, backtest, and deploy trading strategies

This is where you can differentiate from Pigeon:

  • Strategy Templates: Pre-built strategies users can customize
  • Backtesting: Test strategies against historical data
  • Live Monitoring: Track strategy performance in real-time
  • Risk Management: Automatic position sizing, max drawdown limits

2.3 Database Design (MongoDB)

// Collections

// users - User accounts and settings
{
  _id: ObjectId,
  platform: "telegram",
  platform_id: "123456789",
  wallet_address: "0x...",  // Hyperliquid wallet
  settings: {
    default_leverage: 5,
    max_position_size: 1000,
    risk_per_trade: 0.02
  },
  created_at: ISODate
}

// strategies - User-created strategies
{
  _id: ObjectId,
  user_id: ObjectId,
  name: "ETH Grid Bot",
  type: "grid",
  parameters: {
    symbol: "ETH",
    lower_bound: 3000,
    upper_bound: 4000,
    grid_count: 10,
    size_per_grid: 0.1
  },
  status: "active",
  performance: {
    total_pnl: 150.5,
    win_rate: 0.65,
    trades_count: 42
  }
}

// trades - Trade history
{
  _id: ObjectId,
  user_id: ObjectId,
  strategy_id: ObjectId,  // null for manual trades
  symbol: "BTC",
  side: "long",
  entry_price: 45000,
  exit_price: 46500,
  size: 0.1,
  pnl: 150,
  timestamp: ISODate
}

// alerts - Price/condition alerts
{
  _id: ObjectId,
  user_id: ObjectId,
  symbol: "SOL",
  condition: "price_above",
  threshold: 200,
  triggered: false,
  created_at: ISODate
}

2.4 Key Differentiators from Pigeon

🎯 Focus

Pigeon tries to be everything. You focus on Hyperliquid perps excellence. Deep integration, better UX for perps traders.

πŸ“Š Strategies First

Pigeon Code is generic. You offer pre-built perps strategies with backtesting. Grid bots, DCA, momentum, mean reversion.

πŸ”¬ Research Tools

Funding rate analysis, open interest tracking, liquidation heatmaps β€” perps-specific research Pigeon doesn't have.

πŸ’° Lower Fees

Pigeon charges 4bps. Consider 2bps or free during beta to acquire users.

Part 3: Learning Path for AI Development

Since your team is new to AI development, here's a structured learning path:

3.1 Week 1: Foundations

πŸ“š Essential Reading
  1. Building Effective Agents by Anthropic β€” Must read! Pigeon cites this directly
  2. OpenAI Function Calling Guide β€” Core concept for tool-use
  3. Gemini API Documentation β€” Your primary LLM
🎯 Hands-On Exercise

Build a simple chatbot that can:

  1. Take natural language input
  2. Call Gemini API
  3. Use function calling to get BTC price from CoinGecko
  4. Return formatted response
# Goal: "What's BTC price?" β†’ Calls CoinGecko β†’ "BTC is $45,000"

3.2 Week 2: Agent Frameworks

πŸ› οΈ Frameworks to Explore
Framework Best For Learning Curve
fast-agent MCP-enabled agents, what Pigeon uses Medium
LangChain General purpose, huge ecosystem Medium
LlamaIndex RAG, data retrieval Easy
OpenAI Agents SDK Simple multi-agent Easy
Custom (recommended for MVP) Full control, simpler Easy
Recommendation: Start with no framework for MVP. Just Gemini API + function calling. Add frameworks later when you need their features.

3.3 Week 3-4: Domain Knowledge

πŸ“ˆ Hyperliquid Deep Dive
  • Hyperliquid Docs
  • Python SDK β€” Read the examples folder
  • Trade manually on Hyperliquid to understand the UX
  • Understand: funding rates, mark price vs. index price, liquidation mechanics
🧠 Trading Strategy Basics
  • Grid Trading β€” Buy low, sell high in a range
  • DCA (Dollar Cost Averaging) β€” Regular buys regardless of price
  • Momentum β€” Follow trends
  • Mean Reversion β€” Bet on return to average
  • Funding Rate Arbitrage β€” Exploit funding rate differentials

Part 4: Implementation Roadmap

Week 1: Foundation
  • Set up Python project with Poetry/uv
  • Integrate Gemini API with function calling
  • Build Hyperliquid SDK wrapper
  • Create Telegram bot skeleton
  • Set up MongoDB on GCP

Deliverable: Bot that responds to "hi" and can fetch BTC price

Week 2: Core Trading
  • Implement position opening/closing
  • Add leverage and order type support
  • Build portfolio view
  • Add basic risk management (max position size)
  • Implement stop-loss/take-profit

Deliverable: "Long BTC 5x" actually works

Week 3: Strategies (Post-MVP)
  • Strategy template system
  • Basic backtesting with historical data
  • Strategy deployment and monitoring
  • Alert system
Week 4+: Polish & Expand
  • Add more strategy types
  • Improve error handling and UX
  • Add Polymarket integration
  • Performance optimizations
  • User feedback loop

MVP Scope (Week 1-2)

βœ… Must Have
  • Telegram bot interface
  • Natural language β†’ Gemini β†’ Function calling β†’ Hyperliquid
  • Check price: "What's ETH price?"
  • Open position: "Long ETH 0.1 size 5x leverage"
  • Close position: "Close my ETH position"
  • View portfolio: "Show my positions"
  • Set SL/TP: "Set stop loss at $3000"
⏳ Nice to Have (Post-MVP)
  • Strategy templates
  • Backtesting
  • Alerts system
  • P&L tracking over time
  • Multiple users/authentication

Part 5: Recommended Tech Stack

Component Recommendation Why
Language Python 3.11+ Best AI ecosystem, Hyperliquid SDK is Python, GCP/Gemini have great Python support
Package Manager uv or Poetry Modern, fast, better than pip
LLM Gemini 2.5 Flash (primary), Pro (complex) You have GCP credits, fast, good function calling
Database MongoDB Atlas You have credits, flexible schema for rapid iteration
Bot Framework python-telegram-bot Mature, async, well-documented
Trading hyperliquid-python-sdk Official SDK, well-maintained
Web Framework FastAPI If you need API endpoints later, async, fast
Task Queue Celery + Redis (later) For strategy execution, alerts β€” not needed for MVP
Hosting GCP Cloud Run or Compute Engine You have credits, easy deployment

5.1 Project Structure

moar-perps/
β”œβ”€β”€ pyproject.toml          # Dependencies (use uv or poetry)
β”œβ”€β”€ .env                    # Secrets (never commit!)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ main.py             # Entry point
β”‚   β”œβ”€β”€ config.py           # Configuration
β”‚   β”œβ”€β”€ bot/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ telegram.py     # Telegram bot handlers
β”‚   β”‚   └── handlers.py     # Command handlers
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ orchestrator.py # Main routing agent
β”‚   β”‚   β”œβ”€β”€ trading.py      # Hyperliquid trading agent
β”‚   β”‚   └── research.py     # Market data agent
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ hyperliquid.py  # Hyperliquid SDK wrapper
β”‚   β”‚   β”œβ”€β”€ coingecko.py    # Price data
β”‚   β”‚   └── gemini.py       # LLM client
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ user.py         # User model
β”‚   β”‚   β”œβ”€β”€ trade.py        # Trade model
β”‚   β”‚   └── strategy.py     # Strategy model
β”‚   └── db/
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── mongo.py        # MongoDB client
β”œβ”€β”€ tests/
β”‚   └── ...
└── README.md

5.2 Benchmarking & Improvement

πŸ“Š Metrics to Track
  • Response Time: Time from message to response (target: < 3s)
  • Intent Accuracy: % of correctly classified intents
  • Trade Execution Success: % of trades that execute without errors
  • User Retention: Daily/weekly active users
  • Strategy Performance: Win rate, Sharpe ratio, max drawdown
πŸ”„ Continuous Improvement Loop
  1. Log Everything: All user messages, agent responses, trade executions
  2. Review Failures: Weekly review of failed intents, errors
  3. A/B Test Prompts: Try different system prompts, measure accuracy
  4. User Feedback: Add thumbs up/down to responses
  5. Iterate: Improve prompts, add tools, expand capabilities

5.3 Quick Start Code

"""
Minimal example: Gemini + Hyperliquid Price Check
"""
import google.generativeai as genai
from hyperliquid.info import Info
import json

# Configure Gemini
genai.configure(api_key="YOUR_GEMINI_API_KEY")

# Define tools
tools = [
    {
        "name": "get_crypto_price",
        "description": "Get the current price of a cryptocurrency on Hyperliquid",
        "parameters": {
            "type": "object",
            "properties": {
                "symbol": {
                    "type": "string",
                    "description": "The trading symbol, e.g., BTC, ETH, SOL"
                }
            },
            "required": ["symbol"]
        }
    }
]

# Tool implementation
def get_crypto_price(symbol: str) -> dict:
    info = Info(skip_ws=True)
    meta = info.meta()
    # Find the asset
    for asset in meta["universe"]:
        if asset["name"] == symbol:
            # Get mid price
            l2 = info.l2_snapshot(asset["name"])
            bid = float(l2["levels"][0][0]["px"])
            ask = float(l2["levels"][1][0]["px"])
            mid = (bid + ask) / 2
            return {"symbol": symbol, "price": mid}
    return {"error": f"Symbol {symbol} not found"}

# Chat function
def chat(user_message: str):
    model = genai.GenerativeModel(
        "gemini-2.5-flash",
        tools=tools,
        system_instruction="You are a helpful trading assistant for Hyperliquid perps."
    )
    
    response = model.generate_content(user_message)
    
    # Handle function calls
    if response.candidates[0].content.parts[0].function_call:
        fc = response.candidates[0].content.parts[0].function_call
        if fc.name == "get_crypto_price":
            result = get_crypto_price(fc.args["symbol"])
            # Send result back to model
            response = model.generate_content([
                user_message,
                {"function_call": fc},
                {"function_response": {"name": fc.name, "response": result}}
            ])
    
    return response.text

# Test
print(chat("What's the price of ETH?"))

5.4 Resources & Links

Part 6: Detailed MVP Roadmaps πŸ—ΊοΈ

Scope: Telegram only. No Discord, Web, or API for MVP. Focus on core perps trading via natural language.

πŸ“… Option A: 2-Week Sprint (Aggressive)

For teams that can dedicate full-time effort and are comfortable with some technical debt.

⚑ Week 1: Foundation + Basic Trading

Day 1-2: Project Setup

  • Initialize Python project with uv or Poetry
  • Set up project structure (see 5.1 above)
  • Configure environment variables (.env)
  • Set up MongoDB Atlas cluster
  • Create basic Telegram bot with python-telegram-bot
  • Deliverable: Bot responds to /start with welcome message

Day 3-4: LLM Integration

  • Integrate Gemini 2.5 Flash API
  • Implement function calling schema
  • Build orchestrator that routes messages through Gemini
  • Add get_price tool (CoinGecko or Hyperliquid)
  • Deliverable: "What's BTC price?" returns actual price

Day 5-7: Hyperliquid Core

  • Integrate hyperliquid-python-sdk
  • Implement wallet connection (use testnet first!)
  • Build open_position tool
  • Build close_position tool
  • Build get_positions tool
  • Add basic error handling
  • Deliverable: Can execute trades via chat
⚑ Week 2: Complete MVP

Day 8-9: Order Management

  • Implement leverage selection
  • Add stop-loss / take-profit tools
  • Implement order types (market, limit)
  • Build portfolio summary view
  • Deliverable: Full position lifecycle works

Day 10-11: User Management + Safety

  • User registration in MongoDB
  • Wallet address storage per user
  • Basic risk limits (max position size, max leverage)
  • Confirmation prompts for large trades
  • Deliverable: Multi-user support with safety rails

Day 12-13: Polish + Testing

  • Improve error messages and UX
  • Add conversation context (remember previous messages)
  • Write basic tests for critical paths
  • Test on Hyperliquid testnet extensively
  • Deliverable: Smooth user experience

Day 14: Deploy

  • Deploy to GCP Cloud Run or Compute Engine
  • Set up logging and monitoring
  • Switch to mainnet (with caution!)
  • Invite beta testers
  • Deliverable: Live MVP! πŸš€
⚠️ 2-Week Trade-offs:
  • No backtesting or strategy templates
  • Minimal error recovery
  • Single-wallet-per-user only (no sub-accounts)
  • Limited conversation memory
  • Technical debt to pay later

πŸ“… Option B: 4-Week Roadmap (Recommended)

More sustainable pace with better architecture, testing, and room for iteration.

πŸ—οΈ Week 1: Solid Foundation

Day 1-2: Project Architecture

  • Design database schema carefully
  • Set up project with proper structure
  • Configure CI/CD (GitHub Actions β†’ GCP)
  • Set up development, staging, production environments
  • Initialize MongoDB with proper indexes

Day 3-4: Telegram Bot Foundation

  • Build Telegram bot with conversation handlers
  • Implement session management
  • Add user registration flow
  • Create help commands and onboarding

Day 5-7: LLM Layer

  • Integrate Gemini with proper error handling
  • Build tool registry system
  • Implement conversation memory (last N messages)
  • Add fallback responses for unknown intents
  • Deliverable: Conversational bot that understands context
πŸ’Ή Week 2: Trading Core

Day 8-10: Hyperliquid Integration

  • Build comprehensive SDK wrapper
  • Implement all trading operations:
    • get_price(symbol)
    • get_funding_rate(symbol)
    • open_long(symbol, size, leverage)
    • open_short(symbol, size, leverage)
    • close_position(symbol, percentage)
    • set_stop_loss(symbol, price)
    • set_take_profit(symbol, price)
  • Add retry logic for network failures

Day 11-12: Portfolio & Analytics

  • Build portfolio view (all positions)
  • Add P&L calculations
  • Implement position history tracking
  • Store trades in MongoDB

Day 13-14: Testing on Testnet

  • Comprehensive testnet testing
  • Edge case handling (insufficient margin, etc.)
  • Unit tests for critical functions
  • Deliverable: Reliable trading via chat
πŸ›‘οΈ Week 3: Safety & UX

Day 15-16: Risk Management

  • Implement per-user risk limits:
    • Max position size
    • Max leverage allowed
    • Max open positions
    • Daily loss limit
  • Add confirmation prompts for large trades
  • Implement "paper trading" mode for new users

Day 17-18: User Experience

  • Improve response formatting (emojis, tables)
  • Add inline keyboards for quick actions
  • Build settings menu (/settings)
  • Add price formatting (human-readable)

Day 19-21: Alerts System

  • Price alert functionality
  • Position alerts (liquidation warning)
  • Funding rate alerts
  • Background job scheduler (Celery or APScheduler)
  • Deliverable: Proactive notifications
πŸš€ Week 4: Launch Prep

Day 22-23: Research Tools (Differentiator)

  • Add funding rate analysis
  • Open interest data
  • Simple market sentiment (Fear & Greed index)
  • These make you more than just "trade executor"

Day 24-25: Production Hardening

  • Set up proper logging (structured, searchable)
  • Add monitoring and alerting (GCP Monitoring)
  • Rate limiting per user
  • Error reporting (Sentry or similar)

Day 26-27: Beta Testing

  • Deploy to production (mainnet)
  • Invite 5-10 beta testers
  • Collect feedback actively
  • Fix critical bugs immediately

Day 28: Launch

  • Final bug fixes
  • Documentation for users
  • Announce on social media
  • Deliverable: Production MVP with real users! πŸŽ‰

πŸ“Š Feature Comparison

Feature 2-Week MVP 4-Week MVP
Price checking βœ… βœ…
Open/close positions βœ… βœ…
Stop-loss/Take-profit βœ… βœ…
Portfolio view βœ… βœ…
Multi-user support βœ… βœ…
Conversation memory Basic βœ…
Risk limits Basic βœ… Full
Price alerts ❌ βœ…
Funding rate tools ❌ βœ…
Trade history ❌ βœ…
Paper trading mode ❌ βœ…
CI/CD pipeline ❌ βœ…
Monitoring/Logging Basic βœ… Full
Test coverage ~30% ~70%

🎯 Recommendation

Go with 4 weeks if you can. The extra 2 weeks give you:
  • Proper architecture that won't bite you later
  • Alerts β€” users love proactive notifications
  • Research tools β€” your differentiator from Pigeon
  • Confidence β€” more testing = fewer production fires
Go with 2 weeks if:
  • You're racing a competitor
  • You just want to validate the concept quickly
  • You're okay with rewriting parts later
  • You have experienced devs who move fast

πŸ‘₯ Team Allocation (3 Devs)

Suggested Split
Dev Focus Area Key Deliverables
Dev 1 (Backend Lead) LLM + Orchestration Gemini integration, function calling, intent routing
Dev 2 (Trading) Hyperliquid + MongoDB SDK wrapper, trade execution, data storage
Dev 3 (Frontend/Ops) Telegram Bot + DevOps Bot UX, CI/CD, deployment, monitoring