POST /v1/execute response, and asynchronously via webhook callback. Use webhooks to drive downstream processing without polling.
Webhook setup
Provide your webhook endpoint URL during onboarding. Ratio sends HTTP POST requests to this URL when events occur.
Your webhook endpoint must:
- Accept
POSTrequests withContent-Type: application/json - Return HTTP
200within 5 seconds to acknowledge receipt - Be idempotent — the same event may be delivered more than once
Webhook events
settlement.confirmed
Fired when a swap settles on-chain. Includes full execution details.
settlement.failed
Fired when a swap execution fails. This is rare and typically caused by an on-chain revert.
quote.expired
Fired when a firm quote expires without being executed. Reserved inventory is released.
system.state_change
Fired when a corridor’s operating state changes (for example, from NORMAL to PROTECT).
Event types summary
Signature verification
Every webhook request includes a signature header:- Compute HMAC-SHA256 of the raw request body using your webhook secret.
- Compare the computed digest with the value in the
X-Ratio-Signatureheader. - Reject the request if the signatures do not match.
Retry policy
If your endpoint does not return HTTP200 within 5 seconds, Ratio retries with exponential backoff:
After 5 failed attempts, the webhook is marked as failed. You can query settlement status directly via
GET /v1/system/state as a fallback.
Best practices
- Verify the signature on every incoming request before processing the payload.
- Make your handler idempotent. The same event may be delivered more than once due to retries.
- Return
200immediately, then process the event asynchronously to avoid triggering retries from slow processing. - Log the
execution_idfrom everysettlement.confirmedevent for reconciliation and support escalation.