Skip to main content
A fee set on your key is only paid on swaps RAVN can prove. Two duties decide that, and both are yours: pay the fee an execution asks for, and report the swap to /status until it is final. Skip either one and the swap still fills for your user, but nothing is owed to you on it. Run through this list once per integration, and again whenever you add a chain or wallet type.
1

Read fee on every execution

Your fee only applies to calls that send your key as x-api-key: a keyless quote carries none. /execute adds a fee object only when your key sets a fee and the route has no fee mechanism of its own, so RAVN collects yours beside the swap:Every other route takes your fee inside the swap itself, so there is nothing extra to pay, but step 3 still decides whether you get paid. Never build the fee payment yourself: pay exactly what fee says.
2

Pay it the way its chain needs

The table is the short form of Fees paid beside the swap.
3

Report it on every status poll

Every /status call takes three things:
  • quoteToken: the one /execute returned, never the one from /quote. A two-hop route is rebound at execute.
  • ref: the statusRef from /execute when it has one; on SIGNATURE, the statusRef from /submit-signature; otherwise the hash of the swap transaction you broadcast (with submit, the txHash /submit-transaction returned).
  • txHash: the on-chain hash of the transaction that carried fee.transaction, whether its own or the batch’s (never an EIP-5792 batch id or a 4337 userOpHash). On a two-hop route (venue.id is compose) with no fee transaction, the hop-1 transaction’s hash. Not needed when the fee rode in the swap’s own transaction and that hash is already your ref, or when the fee went inside a Bitcoin or Solana deposit: RAVN finds it there.
txHash takes an EVM hash only (0x and 64 hex characters): /status answers 400 INVALID_REQUEST to anything else, a Solana signature included, on every poll. A two-hop route whose hop 1 is on Solana or Bitcoin needs none: RAVN looks for hop 1 itself.Simplest: send txHash on every poll, from the first one. RAVN stops waiting for a fee a day after /execute; a fee reported later earns nothing.
4

Poll until the status is final

This step matters even when the execution has no fee. On every TRANSACTION without a statusRef, RAVN only learns the swap’s hash from your status poll, and on same-chain venues (0x Swap, 0x Solana, Nordstern, Fly Trade, KyberSwap, OKX DEX, Jupiter, Mayan same-chain) it checks that transaction on-chain before the swap counts. A swap you never report never becomes payable. See Settlement.
On JS/TS, executeAndTrack (@ravnexchange/sdk 0.2.0) does steps 2 to 4 for TRANSACTION and SIGNATURE: give it a waitForReceipt that returns the receipt, or it sends no fee. It polls through expired and not_found, retries a failed status call, and once anything is sent rejects only with an ExecuteAndTrackError whose partial holds every hash; persist them from onProgress so a crash never loses a swap. On a DEPOSIT it sends nothing: it returns feePayment (what to pay, see depositFeePayment) and statusRef; you send the deposit and the fee, then poll getStatus(quoteToken, statusRef, feeTxHash) yourself, retrying a failed call. 0.1.15 stopped polling at expired and not_found and lost the hashes on one failed status call: upgrade.
The Quickstart code does all four steps for an EVM wallet. Webhooks are no substitute for step 4: they fire only for swaps RAVN’s own backstop settles, best-effort and never retried. See Webhooks.