Skip to content

OrdersResource.fills / fills_all hits /portfolio/fills — belongs on PortfolioResource #351

Closed

Description

@TexasCoding

Problem

PortfolioResource owns the /portfolio/* family — balance, positions, settlements, deposits, withdrawals — except for fills, which sits on OrdersResource even though the URL is /portfolio/fills and the response shape (Page[Fill] with cursor + min_ts/max_ts/ticker filters) matches settlements() exactly.

A user discovering the SDK via autocomplete on client.portfolio. will not find their fills and may infer the endpoint doesn't exist. The grouping also breaks the README's framing of portfolio.deposits() / portfolio.withdrawals() as the cost-introspection family.

Evidence

  • kalshi/resources/orders.py:584-608 — fills lives on OrdersResource and hits /portfolio/fills
def fills(self, *, ticker: str | None = None, ...) -> Page[Fill]:
    ...
    return self._list(
        "/portfolio/fills", Fill, "fills", params=params, extra_headers=extra_headers
    )
  • kalshi/resources/portfolio.py:144,220,254 — settlements, deposits, withdrawals all live on PortfolioResource with identical Page[T] shape.

Suggested fix

Add fills / fills_all to PortfolioResource (and AsyncPortfolioResource) with the same signatures. Leave a one-version forwarding shim on OrdersResource.fills / fills_all that emits DeprecationWarning and delegates to the new location. Update docs/resources/orders.md and docs/resources/portfolio.md to reflect the migration, and add a test that asserts both spellings resolve during the transition.

Source

Round-3 independent audit (reviewer: resources_api).

Activity

  1. added
    polishCode-quality and DX improvements; non-functional
    on May 22, 2026
  2. added this to the v3.0.0 milestone on May 22, 2026
  3. TexasCoding commented on May 22, 2026

    @TexasCoding
    OwnerAuthor

    Deferred to v3.0.0 per Round-3 audit closure plan.

    Reason: this change renames public methods, so it cannot ship in a v2.x minor without adding deprecation aliases + warnings + alias tests for every renamed symbol. Bundling all such renames into v3.0.0 keeps v2.7 a clean polish release and avoids alias drift.

    Linked plan: /tmp/kalshi-review-r3/PLAN.md Wave 4. Re-opens (well, stays open) for scheduling when v3.0.0 work begins.

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

    polishCode-quality and DX improvements; non-functional

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions