Python client for the Polymarket CLOB
Project description
py-clob-client
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.1.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for py_clob_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e27826cedb7f830539833ca684b43a322a406196299f4d6845f5d31387c79e84 |
|
MD5 | 4028b836e2648c59aee88cb839e66105 |
|
BLAKE2b-256 | 676aaa999a5b708238e1f2b9d2d41c6c9636f5c62c356e4cba12086d3529c09f |