diff --git a/README.md b/README.md index 97afa55a6..534af12b3 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,8 @@ the implementation. - OKEx Spot Exchange - Kucoin Spot Exchange - MAX Spot Exchange (located in Taiwan) -- Bitget (In Progress) +- Bitget Exchange (In Progress) +- Bybit Exchange (In Progress) ## Documentation and General Topics @@ -219,6 +220,10 @@ KUCOIN_API_KEY= KUCOIN_API_SECRET= KUCOIN_API_PASSPHRASE= KUCOIN_API_KEY_VERSION=2 + +# for Bybit exchange, if you have one +BYBIT_API_KEY= +BYBIT_API_SECRET= ``` Prepare your dotenv file `.env.local` and BBGO yaml config file `bbgo.yaml`. diff --git a/pkg/exchange/factory.go b/pkg/exchange/factory.go index 95bd53b87..00d6db7c9 100644 --- a/pkg/exchange/factory.go +++ b/pkg/exchange/factory.go @@ -7,6 +7,7 @@ import ( "github.com/c9s/bbgo/pkg/exchange/binance" "github.com/c9s/bbgo/pkg/exchange/bitget" + "github.com/c9s/bbgo/pkg/exchange/bybit" "github.com/c9s/bbgo/pkg/exchange/kucoin" "github.com/c9s/bbgo/pkg/exchange/max" "github.com/c9s/bbgo/pkg/exchange/okex" @@ -44,6 +45,9 @@ func New(n types.ExchangeName, key, secret, passphrase string) (types.ExchangeMi case types.ExchangeBitget: return bitget.New(key, secret, passphrase), nil + case types.ExchangeBybit: + return bybit.New(key, secret) + default: return nil, fmt.Errorf("unsupported exchange: %v", n) diff --git a/pkg/types/exchange.go b/pkg/types/exchange.go index 36670c35e..70e3c1379 100644 --- a/pkg/types/exchange.go +++ b/pkg/types/exchange.go @@ -46,6 +46,7 @@ const ( ExchangeKucoin ExchangeName = "kucoin" ExchangeBitget ExchangeName = "bitget" ExchangeBacktest ExchangeName = "backtest" + ExchangeBybit ExchangeName = "bybit" ) var SupportedExchanges = []ExchangeName{ @@ -54,6 +55,7 @@ var SupportedExchanges = []ExchangeName{ ExchangeOKEx, ExchangeKucoin, ExchangeBitget, + ExchangeBybit, // note: we are not using "backtest" }