diff --git a/openbb_platform/extensions/websockets/README.md b/openbb_platform/extensions/websockets/README.md index 9f2895d6ef7..5d83dc925ff 100644 --- a/openbb_platform/extensions/websockets/README.md +++ b/openbb_platform/extensions/websockets/README.md @@ -77,7 +77,7 @@ The table below is not intended as a source of truth. Availability will depend on the access level permitted by the provider's API key. -#### Usage +#### Example ```python conn = obb.websockets.create_connection(provider="tiingo", asset_type="crypto", symbol="*", feed="trade", start_broadcast=True) diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/websocket_connection.py b/openbb_platform/providers/polygon/openbb_polygon/models/websocket_connection.py index 7aafbc6689b..d792f260653 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/websocket_connection.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/websocket_connection.py @@ -8,10 +8,7 @@ from typing import Any, Literal, Optional from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.provider.abstract.data import Data from openbb_core.provider.abstract.fetcher import Fetcher -from openbb_core.provider.utils.descriptions import ( - DATA_DESCRIPTIONS, - QUERY_DESCRIPTIONS, -) +from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_polygon.utils.constants import ( CRYPTO_EXCHANGE_MAP, FX_EXCHANGE_MAP, @@ -775,18 +772,22 @@ class PolygonStockQuoteWebSocketData(WebSocketData): bid_exchange: str = Field( description="The exchange where the bid originated.", ) - bid_size: float = Field( + bid_size: Optional[float] = Field( + default=None, description="The size of the bid.", ) - bid: float = Field( + bid: Optional[float] = Field( + default=None, description="The bid price.", json_schema_extra={"x-unit_measurement": "currency"}, ) - ask: float = Field( + ask: Optional[float] = Field( + default=None, description="The ask price.", json_schema_extra={"x-unit_measurement": "currency"}, ) - ask_size: float = Field( + ask_size: Optional[float] = Field( + default=None, description="The size of the ask.", ) ask_exchange: str = Field( diff --git a/openbb_platform/providers/polygon/openbb_polygon/utils/constants.py b/openbb_platform/providers/polygon/openbb_polygon/utils/constants.py index 9b827c09116..41ab54d99f1 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/utils/constants.py +++ b/openbb_platform/providers/polygon/openbb_polygon/utils/constants.py @@ -155,9 +155,11 @@ STOCK_QUOTE_CONDITIONS = { 90: "Syndicate Bid", 91: "Pre Syndicate Bid", 92: "Penalty Bid", + 95: "CQS Generated", } STOCK_QUOTE_INDICATORS = { + 1: "EXCHANGE_ACQUISITION", 601: "NBBO_NO_CHANGE", 602: "NBBO_QUOTE_IS_NBBO", 603: "NBBO_NO_BB_NO_BO",