Amounts & Precision
Money is decimal strings, rates are basis points, and every rounding decision is made where you can see it.
Money is a decimal string
Every monetary value in a request or a response is a string in the asset's major units:
{"amount": "100.50", "asset": "usd"}
{"amount": "99.000000", "asset": "usdc"}
Never a float, and never a smallest-unit integer. Two consequences for your code:
- Parse into a decimal type, not a double.
Decimalin Python,BigDecimalin Java, a decimal library in JavaScript. Parsing"0.1"into a float and adding it three times is how reconciliation jobs start disagreeing with the ledger. - Send strings. A JSON number is accepted where the value is unambiguous, but a string is what round-trips exactly.
Trailing zeros in a response carry meaning: they show the asset's
precision. "99.000000" is USDC at its six decimals, not a formatting
accident.
Precision per asset
| Asset | Decimals |
|---|---|
| USDC, USDT, EURC | 6 |
| EURe | 18 |
| Fiat amounts (USD) | 2 |
Decimals are the issuer's, and identical on every chain we deliver the
asset on. Sending a wallet-send amount finer than the asset's decimals
returns 400 invalid_amount rather than rounding it silently. That is
deliberate: we would rather refuse than move a different number than the
one you asked for.
Rates are basis points
Every rate on the platform is in basis points, never percent.
| Value | Means |
|---|---|
"100" | 1% |
"30" | 0.3% |
"1000" | 10%, the maximum for partner_fee_bps |
"0" | No fee |
This applies to partner_fee_bps, corridor bps and spread_bps, and
every plan-level rate. There is no percent field anywhere in the API, so a
value of 1 always means 0.01%, never 1%.
Exchange rates
exchange_rate on a conversion is target per source, before fees,
frozen at execution:
delivered = (source_amount - netted_fees) x exchange_rate
Only fee lines with "collection": "realtime" are netted. Lines with
"collection": "monthly" are metering for your invoice and did not reduce
the delivery. On the standard plan our conversion fee is monthly, so
deliveries go out whole.
The rate on a quote estimate is indicative. The rate on the conversion is the fact of record.
Rounding
- Fee amounts are rounded to the source asset's precision.
- On a target-based quote estimate, the source amount needed is rounded up, so the requested delivery is always achievable.
- The combined partner fee is capped so a delivered amount can never go negative.
- Gas amounts on wallet sends are priced at the native-token rate noted when the send executed, and never re-priced. A token price move before month end is never your FX gain or loss.
Identifiers
Object ids are opaque strings with a documented prefix (cus_, va_,
wop_). Do not parse them, and do not assume a length: store them as
strings of at least 40 characters. The prefix is stable and is the fastest
way to tell in a log which object an id refers to. See
Objects & Terminology for the full list.