Skip to content

Fix websocket parse of tickers with periods#567

Merged
justinpolygon merged 1 commit into
masterfrom
jw-fix-backend-1474
Nov 27, 2023
Merged

Fix websocket parse of tickers with periods#567
justinpolygon merged 1 commit into
masterfrom
jw-fix-backend-1474

Conversation

@justinpolygon
Copy link
Copy Markdown
Collaborator

@justinpolygon justinpolygon commented Nov 27, 2023

Fixes polygon-io/backend/1474. Tickers like BRK.B were not getting parsed correctly. Changed to logic to only split on the first period and then pass along everything else. #559 has another potential fix but I prefer this once since the overall intention is to split out the event topic and the ticker symbol.

I've tested this and it works as expected:

2023-11-27 13:56:19,066 WebSocketClient DEBUG: sub desired: T.BRK.B
2023-11-27 13:56:19,066 WebSocketClient DEBUG: connect: wss://socket.polygon.io/stocks
2023-11-27 13:56:19,432 WebSocketClient DEBUG: connected: [{"ev":"status","status":"connected","message":"Connected Successfully"}]
2023-11-27 13:56:19,432 WebSocketClient DEBUG: authing...
2023-11-27 13:56:19,517 WebSocketClient DEBUG: authed: [{"ev":"status","status":"auth_success","message":"authenticated"}]
2023-11-27 13:56:19,517 WebSocketClient DEBUG: reconciling: set() {'T.BRK.B'}
2023-11-27 13:56:19,517 WebSocketClient DEBUG: subbing: T.BRK.B
2023-11-27 13:56:19,599 WebSocketClient DEBUG: status: subscribed to: T.BRK.B

EquityTrade(event_type='T', symbol='BRK.B', exchange=4, id='71701683064399', tape=1, price=361.34, size=22949, conditions=[12, 22], timestamp=1701122716429, sequence_number=3111734, trf_id=202, trf_timestamp=1701122716428)
EquityTrade(event_type='T', symbol='BRK.B', exchange=4, id='71701683064627', tape=1, price=361.34, size=6, conditions=[12, 37], timestamp=1701122719469, sequence_number=3111736, trf_id=202, trf_timestamp=1701122719469)

Also tested with the current examples and nothing breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants