Skip to content

Python utilities to generate and sign orders for Polymarket's CLOB

License

Notifications You must be signed in to change notification settings

Polymarket/python-order-utils

Repository files navigation

Polymarket CLOB Python order-utils

PyPI

Python utilities used to generate and sign orders from Polymarket's Exchange

Install

pip install py-order-utils

Usage

from py_order_utils.builders import OrderBuilder
from py_order_utils.signer import Signer
from pprint import pprint

def main():
    exchange_address = "0x...."
    chain_id = 80002
    signer = Signer("0x....")
    builder = OrderBuilder(exchange_address, chain_id, signer)

    # Create and sign the order
    order = builder.build_signed_order(
        OrderData(
            ...
        )
    )

    # Generate the Order and Signature json to be sent to the CLOB API
    pprint(json.dumps(order.dict()))

About

Python utilities to generate and sign orders for Polymarket's CLOB

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •