Skip to content

Critical floating-point precision drift in Polymarket SDK order placement (v2 market/limit orders) #66

@iambecause

Description

@iambecause

While using the Polymarket Python SDK (py_clob_client_v2), I observed a persistent floating-point precision issue when building and submitting market and limit orders.

Even when explicitly setting a clean input price such as:

0.936

the SDK internally transforms it into values such as:

0.936000936000936

Then i get this error the tick for this market is "0.001" btw so 0.936 fits perfectly.

STEPS TO REPRODUCE:

resp = client.create_and_post_market_order(
order_args=MarketOrderArgs(
token_id=token,
side=BUY,
amount = 2,
price= 0.936

),

options=PartialCreateOrderOptions(
tick_size="0.001",neg_risk=False),
order_type=OrderType.GTC

)

print(resp)

Image

Edit : it seems an other user got same error as me (#59)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions