Skip to main content

When you need an adapter

If your AMM already exposes different function names or argument orders, do not just rename functions and assume it works, because the settle selector is allowlisted onchain and the router patches the input amount at a fixed calldata offset that assumes amountIn is the second argument of swapExactIn. A different layout moves that offset. The clean path is a thin adapter contract that exposes exactly getAmountOut and swapExactIn and forwards to your AMM, roughly 30 lines. If adapters are a dealbreaker across several pairs, talk to Rialto; the selectors and the input-amount offset can be made configurable per pool on Rialto’s side instead.

Adapter skeleton