Skip to content

Commit

Permalink
pkg/exchange: support TimeRangeProvider in bybit
Browse files Browse the repository at this point in the history
  • Loading branch information
bailantaotao committed Oct 26, 2023
1 parent d9474bb commit bb29973
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/exchange/bybit/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
_ types.ExchangeTradeService = &Exchange{}
_ types.Exchange = &Exchange{}
_ types.ExchangeOrderQueryService = &Exchange{}
_ types.ExchangeTimeRangeProvider = &Exchange{}
)

type Exchange struct {
Expand Down Expand Up @@ -592,6 +593,16 @@ func (e *Exchange) GetAllFeeRates(ctx context.Context) (bybitapi.FeeRates, error
return *feeRates, nil
}

// GetMaxTradeHistoryTimeRange returns 180 days since the exchange support time range
func (e *Exchange) GetMaxTradeHistoryTimeRange() time.Duration {
return 180 * 24 * time.Hour
}

// GetMaxOrderHistoryTimeRange returns 0 since the exchange not supported
func (e *Exchange) GetMaxOrderHistoryTimeRange() time.Duration {
return 0
}

func (e *Exchange) NewStream() types.Stream {
return NewStream(e.key, e.secret, e)
}

0 comments on commit bb29973

Please sign in to comment.