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)
Edit : it seems an other user got same error as me (#59)
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)
Edit : it seems an other user got same error as me (#59)