Skip to content

CRITICAL: Always uses tokens[0] regardless of YES/NO side #14

@Sszmentor

Description

@Sszmentor

Bug

trading.py:107,243,399,989 always picks tokens[0]['token_id'] regardless of whether the order is BUY YES, BUY NO, SELL YES, or SELL NO. Comment at line 102: "For simplicity, use first token."

This means SELL NO actually sells YES token. Incorrect token selection = wrong trades.

Fix

Accept side parameter (YES/NO), map to correct token index. Polymarket binary markets: tokens[0]=YES, tokens[1]=NO (verify via Gamma API response).

Files

  • src/polymarket_mcp/tools/trading.py:102-107, 243, 399, 989

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions