Skip to main content

Overview

Monetary amounts in the Trace Finance API are represented as decimal strings in the asset’s canonical scale, paired with an ISO 4217 currency code or stablecoin ticker. This single shape works uniformly for fiat (2 decimals) and stablecoins (6 decimals).
Always parse amounts with a decimal-precision library (BigDecimal, decimal.Decimal, Decimal.js). Never use JavaScript Number or any 64-bit float — values like 0.1 + 0.2 lose precision, and high-decimal tokens overflow the safe-integer range.

How it works

Amount object

Every amount in a response uses the same structure:

In request bodies

Quote and operation requests take amounts as a decimal-string scalar paired with a separate asset field — not the full object:
The number of fractional digits must not exceed the asset’s precision (table below). Exceeding it returns AMOUNT_PRECISION_EXCEEDED.

Rates

A quote returns its effectiveRate as an integer value and a decimals scale: the rate is value divided by 10 to the power of decimals, so { "value": 200000, "decimals": 6 } is 0.200000. An operation returns its rate as a decimal string, such as "0.20". Parse both with a decimal-precision library.

Decimal precision per asset

Examples

A deposit of R$ 1.250,00:
A withdrawal of 500 USDT: