Skip to content

Async total_resting_order_value docstring drops the FCM/403/demo-parity note the sync has #338

Closed

Description

@TexasCoding

Problem

The sync PortfolioResource.total_resting_order_value docstring tells callers up-front that non-FCM accounts receive 403 on this route, and that demo mirrors prod per the Path B audit (2026-04-18). The async counterpart only carries the FCM line. An async caller seeing an unexpected 403 has to find the sync class to read the rest of the explanation.

Identical wire behavior, asymmetric in-source guidance.

Evidence

  • kalshi/resources/portfolio.py:206-213 — sync, full explanation:
def total_resting_order_value(
    self, *, extra_headers: dict[str, str] | None = None
) -> TotalRestingOrderValue:
    """Total value of resting orders in cents. FCM-members only.

    Non-FCM accounts receive 403; demo mirrors prod on this route
    per Path B audit (2026-04-18).
    """
  • kalshi/resources/portfolio.py:420-423 — async, abbreviated:
async def total_resting_order_value(
    self, *, extra_headers: dict[str, str] | None = None
) -> TotalRestingOrderValue:
    """Total value of resting orders in cents. FCM-members only."""

Suggested fix

Copy the full sync docstring into the async method, or replace the async body with """Async counterpart of :meth:PortfolioResource.total_resting_order_value.""" so Sphinx / IDE hover renders the same content. Sweep the rest of kalshi/resources/portfolio.py for similar sync→async docstring drift while in there.

Source

Round-3 independent audit (reviewer: sync_async_parity).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpolishCode-quality and DX improvements; non-functional

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions