Skip to content

Add filter param to get_positions (losers_only, winners_only, all) #10

Description

@autojack-bot

Problem

get_positions returns all ~40 positions every time, which eats significant context window in LLM workflows — even when you only care about a subset.

Proposed Solution

Add an optional filter query param to get_positions:

  • losers_only — return only positions with negative P&L (tax-loss harvesting, "what's on sale")
  • winners_only — return only positions with positive P&L
  • all — current behavior (default, backwards compatible)

Example Usage

GET /positions?filter=losers_only

Why

For common portfolio analysis tasks (tax-loss harvesting, reviewing underperformers), this cuts the response from ~40 positions to ~10-12 — a ~70% reduction in context usage with no loss of relevant data.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions