Parameters
| Param | Type | Meaning |
|---|---|---|
| zeroForOne | bool | true = sell token0, buy token1; false = the reverse. |
| amountIn | uint256 | Exact input amount, in the input token’s smallest units. |
| returns | uint256 | Output amount you would deliver now, in smallest units of the output token. |
Requirements
- View and read-only. getAmountOut must not write state.
- Exact-in only. There is no exact-out path today.
- Unsupported sizes. For an amountIn or pair you cannot fill, return 0 or revert. Do not return a price you will not honor.
- Self-consistent with settlement. The price getAmountOut returns is what Rialto routes on. Occasional slips from volatility between quote and settle are expected, but quotes and swaps should generally agree. Quote your currently executable price; if it is oracle-driven, quote from the same oracle you settle against.
- Gas. Rialto assigns your leg a gas estimate when ranking routes net of gas, calibrated from observed usage at roughly p90 plus 10% headroom. Give a realistic gas figure for your swapExactIn; an unrealistically cheap estimate makes your route look better than it settles.
