Skip to main content
Four calls, always in the same order: quote, execute, complete, then status. Every call below works as-is with no API key. But get a free key first if you can, it takes 30 seconds, quadruples your rate limit, and gets your project on RAVN’s radar.
1

Get a quote

Price the swap. You get back the best route across every venue plus an opaque quoteToken.
2

Execute

Hand the quoteToken back. RAVN returns how to complete the swap, tagged by executionType.
3

Complete it

Branch on executionType. This is the entire client-side contract.
Skipping the approval wait is the most common integration failure. The swap spends your tokens via transferFrom, so if the allowance is not yet mined it reverts and the user loses the gas. Wait for the receipt, not just the broadcast. Native-coin sells and already-approved tokens omit approval entirely.It appears on SIGNATURE too: gasless venues still pull tokens via transferFrom, and skipping it there is quieter and worse: the order is accepted and never fills, with no error. See Execution types.
4

Track it

Poll status with the statusRef from execute, or the statusRef from submit-signature.
Amounts are strings in the token’s smallest unit. Native coin uses the sentinel 0xEeee...EEeE. The quoteToken is opaque, so never parse it. It expires, so re-quote if it goes stale.