Skip to content

docs: clarify what custom_feature_enabled gates on ClobMarketStreamManager.subscribe #43

@Nexory

Description

@Nexory

ClobMarketStreamManager.subscribe() in src/polymarket/_internal/streams/clob/market.py:65 accepts a custom_feature_enabled: bool = False parameter, but neither the method nor MarketSubscription documents what this flag enables.

Reading _internal/streams/clob/market_protocol.py:91 (match_for) shows that the flag gates delivery of:

  • MarketBestBidAskEvent (top-of-book updates)
  • NewMarketEvent (new market created)
  • MarketResolvedEvent (market resolved)

Without this knowledge, users would not realize they need to set the flag to receive top-of-book updates or market lifecycle events.

Suggested change: Add a docstring on subscribe() listing which events the flag enables:

async def subscribe(
    self,
    *,
    token_ids: Iterable[str],
    custom_feature_enabled: bool = False,
) -> AsyncSubscriptionHandle[MarketEvent]:
    """Subscribe to market events for the given token IDs.

    When ``custom_feature_enabled=True``, the server additionally emits:
    - ``best_bid_ask`` (top-of-book updates)
    - ``new_market`` (new market created)
    - ``market_resolved`` (market resolved)
    """

Happy to send a small docs PR if welcome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions