Skip to content

Commit a2ce160

Browse files
authored
add currency second agg feed topics to event type enums and message p… (#471)
* add currency second agg feed topics to event type enums and message parser * lint
1 parent 4ac7e5e commit a2ce160

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

polygon/websocket/models/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ def parse_single(data: Dict[str, Any]):
88
event_type = data["ev"]
99
if event_type in [EventType.EquityAgg.value, EventType.EquityAggMin.value]:
1010
return EquityAgg.from_dict(data)
11-
elif event_type in [EventType.CryptoAgg.value, EventType.ForexAgg.value]:
11+
elif event_type in [
12+
EventType.CryptoAgg.value,
13+
EventType.CryptoAggSec.value,
14+
EventType.ForexAgg.value,
15+
EventType.ForexAggSec.value,
16+
]:
1217
return CurrencyAgg.from_dict(data)
1318
elif event_type == EventType.EquityTrade.value:
1419
return EquityTrade.from_dict(data)

polygon/websocket/models/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class EventType(Enum):
2323
EquityAgg = "A"
2424
EquityAggMin = "AM"
2525
CryptoAgg = "XA"
26+
CryptoAggSec = "XAS"
2627
ForexAgg = "CA"
28+
ForexAggSec = "CAS"
2729
EquityTrade = "T"
2830
CryptoTrade = "XT"
2931
EquityQuote = "Q"
@@ -34,7 +36,7 @@ class EventType(Enum):
3436
CryptoL2 = "XL2"
3537
Value = "V"
3638
"""Launchpad* EventTypes are only available to Launchpad users. These values are the same across all asset classes (
37-
stocks, options, forex, crypto).
39+
stocks, options, forex, crypto).
3840
"""
3941
LaunchpadValue = "LV"
4042
LaunchpadAggMin = "AM"

0 commit comments

Comments
 (0)