Skip to content

Commit

Permalink
Block hist queries for non-60s
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Mar 3, 2023
1 parent 2ea850e commit 1bd421a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions piker/brokers/deribit/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ async def get_ohlc(
datetime, # start
datetime, # end
]:
if timeframe != 60:
raise DataUnavailable('Only 1m bars are supported')

array = await client.bars(
instrument,
start_dt=start_dt,
end_dt=end_dt,
)

if len(array) == 0:
raise DataUnavailable

Expand Down

0 comments on commit 1bd421a

Please sign in to comment.