44
55from pythclient .pythaccounts import (
66 ACCOUNT_HEADER_BYTES ,
7- DEFAULT_MAX_LATENCY ,
87 PythPriceAccount ,
98 PythPriceType ,
109 PythPriceStatus ,
1413
1514
1615# Yes, this sucks, but it is actually a monster datastructure
17- # Equity.US.AAPL/USD symbol
16+ # Equity.US.AAPL/USD symbol with a max latency of 50 slots
1817@pytest .fixture
1918def price_account_bytes ():
2019 return base64 .b64decode ((
@@ -316,15 +315,15 @@ def test_price_account_agregate_conf_interval(
316315):
317316 price_account .update_from (buffer = price_account_bytes , version = 2 , offset = ACCOUNT_HEADER_BYTES )
318317 price_account .slot = price_account .aggregate_price_info .pub_slot
319- assert price_account .aggregate_price_confidence_interval == 0.366305
318+ assert price_account .aggregate_price_confidence_interval == 0.14454
320319
321320
322321def test_price_account_agregate_price (
323322 price_account_bytes : bytes , price_account : PythPriceAccount ,
324323):
325324 price_account .update_from (buffer = price_account_bytes , version = 2 , offset = ACCOUNT_HEADER_BYTES )
326325 price_account .slot = price_account .aggregate_price_info .pub_slot
327- assert price_account .aggregate_price == 707.125
326+ assert price_account .aggregate_price == 236.23373
328327
329328def test_price_account_unknown_status (
330329 price_account_bytes : bytes , price_account : PythPriceAccount ,
@@ -340,7 +339,7 @@ def test_price_account_get_aggregate_price_status_still_trading(
340339 price_account_bytes : bytes , price_account : PythPriceAccount
341340):
342341 price_account .update_from (buffer = price_account_bytes , version = 2 , offset = ACCOUNT_HEADER_BYTES )
343- price_account .slot = price_account .aggregate_price_info .pub_slot + DEFAULT_MAX_LATENCY
342+ price_account .slot = price_account .aggregate_price_info .pub_slot + 50
344343
345344 price_status = price_account .aggregate_price_status
346345 assert price_status == PythPriceStatus .TRADING
@@ -349,7 +348,7 @@ def test_price_account_get_aggregate_price_status_got_stale(
349348 price_account_bytes : bytes , price_account : PythPriceAccount
350349):
351350 price_account .update_from (buffer = price_account_bytes , version = 2 , offset = ACCOUNT_HEADER_BYTES )
352- price_account .slot = price_account .aggregate_price_info .pub_slot + DEFAULT_MAX_LATENCY + 1
351+ price_account .slot = price_account .aggregate_price_info .pub_slot + 50 + 1
353352
354353 price_status = price_account .aggregate_price_status
355354 assert price_status == PythPriceStatus .UNKNOWN
0 commit comments