Contract basics
Five fixed-point conventions run across three API lines — half of them JSON integers, half strings. Code written against the wrong line does not fail — it simply computes the wrong number. This page gives the mapping first, then the places where it fails silently.
| Line | Prefix | Auth | Price / size | Outcome |
|---|---|---|---|---|
| Trading API | /api/v1 | Bearer session | price E4 · size E2 · amount E6 (integers) | YES | NO |
| PX Discovery & Account | /api/v1/px | Public reads / Bearer session | E6 decimal strings throughout | A | B |
| Market Maker API | /v1/px | pxk_ API key | E6 decimal strings throughout | A | B |
The three prefixes differ by one segment, the precision differs by 100×, and even the enum spelling differs. Every endpoint page carries this marker in its endpoint bar so you can always tell which line you are on.
| Unit | Meaning | Example | JSON type |
|---|---|---|---|
E4 | 1e-4 USD. Prices on the Trading API | 5200 = 0.5200 USD | integer |
E2 | 1e-2 shares. Sizes on the Trading API | 1000 = 10.00 shares | integer |
E6 | 1e-6 USD or 1e-6 shares. Amounts on the Trading API, and every price, size and amount on both PX lines | 520000 = 0.520000 | integer on the Trading API, string on both PX lines |
ppm | Parts per million. Fee rates | 2000 ppm = 0.2% | integer |
bps | Basis points. Health, interest rates, margin rates, return on equity | 1500 bps = 15% | string |
Fee rates in ppm and the tiered limits are on Limits & fees; runtime behaviour of matching and settlement is on Runtime behaviour.