Polymarket Web UI vs. API Discrepancy Summary

The Problem

I encountered a significant inconsistency between orders visible in the Polymarket web UI interface and those returned by the CLOB API using generated API credentials. Specifically:

  1. Orders visible in the web UI were not appearing in my API responses when querying with my regular trading API credentials

  2. This created confusion and operational risk since I couldn't programmatically access the full set of my active orders

  3. My bot was essentially "flying blind" with respect to some orders placed through the web interface

Root Cause Analysis

After investigation, I determined that the Polymarket platform maintains separate authentication contexts:

  1. Trading API credentials - Used for programmatic access via their documented API endpoints

  2. Web UI session credentials - Used by the browser interface, which had access to a more complete view of orders

The generated API credentials were only showing a subset of orders (those made with the generated credentials, it was oblivious to the others). Interestingly, although orders made via the API were invisible in the web UI, once filled the positions and trade history would show them.

The Solution

I solved this by:

  1. Browser Network Inspection: Using Chrome DevTools to inspect network traffic while interacting with the Polymarket web UI

  2. Websocket Request Capture: Identified critical authentication data being sent via websocket connections

  3. Credential Extraction: Extracted the web UI's API key, secret, and passphrase from these websocket requests

The key insight was discovering that the web UI websocket connections contained the full set of credentials needed to authenticate as the web UI does, giving me access to the complete order state.

Results

By implementing this approach:

  • I can now see ALL orders regardless of how they were placed

  • My bot has complete visibility into my trading positions

This approach might be useful for other Polymarket API users experiencing similar inconsistencies between the web UI and API response data.

--- written with the help of AI

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
πŸ›

Bug Reports

Date

12 months ago

Author

Ivo Z

Subscribe to post

Get notified by email when there are changes.