MCPcopy Index your code
hub / github.com/c9s/bbgo

github.com/c9s/bbgo @bbgo-0.4.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release bbgo-0.4.6 ↗ · + Follow
13,909 symbols 60,116 edges 1,758 files 3,516 documented · 25% updated todaybbgo-0.4.6 · 2026-04-14★ 1,661114 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

BBGO

A modern crypto trading bot framework written in Go.

Current Status

Go GoDoc Go Report Card DockerHub Coverage Status open collective badge open collective badge

Community

Telegram Global Telegram Taiwan Twitter

What You Can Do With BBGO

Trading Bot Users 💁‍♀️ 💁‍♂️

You can use BBGO to run the built-in strategies.

Strategy Developers 🥷

You can use BBGO's trading unit and back-test unit to implement your own strategies.

Trading Unit Developers 🧑‍💻

You can use BBGO's underlying common exchange API; currently, it supports 8 major exchanges, so you don't have to repeat the implementation.

Features

Screenshots

bbgo dashboard

bbgo backtest report

Built-in Strategies

strategy description type backtest support
grid the first generation grid strategy, it provides more flexibility, but you need to prepare inventories maker
grid2 the second generation grid strategy, it can convert your quote asset into a grid, supports base+quote mode maker
bollgrid strategy implements a basic grid strategy with the built-in bollinger indicator maker
xmaker cross exchange market making strategy, it hedges your inventory risk on the other side maker no
xdepthmaker cross exchange depth-based market making strategy maker no
xfixedmaker cross exchange fixed-spread market making strategy maker no
xnav this strategy helps you record the current net asset value tool no
xalign this strategy aligns your balance position automatically tool no
xfunding a funding rate fee strategy funding no
autoborrow this strategy uses margin to borrow assets, to help you keep a minimal balance tool no
autobuy automatically buys a specific asset periodically tool no
pivotshort this strategy finds the pivot low and enters the trade when the price breaks the previous low long/short
schedule this strategy buy/sell with a fixed quantity periodically, you can use this as a single DCA, or to refill the fee asset like BNB tool
irr this strategy opens the position based on the predicated return rate long/short
bollmaker this strategy holds a long-term long/short position, places maker orders on both sides, and uses a bollinger band to control the position size maker
wall this strategy creates a wall (large amount of order) on the order book maker no
scmaker this market making strategy is designed for stable coin markets, like USDC/USDT maker
drift long/short
rsicross this strategy opens a long position when the fast rsi crosses over the slow rsi, this is a demo strategy for using the v2 indicator long/short
emacross EMA crossover strategy long/short
marketcap this strategy implements a strategy that rebalances the portfolio based on the market capitalization rebalance no
supertrend this strategy uses DEMA and Supertrend indicator to open the long/short position long/short
trendtrader this strategy opens a long/short position based on the trendline breakout long/short
elliottwave long/short
ewoDgtrd long/short
fixedmaker maker
factorzoo long/short
fmaker maker
linregmaker a linear regression based market maker maker
liquiditymaker provides liquidity on the order book maker
audacitymaker an audacious market making strategy maker
convert convert strategy is a tool that helps you convert a specific asset to a target asset tool no
dca dollar-cost averaging strategy tool
dca2 second generation dollar-cost averaging strategy tool
rebalance rebalances your portfolio based on target weights rebalance no
deposit2transfer automatically transfers deposits to another account tool no
sentinel monitors exchange connectivity and health tool no
tri triangular arbitrage strategy arbitrage no
random places random orders for testing purposes tool no

Supported Exchanges

  • Binance Spot Exchange (and binance.us)
  • OKX Spot Exchange (previous OKEX)
  • Kucoin Spot Exchange
  • MAX Spot Exchange (located in Taiwan)
  • Bitget Exchange
  • Bybit Exchange
  • Coinbase Exchange
  • Bitfinex Exchange

Documentation and General Topics

Requirements

Extension points exported contracts — how you extend this code

AccountBalanceProvider (Interface)
AccountBalanceProvider provides a function to query all balances at streaming connected and emit balance snapshot. [16 …
pkg/exchange/bybit/stream.go
SingleExchangeStrategy (Interface)
SingleExchangeStrategy represents the single Exchange strategy [68 implementers]
pkg/bbgo/trader.go
ExchangeOrderQueryService (Interface)
ExchangeOrderQueryService provides an interface for querying the order status via order ID or client order ID go:genera [11 …
pkg/types/exchange.go
Float64Indicator (Interface)
Float64Indicator is the indicators (SMA and EWMA) that we want to use are returning float64 data. [89 implementers]
pkg/strategy/swing/strategy.go
KLinePusher (Interface)
KLinePusher provides an interface for API user to push kline value to the indicator. The indicator implements its own wa [48 …
pkg/indicator/interface.go
Converter (Interface)
(no doc) [49 implementers]
pkg/core/converter.go
Instance (Interface)
(no doc) [47 implementers]
pkg/backtest/recorder.go
Object (Interface)
(no doc) [7 implementers]
pkg/livenote/livenote.go

Core symbols most depended-on inside this repo

Errorf
called by 2010
pkg/bbgo/trader.go
Add
called by 1737
pkg/types/series.go
Equal
called by 1675
pkg/types/time.go
NewFromFloat
called by 1637
pkg/fixedpoint/convert.go
Float64
called by 1164
pkg/fixedpoint/dec.go
String
called by 1129
pkg/dynamic/call_test.go
Infof
called by 1039
pkg/bbgo/trader.go
Run
called by 816
pkg/optimizer/local.go

Shape

Method 8,740
Function 2,911
Struct 1,469
Interface 462
TypeAlias 271
FuncType 49
Class 6
Enum 1

Languages

Go99%
TypeScript1%

Modules by API surface

pkg/pb/bbgo.pb.go332 symbols
pkg/types/kline.go102 symbols
pkg/types/indicator.go90 symbols
pkg/fixedpoint/dec.go87 symbols
pkg/pb/bbgo_grpc.pb.go86 symbols
pkg/types/stream.go67 symbols
pkg/exchange/bitfinex/bfxapi/websocket.go67 symbols
pkg/exchange/binance/stream_callbacks.go63 symbols
pkg/strategy/xmaker/strategy.go60 symbols
pkg/types/standardstream_callbacks.go58 symbols
pkg/types/mocks/mock_stream.go58 symbols
pkg/types/exchange.go56 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add bbgo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact