Skip to main content
Four calls, always the same order: quote → execute → complete → status.
1

Get a quote

Price the swap. You get back the best route across every venue plus an opaque quoteToken.
curl -s -X POST https://app.ravn.exchange/api/v1/quote \
  -H 'content-type: application/json' -d '{
    "inputChainId": 1,
    "outputChainId": -2,
    "inputToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "outputToken": "So11111111111111111111111111111111111111112",
    "inputAmount": "1000000000000000000",
    "userAddress": "0xYourUser",
    "destinationAddress": "SoYourUser"
  }'
2

Execute

Hand the quoteToken back. RAVN returns how to complete the swap, tagged by executionType.
curl -s -X POST https://app.ravn.exchange/api/v1/execute \
  -H 'content-type: application/json' \
  -d '{ "quoteToken": "<from step 1>" }'
# → { "executionType": "DEPOSIT", "deposit": { "address": "...", "amount": "..." }, "statusRef": "..." }
3

Complete it

Branch on executionType — the entire client-side contract:
switch (res.data.executionType) {
  case "TRANSACTION": await wallet.sendTransaction(res.data.transaction); break;
  case "SIGNATURE":   { const sig = await wallet.signTypedData(res.data.typedData);
                        await submitSignature(quoteToken, sig); } break;
  case "DEPOSIT":     await wallet.send(res.data.deposit.address, res.data.deposit.amount); break;
}
4

Track it

Poll status with the statusRef (from execute) or the statusRef from submit-signature.
curl -s "https://app.ravn.exchange/api/v1/status?quoteToken=<token>&ref=<statusRef>"
# → { "status": "pending" | "processing" | "success" | "refunded" | "failed" }
Amounts are strings in the token’s smallest unit. Native coin uses the sentinel 0xEeee…EEeE. The quoteToken is opaque — never parse it; it expires, so re-quote if stale.