Skip to content

feat: add CLOB_HOST constant for the production endpoint (closes #30) - #80

Closed
Nexory wants to merge 1 commit into
Polymarket:mainfrom
Nexory:feat/add-clob-host-constant
Closed

feat: add CLOB_HOST constant for the production endpoint (closes #30)#80
Nexory wants to merge 1 commit into
Polymarket:mainfrom
Nexory:feat/add-clob-host-constant

Conversation

@Nexory

@Nexory Nexory commented May 26, 2026

Copy link
Copy Markdown

Summary

Adds CLOB_HOST = "https://clob.polymarket.com" to py_clob_client_v2/constants.py so consumers do not have to hard-code the production CLOB endpoint in their own code.

The URL is currently duplicated across:

Closes #30.

Change

CLOB_HOST = "https://clob.polymarket.com"

Added to constants.py alongside the existing ZERO_ADDRESS, POLYGON, AMOY, etc.

Usage

from py_clob_client_v2 import ClobClient
from py_clob_client_v2.constants import CLOB_HOST, POLYGON

client = ClobClient(host=CLOB_HOST, chain_id=POLYGON, key=PK)

Scope

Intentionally minimal — just the production mainnet host. I didn't add an Amoy/testnet host because I don't know whether one is publicly maintained, and a wrong constant would be worse than no constant. Happy to add one in a follow-up if maintainers can confirm the endpoint.

Test plan

  • Manual: from py_clob_client_v2.constants import CLOB_HOST works.
  • No existing tests changed (purely additive).
  • CI passes.

Note

Low Risk
Single additive constant with no behavior or API changes.

Overview
Adds a shared CLOB_HOST constant (https://clob.polymarket.com) in py_clob_client_v2/constants.py next to existing network constants like POLYGON and AMOY, so callers can pass host=CLOB_HOST to ClobClient instead of repeating the production URL in app code, docs, and examples.

Reviewed by Cursor Bugbot for commit f9e6092. Bugbot is set up for automated code reviews on this repo. Configure here.

Closes Polymarket#30

Adds `CLOB_HOST = "https://clob.polymarket.com"` to `constants.py` so
consumers do not have to hard-code the production CLOB endpoint in
their own code. The URL is currently duplicated across the README,
every example in `examples/`, and the test suite.

Usage:

    from py_clob_client_v2.constants import CLOB_HOST
    client = ClobClient(host=CLOB_HOST, chain_id=POLYGON, key=PK)
@Nexory

Nexory commented Aug 4, 2026

Copy link
Copy Markdown
Author

Closing in favour of #35, which predates this (2026-04-29) and does the same thing plus exports the constant via __init__.py. Withdrawing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding constant for CLOB host

1 participant