Skip to main content
RAVN posts to your URL when a swap made with your key settles, is refunded or fails. A webhook tells you a swap is final. It doesn’t report the swap to RAVN, so keep polling /status too.

Register a URL

Set an https:// URL with your secret key:
webhookSecret signs every delivery. It stays the same when you change the URL, and every registration returns it. Enterprise keys don’t support webhooks yet.

The payload

  • event: swap.settled, swap.refunded or swap.failed. Each swap gets one.
  • swapId: the swapId /execute returned. requestId is the same value.
  • deliveredOut and slippageBps can be null when the venue doesn’t report them.
  • ts: delivery time, epoch milliseconds.

Delivery

  • Any 2xx within 5 seconds counts as delivered. Otherwise it’s retried 5, 20, 45, 80 minutes later and so on, for a day, then dropped.
  • It can arrive twice. Deduplicate on swapId and event.
  • Webhooks come from a job that runs about every 5 minutes, so they lag /status by up to that. A swap whose fee RAVN is still confirming can take up to a day.

Verify the signature

Each request carries x-ravn-signature: sha256=<hex>, an HMAC-SHA256 of the raw body with your webhookSecret. Check it against the raw bytes, before parsing.