From 1bd421a0f3b88e91b3acc85784cb2ef7647457d1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 3 Mar 2023 12:27:03 -0500 Subject: [PATCH] Block hist queries for non-60s --- piker/brokers/deribit/feed.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/piker/brokers/deribit/feed.py b/piker/brokers/deribit/feed.py index 7161aab52..d77a7e1b1 100644 --- a/piker/brokers/deribit/feed.py +++ b/piker/brokers/deribit/feed.py @@ -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