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

KwargTypeDefaultNotes
private_keystr \| NoneNone0x-prefixed 32-byte hex. Falls back to secrets.get("polymarket.private_key").
funderstr \| NoneNoneFunder address. Defaults to signer address for signature_type 0.
signature_typeint00=EOA, 1=email proxy, 2=browser proxy. Most programmatic users want 0.
chain_idint137Polygon mainnet.
hoststr"https://clob.polymarket.com"CLOB REST host. No sandbox.
api_key, api_secret, api_passphrasestr \| NonederivedUsually auto-derived from the signer by the SDK on first call.
secretsSecrets \| NoneNoneSee Secrets.
budget_usdfloat0.0Optional 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).