Skip to content

fantasyni/BitgetAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitgetAgent Logo

BitgetAgent

A local-first AI Agent stack for creating NautilusTrader-based Crypto strategies from natural language and backtesting them.

BitgetAgent Screenshot

BitgetAgent Screenshot


What Is BitgetAgent?

BitgetAgent is an open-source desktop system for building, explaining, and backtesting Crypto trading strategies with AI. Generated strategies are implemented as NautilusTrader strategy code and validated through a NautilusTrader-based backtesting workflow.

The current product focuses on the strategy research loop:

  1. Describe a strategy idea in natural language, including market, timeframe, indicators, entry/exit logic, and risk preferences.
  2. Generate NautilusTrader strategy code and structured strategy definitions that can be inspected and revised.
  3. Backtest the strategy with NautilusTrader against historical market data to evaluate returns, drawdown, win rate, and risk behavior.
  4. Iterate with the Agent by asking for explanations, parameter changes, risk adjustments, and new variants.

BitgetAgent is local-first by default. It runs with SQLite out of the box, while also supporting multi-model LLM routing, tools, Agent Skills, visual workflows, and MCP integrations, including bitget-mcp-server for Bitget/Crypto market capabilities. The goal is to help developers and strategy researchers turn trading ideas into observable, testable, and repeatable strategy workflows.

Simulated trading and live trading are not the current headline capability. They are planned extension areas that will build on top of the strategy generation, validation, backtesting, and risk-control foundation.


Core Capabilities

  • Natural-language Strategy Creation
    Turn plain-language strategy ideas into NautilusTrader strategy code, including indicators, entry conditions, exit rules, sizing assumptions, and risk constraints.

  • Strategy Explanation & Iteration
    Ask the Agent to explain generated logic, revise parameters, compare variants, tighten risk rules, or adapt a strategy for different market regimes.

  • Backtesting Workflow
    Evaluate generated strategies through NautilusTrader backtests, then inspect performance, drawdown, win rate, and other risk/return signals before considering any execution path.

  • Crypto Agent Runtime
    Multi-turn sessions, streaming responses, tool execution, task tracking, layered prompts, model routing, and episodic / semantic / procedural memory.

  • Visual Workflow Builder
    A ReactFlow-based editor for composing reusable research, strategy validation, backtesting, reporting, and automation flows.

  • NautilusTrader Foundation
    Strategy code follows NautilusTrader conventions, and backtests are run through the NautilusTrader backtest runner rather than a lightweight custom simulator.

  • Declarative Rule Engine
    YAML-based rules for thresholds, date windows, regular expressions, cross-validation, LLM judging, and strategy or risk conditions.

  • Agent Skills & MCP
    Extend Agent behavior with SKILL.md skill bundles and Model Context Protocol integrations for research, data access, strategy development, and validation workflows.

  • bitget-mcp-server Integration
    Connects BitgetAgent to bitget-mcp-server through MCP, giving the Agent a dedicated bridge for Bitget/Crypto market tooling instead of relying only on built-in local tools.

  • Multi-Model Providers
    Supports DeepSeek, DashScope / Qwen, OpenAI, Anthropic, Ollama, vLLM, Azure OpenAI, and other OpenAI-compatible providers.

  • Local-first Deployment
    SQLite by default, single-machine friendly, with optional PostgreSQL and Milvus for larger setups.


Architecture

Strategy Ideas / Market Data
        |
        v
BitgetAgent Tools / MCP / Workflows
        |
        v
Agent Runtime
(QueryEngine, memory, prompts, model routing)
        |
        +-- Natural-language strategy creation
        +-- NautilusTrader strategy code generation
        +-- Strategy explanation and revision
        +-- NautilusTrader backtesting and result analysis
        +-- bitget-mcp-server MCP integration
        +-- Risk-rule checks
        +-- Research reports and workflow automation
        +-- Simulated / live trading extensions (planned)

Key modules:

  • backend/bitget_agent/agent — Agent orchestration, planning, tool execution, and subagents.
  • backend/bitget_agent/tools — Built-in tool system for data, automation, execution, and analysis.
  • backend/bitget_agent/mcp — MCP client, server management, and proxy tools, including integration paths such as bitget-mcp-server.
  • backend/bitget_agent/services/trading — NautilusTrader strategy generation, validation, backtesting, and strategy-chat iteration services.
  • backend/bitget_agent/workflow — Workflow engine and visual node runtime.
  • backend/bitget_agent/rules — Declarative rule engine.
  • backend/bitget_agent/memory — Three-store Agent memory.
  • backend/bitget_agent/llm — Multi-provider LLM service and routing.
  • frontend/ — React 19 + TypeScript desktop web UI.

Quick Start

Local Development

Prerequisites: git, uv, Node.js 20+ or 22+.

git clone https://github.com/fantasyni/BitgetAgent.git
cd BitgetAgent/
cd backend
uv sync --extra dev
uv run bitget-agent init
uv run bitget-agent app start
cd frontend
npm install
npm run dev
  • Backend: http://localhost:7860
  • Frontend: http://localhost:5172

Configuration

Bitget Configuration

Project Status

BitgetAgent is being focused from a general AI automation platform into a dedicated Crypto strategy Agent stack.

Current implemented focus:

  • NautilusTrader strategy generation, explanation, backtesting, and iteration
  • Natural-language strategy creation and modification
  • Backtest result analysis and strategy comparison
  • Risk-rule expression and validation
  • MCP integration with bitget-mcp-server
  • A local, controllable Agent runtime for strategy research

Roadmap areas:

  • Simulated trading
  • Live trading
  • Exchange adapters
  • Execution monitoring and production-grade risk controls

Contributing

Issues and pull requests are welcome. For larger or ambiguous changes, please open an issue first.

Please follow:

  • Coding conventions in AGENTS.md
  • Python type hints, Pydantic v2, and async I/O conventions
  • TypeScript, React, and frontend i18n parity rules
  • Tests for behavior changes

License

Apache License 2.0. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages