Skip to content

Commit

Permalink
Merge pull request #1894 from c9s/fix/bybit/missing-name
Browse files Browse the repository at this point in the history
fix: [bybit] add missing exchange value in market struct
  • Loading branch information
ycdesu authored Jan 23, 2025
2 parents 808b4ec + 2515661 commit 0e13ced
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 0e13ced

Please sign in to comment.