Skip to content

Commit

Permalink
bybit: add missing exchange value in market struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ycdesu committed Jan 23, 2025
1 parent 852536e commit 2515661
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/exchange/bybit/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func toGlobalMarket(m bybitapi.Instrument) types.Market {
return types.Market{
Exchange: types.ExchangeBybit,
Symbol: m.Symbol,
LocalSymbol: m.Symbol,
PricePrecision: m.LotSizeFilter.QuotePrecision.NumFractionalDigits(),
Expand Down
4 changes: 3 additions & 1 deletion pkg/exchange/bybit/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/c9s/bbgo/pkg/exchange/bybit/bybitapi"
v3 "github.com/c9s/bbgo/pkg/exchange/bybit/bybitapi/v3"
"github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/types"
"github.com/stretchr/testify/assert"
)

func TestToGlobalMarket(t *testing.T) {
Expand Down Expand Up @@ -64,6 +65,7 @@ func TestToGlobalMarket(t *testing.T) {
}

exp := types.Market{
Exchange: types.ExchangeBybit,
Symbol: inst.Symbol,
LocalSymbol: inst.Symbol,
PricePrecision: 8,
Expand Down

0 comments on commit 2515661

Please sign in to comment.