Skip to main content

Python client for the Polymarket CLOB

Project description

py-clob-client

PyPI

Python client for the Polymarket CLOB

Installation

pip install py-clob-client

Intended for use with Python 3.9

Usage

host = "http://localhost:8080"
key = os.getenv("PK")
creds = ApiCreds(api_key=os.getenv("CLOB_API_KEY"), api_secret=os.getenv("CLOB_SECRET"), api_passphrase=os.getenv("CLOB_PASS_PHRASE"))
chain_id = 80001
client = ClobClient(host, key=key, chain_id=chain_id, creds=creds)

# Create and sign an order buying 100 YES tokens for 0.50c each
resp = client.create_and_post_order(OrderArgs(
    price=0.50,
    size=100.0,
    side=BUY,
    token_id="16678291189211314787145083999015737376658799626183230671758641503291735614088"
))

print(resp)

See examples for more

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_clob_client-0.1.8.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file py_clob_client-0.1.8.tar.gz.

File metadata

  • Download URL: py_clob_client-0.1.8.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.16

File hashes

Hashes for py_clob_client-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7bcf88adb943e059d8033f47e056b1df33114fe7fd3059a4a1700c7f27fdb5f3
MD5 1f016a142077b38af176d1a4e7caafb5
BLAKE2b-256 4756f97861339466b47e511bb54c715f48997b2180c69c221959767825dcd261

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page