File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
example_publisher/providers Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 15
15
16
16
UnixTimestamp = int
17
17
18
+ # Any feed with >= this number of min publishers is considered "coming soon".
19
+ COMING_SOON_MIN_PUB_THRESHOLD = 10
20
+
18
21
19
22
class PythReplicator (Provider ):
20
23
def __init__ (self , config : PythReplicatorConfig ) -> None :
@@ -55,11 +58,18 @@ async def _update_loop(self) -> None:
55
58
update .aggregate_price_confidence_interval ,
56
59
update .timestamp ,
57
60
]
58
- elif self ._config .manual_agg_enabled :
61
+ elif (
62
+ self ._config .manual_agg_enabled
63
+ and update .min_publishers >= COMING_SOON_MIN_PUB_THRESHOLD
64
+ ):
59
65
# Do the manual aggregation based on the recent active publishers
60
66
# and their confidence intervals if possible. This will allow us to
61
67
# get an aggregate if there are some active publishers but they are
62
68
# not enough to reach the min_publishers threshold.
69
+ #
70
+ # Note that we only manually aggregate for feeds that are coming soon. Some feeds should go
71
+ # offline outside of market hours (e.g., Equities, Metals). Manually aggregating for these feeds
72
+ # can cause them to come online at unexpected times if a single data provider publishes at that time.
63
73
prices = []
64
74
65
75
current_slot = update .slot
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " example-publisher"
3
- version = " 1.0.0 "
3
+ version = " 1.0.1 "
4
4
description = " "
5
5
authors = []
6
6
license = " Apache-2"
You can’t perform that action at this time.
0 commit comments