Contract behavior
PoolStatehas noscale0orscale1.- The program has no
token_decimalsmapping orset_token_decimalsfunction. - Desired amounts, minimums, swap amounts, refunds, owed balances, and protocol fees use native base units.
- The contract does not require high-decimal token inputs to be divisible by an AMM scale.
Display conversion
The deployment registry and API token metadata hold display decimals. A client converts only at its display and input boundary:Price display
The on-chain square-root price represents a ratio of native base units. A human token1-per-token0 quote must account for canonical token order and the difference in display decimals. Keep these concepts separate:- Contract amount: exact native base units.
- Contract price: Q128.128 square-root ratio of base units.
- Display amount: decimal-formatted base units.
- Display price: base-unit ratio adjusted for token decimals and display order.
Wrapped assets
The registry distinguishes the AMM token program from the underlying record program. ALEO uses wrapped credits. USAD and USDCx use ARC-22 wrappers. Router input record amounts can therefore useu64 or u128, while the core AMM amount fields remain u128.