Units and Errors
Numeric encodings
| Field | Encoding |
|---|---|
| Quote reserve, scale, amount, fee, allocation, price | Packed decimal Float, carried as ABI int256. |
| Settlement pay amount | Integer token base units. |
| Settlement minimum receive | Integer token base units. |
| Settlement receive allocation | Six decimals; 1_000_000 means 100%. |
| Client allocation WAD, when used | Intermediate 18-decimal fixed point, converted before use. |
Float uses the protocol’s packed numeric encoding. Use the reference conversion helpers, the token’s actual decimals, and integer arithmetic for token-unit balances.
QuoteItem token buckets describe ledger movements. Their direction comes from pay, receive, or fee context; signed value flow is a different field.
Failure conditions
| Error or failure | Check |
|---|---|
InvalidTrade | Empty sides, invalid amounts, or unsupported shape. |
DuplicateToken | Repeated token within a side or across both sides. |
InvalidAllocations | Nonpositive allocations or an incorrect sum. |
InvalidToken | Wrong token role or LP target for the selected pool. |
ZeroReserve / ZeroScale | Incomplete or invalid active state. |
InvalidElasticity | Parameter outside 0 <= e_s < 1. |
InvalidLiquidityAction | Nonproportional inputs or inadmissible LP action. |
NoSolution / DidNotConverge | Numerical quote calculation failed. |
| Minimum receive failure | Current output falls below the selected minimum. |
| Native value failure | Attached value differs from the expected native pay amount. |
IntentExpired / InvalidIntentNonce | Deadline passed or submitted nonce differs from the current nonce. |
Use revert data from the ABI installed on the Dispatcher. Surface invalid or unavailable quote values as errors.
Before submission
Match the chain, Dispatcher, pool, token roles, decimals, ABI version, array ordering, allowances, native value, and receive minimums. Use current pool state and simulate the assembled call when available.