Skip to content

Commit

Permalink
binance: remove orderbook convert error var
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed May 24, 2024
1 parent 90d5d64 commit 55c6a43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/exchange/binance/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,14 @@ func (e *DepthEvent) String() (o string) {
return o
}

func (e *DepthEvent) OrderBook() (book types.SliceOrderBook, err error) {
func (e *DepthEvent) OrderBook() (book types.SliceOrderBook) {
book.Symbol = e.Symbol
book.Time = e.EventBase.Time.Time()

// already in descending order
book.Bids = e.Bids
book.Asks = e.Asks
return book, err
return book
}

func parseDepthEntry(val *fastjson.Value) (*types.PriceVolume, error) {
Expand Down
5 changes: 0 additions & 5 deletions pkg/exchange/binance/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ func NewStream(ex *Exchange, client *binance.Client, futuresClient *futures.Clie
})
f.SetBufferingPeriod(time.Second)
f.OnReady(func(snapshot types.SliceOrderBook, updates []depth.Update) {
if valid, err := snapshot.IsValid(); !valid {
log.Errorf("%s depth snapshot is invalid, error: %v", e.Symbol, err)
return
}

stream.EmitBookSnapshot(snapshot)
for _, u := range updates {
stream.EmitBookUpdate(u.Object)
Expand Down

0 comments on commit 55c6a43

Please sign in to comment.