Skip to main content

What you implement

Deploy one contract per token pair implementing the standard Rialto propAMM interface: a getAmountOut quote and a swapExactIn settle. Rialto calls them by their 4-byte selector, so match these signatures, or put a thin adapter in front if your AMM already exposes different ones. token0() and token1() are optional; Rialto never calls them, since the pair and ordering come from Rialto’s config.
getAmountOut is sampled at quote time; swapExactIn settles. The trade direction zeroForOne is fixed by Rialto’s config ordering, not by token0() or token1(): zeroForOne = true means sell config-token0 and buy config-token1.

Why the shape matters

The interface is a convention Rialto standardizes on, not a protocol constraint, but two things are coupled to the exact shape:
  • The settle selector is allowlisted onchain per pool, and the router patches the real input amount into the calldata at a fixed offset that assumes swapExactIn(bool, uint256 amountIn, …) with amountIn as the second argument. A different argument layout moves that offset.
  • The quote and settle selectors are currently a single shared interface across all propAMM pools.
payable is part of the standard signature so native-ETH pairs are possible.