|
5 | 5 | from zoneinfo import ZoneInfo
|
6 | 6 |
|
7 | 7 | import arrow
|
8 |
| -from pythclient.calendar import is_market_open |
| 8 | +from pythclient.market_schedule import MarketSchedule |
9 | 9 | from pythclient.pythaccounts import PythPriceStatus
|
10 | 10 | from pythclient.solana import SolanaPublicKey
|
11 | 11 |
|
|
16 | 16 | class PriceFeedState:
|
17 | 17 | symbol: str
|
18 | 18 | asset_type: str
|
| 19 | + schedule: MarketSchedule |
19 | 20 | public_key: SolanaPublicKey
|
20 | 21 | status: PythPriceStatus
|
21 | 22 | latest_block_slot: int
|
@@ -55,8 +56,7 @@ def state(self) -> PriceFeedState:
|
55 | 56 | return self.__state
|
56 | 57 |
|
57 | 58 | def run(self) -> bool:
|
58 |
| - market_open = is_market_open( |
59 |
| - self.__state.asset_type.lower(), |
| 59 | + market_open = self.__state.schedule.is_market_open( |
60 | 60 | datetime.now(ZoneInfo("America/New_York")),
|
61 | 61 | )
|
62 | 62 |
|
@@ -176,8 +176,7 @@ def run(self) -> bool:
|
176 | 176 | if self.__state.status != PythPriceStatus.TRADING:
|
177 | 177 | return True
|
178 | 178 |
|
179 |
| - market_open = is_market_open( |
180 |
| - self.__state.asset_type.lower(), |
| 179 | + market_open = self.__state.schedule.is_market_open( |
181 | 180 | datetime.now(ZoneInfo("America/New_York")),
|
182 | 181 | )
|
183 | 182 |
|
@@ -237,8 +236,7 @@ def run(self) -> bool:
|
237 | 236 | if self.__state.status != PythPriceStatus.TRADING:
|
238 | 237 | return True
|
239 | 238 |
|
240 |
| - market_open = is_market_open( |
241 |
| - self.__state.asset_type.lower(), |
| 239 | + market_open = self.__state.schedule.is_market_open( |
242 | 240 | datetime.now(ZoneInfo("America/New_York")),
|
243 | 241 | )
|
244 | 242 |
|
|
0 commit comments