diff --git a/pkg/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go index 4ef65afa3..ec8f024c2 100644 --- a/pkg/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -1356,8 +1356,7 @@ func (e *Exchange) QueryDepth(ctx context.Context, symbol string) (snapshot type func convertDepth(symbol string, response *binanceapi.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) { snapshot.Symbol = symbol - // empty time since the API does not provide time information. - snapshot.Time = time.Time{} + snapshot.Time = time.Now() finalUpdateID = response.LastUpdateId for _, entry := range response.Bids { diff --git a/pkg/types/sliceorderbook.go b/pkg/types/sliceorderbook.go index d48fb528a..da45dd511 100644 --- a/pkg/types/sliceorderbook.go +++ b/pkg/types/sliceorderbook.go @@ -136,7 +136,7 @@ func (b *SliceOrderBook) updateBids(pvs PriceVolumeSlice) { func (b *SliceOrderBook) update(book SliceOrderBook) { b.updateBids(book.Bids) b.updateAsks(book.Asks) - b.lastUpdateTime = time.Now() + b.lastUpdateTime = defaultTime(book.Time, time.Now) } func (b *SliceOrderBook) Reset() {