Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Fixing Polymarket's "invalid amounts" error on the CLOB (py-clob-client)

Fixing Polymarket's "invalid amounts" error on the CLOB (py-clob-client) If you've posted an order to Polymarket's CLOB with py-clob-client and gotten back a flat invalid amounts — even though your size looks fine and you rounded it to t…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Fixing Polymarket's "invalid amounts" error on the CLOB (py-clob-client)



If you've posted an order to Polymarket's CLOB with py-clob-client and gotten

back a flat invalid amounts — even though your size looks fine and you

rounded it to two decimals — here's what's actually going on, and a one-line fix.





The undocumented rule



A CLOB order carries two integer amounts (scaled by 1e6). Both must be whole

multiples of 10000:




makerAmount = price * size * 1_000_000     # multiple of 10000
takerAmount = size * 1_000_000 # multiple of 10000






round(size, 2) isn't enough. Concrete example:




price = 0.82, size = 6.25
makerAmount = 0.82 * 6.25 * 1e6 = 5_125_000
5_125_000 % 10000 = 5000 -> invalid amounts






The catch: the valid step for size depends on the price.






The fix






import math

def size_step_units(price): # in 1/10000-share units
p_int = int(round(price * 10000))
maker_step = 1_000_000 // math.gcd(p_int, 1_000_000)
return maker_step * 100 // math.gcd(maker_step, 100)

def round_for_fok(price, size):
p = max(0.01, min(0.99, round(price, 2)))
step = size_step_units(p)
units = (int(round(size * 10000)) // step) * step or step
return p, round(units / 10000, 4)






round_for_fok(0.82, 6.25) → (0.82, 6.0), and now both amounts are valid. I

packaged this (plus a $1 / 5-share minimum-order check) as a tiny MIT tool:

https://github.com/BlueWhale-Quant-Lab/polymarket-clob-order-amount-tick-size






Two more traps on the daily markets





  • invalid tick size — the daily ("...on June 1") markets use a 0.001
    tick, not 0.01. Hard-coding tick_size="0.01" gets them rejected.


  • The 10-share minimum step — at prices like 0.999, the smallest valid
    size step is 10 shares, so a sub-10-share order at that price is impossible.
    You either round up or move the price.



And if you rest GTC orders, flooring the size loses shares to the fee skim and

can leave your two legs unbalanced (No > Yes); you want nearest-rounding with a

±tick price search instead. Those are in the PRO build

here,

but the free tool above fixes the common invalid amounts case for everyone.



(This is order-amount math — not order placement, signing, or any profit claim.)

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Fixing Polymarket's "invalid amounts" error on the CLOB (py-clob-client)

Thematisch verwandte Begriffe: Fixing, Polymarkets, invalid, amounts · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-101003 | A weakness has been identified in Cesanta Mongoose up to 7.21. Affected…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag