Polymarket
CLOB prediction markets on Polygon. Connect with one line.
Polymarket is the largest non-US prediction market venue. Matching is off-chain CLOB; settlement is on-chain ERC-1155 conditional tokens. Orders are signed client-side with an Ethereum key (EIP-712).
Connect
python
import horizon as hz
ex = hz.connect("polymarket",
private_key="0x...", # EOA signing key (hot)
funder="0x...", # funder address (often same as signer)
signature_type=0, # 0 = EOA, 1 = email proxy, 2 = browser proxy
)
# market_id is the ERC-1155 token id for YES or NO on the condition.
ex.buy("<token_id>", qty=100, limit=0.55)
print(ex.balance())
ex.close()
Kwargs
| Kwarg | Type | Default | Notes |
|---|---|---|---|
private_key | str \| None | None | 0x-prefixed 32-byte hex. Falls back to secrets.get("polymarket.private_key"). |
funder | str \| None | None | Funder address. Defaults to signer address for signature_type 0. |
signature_type | int | 0 | 0=EOA, 1=email proxy, 2=browser proxy. Most programmatic users want 0. |
chain_id | int | 137 | Polygon mainnet. |
host | str | "https://clob.polymarket.com" | CLOB REST host. No sandbox. |
api_key, api_secret, api_passphrase | str \| None | derived | Usually auto-derived from the signer by the SDK on first call. |
secrets | Secrets \| None | None | See Secrets. |
budget_usd | float | 0.0 | Optional hard cap. |
Install
bash
pip install horizon[prediction]
# or
pip install py-clob-client eth_account
Status
- Order submit / cancel / fetch: shipped.
- Position and fill polling: shipped.
- WebSocket feed:
horizon.data.live.polymarket_ws. - On-chain balance read (ERC-1155 direct): follow-up.
Symbology, signature-type semantics, resolution handler: Polymarket (professionals).