/quote/build instead and skip this page.
The full contract reference is in Aggregator v3.
1. Import the client
The WASM on chain is the interface. Fetch it once and import it:contractimport! generates aggregator::Client and every wire type (Route, Hop, SoroswapHop, AquaHop, SushiHop, CometHop, PhoenixHop, Partner).
2. Build the routes
A route names the pools, in order, that taketoken_in to token_out, like the single-pool example below.
The route amounts must add up to amount_in - fee, with fee = floor(amount_in * bps / 10000).
3. Authorize the token pull, then call
The aggregator pullstoken_in from user with transfer. When user is your contract, that transfer happens one call below your own, so your contract must authorize it explicitly:
delivered is credited to me. Forward it wherever your contract needs it.
Example: USDC to deJTRSY through a SushiSwap V3 pool
This contract was deployed and run on mainnet on 2026-10-08:
The swap delivered 0.4865 deJTRSY to the contract. See the transaction.
The same swap from an account, with the user signing (no
authorize_as_current_contract needed), in both directions:
USDC → deJTRSY and
deJTRSY → USDC.
Checklist
- Call
CARVQXFP4JF5ELLXUMQ6DALR346YVGBMQOHB4ENA7SSVXAYABXLBDDC4, not the deprecatedCAYP3U…aggregator. - Make the route amounts add up to
amount_in - fee, with the samepartnerthe quote was priced with. - Set
zero_for_one = (token_in == pool.token0())on every Sushi hop. - Sort each Aquarius step’s token set by
Addressorder, not string order. - When
useris a contract, authorizetoken_in.transfer(user, aggregator, amount_in). - Set
min_outfrom your own slippage tolerance. It is the only price guarantee: the aggregator calls each venue with no real per-hop minimum (0 or 1, or none for SushiSwap and Phoenix) and checks only the total at the end.