Skip to main content
/execute answers with one executionType. Your code branches on that one field. Every answer carries a quoteToken. Use that one, not the one from /quote, for /submit-signature, /submit-transaction and /status.
On JavaScript or TypeScript, executeAndTrack handles all of this for you, on every chain.

TRANSACTION

On an EVM chain, send calls in order, each once the one before it has succeeded, and stop if one reverts. (In the rare case calls is missing, send the same fields in that order yourself.) calls is everything to send, already in order: approval.reset, approval, the swap (transaction), then your fee (fee.transaction) when one applies.
  • Send the swap with transaction.gasLimit as its gas limit when it’s set (viem: gas: BigInt(gasLimit)).
  • When batch is true, you may send all of calls in one atomic wallet batch (EIP-5792 wallet_sendCalls) instead. Simulate the batch first and fall back to one by one if it fails.
On Solana (chainId: -2), transaction.serialized is a base64 versioned transaction. Sign it and send it from the user’s own wallet, with confirmed commitment. Any fee is already inside it. With submit. Only on quotes sent with broadcastViaRavn: true. Don’t broadcast it: sign transaction.serialized and post it to /submit-transaction.

SIGNATURE

  1. Send approval (and approval.reset first, when present) and wait for it to be mined. Gasless orders still pull the tokens through an allowance: without it the order is accepted and then silently never fills.
  2. Sign typedData. When approvalData is present, sign it too.
  3. Post both signatures to /submit-signature. It returns the statusRef to poll with.

DEPOSIT

Send exactly deposit.amount of the quote’s input token to deposit.address. Ready-made versions come with the answer: No approval is needed. When deposit.expiresAt is set, send the deposit right away and never after that time: some routes need it to have arrived by then. Send a native-coin deposit from a regular wallet, not from a smart contract: some venues don’t credit coin a contract moves. You can also show the address and a QR code and let the user send it from any wallet. That’s how native Bitcoin is usually paid.

Approvals

approval is a ready-to-send ERC-20 approve(spender, amount), sent to the token contract.
  • Wait for it to be mined before the swap. Otherwise the swap reverts and the user pays gas for nothing.
  • RAVN leaves it out when the user’s allowance already covers the swap. When RAVN couldn’t read the allowance it’s included anyway; skip it if your own read shows enough.
  • That read sees only mined transactions. Run one swap per token and spender at a time: a second swap started while the first is pending can come back without the approval it needs.
  • approval.reset appears for tokens like Ethereum USDT that can’t change one non-zero allowance to another. Send it first.
  • The spender is approval.spender. Don’t assume it’s transaction.to.
  • unlimitedRecommended: true means the venue would rather you approve once for a large amount. data still approves the exact amount; raising it is your call.

AUTHORIZE steps (Hinkal)

A fourth type, only for Hinkal private swaps you opt into with authorizeSteps: true. The paying wallet signs twice before the TRANSACTION comes. See Private swaps.