Build multi-hop calldata

Use this when your quote contains a non-empty multihop array and a path with 3+ tokens.

Endpoint POST /public/emigroswap/buildTransaction

Request (key differences vs single-hop)

  • Include the exact path from the quote.

  • Include multihop with per-hop params from the quote (e.g., feeTier or spacing).

  • Keep using amountOut and minAmountIn from the quote (RAW values).

Sample request (Slipstream multi-hop)

{
  "fromTokenAddress": "0x60a3e35cc302bfa44cb288bc5a4f316fdb1adb42",
  "toTokenAddress":   "0xE9185Ee218cae427aF7B9764A011bb89FeA761B4",
  "chainId": 8453,
  "userWallet": "0x000000000000000000000000000000000000dEaD",
  "amountOut": "100000000",
  "minAmountIn": "618042428770765345237",
  "routerType": "aerodrome-slipstream",
  "path": [
    "0x60a3e35cc302bfa44cb288bc5a4f316fdb1adb42",
    "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "0xE9185Ee218cae427aF7B9764A011bb89FeA761B4"
  ],
  "multihop": [
    { "fromTokenAddress": "0x60a3e35...", "toTokenAddress": "0x833589fC...", "feeTier": 50 },
    { "fromTokenAddress": "0x833589fC...", "toTokenAddress": "0xE9185Ee2...", "feeTier": 10 }
  ]
}

Response (shape)

Per-router adapterData encoding

  • Slipstream (Aerodrome V2 concentrated): abi.encode(int24[] tickSpacings, uint256 deadlineOrFlags) – the builder derives tickSpacings from multihop or uses safe fallbacks.

  • Uniswap V3 (path-based): abi.encode(uint24[] feeTiers, uint256 deadlineOrFlags).

As with single-hop, execute the tx using the returned routerAddress, abiFunctionSignature, and abiParameters without modification.

Last updated