Streaming

The Cross-Chain API supports streaming of swap quotes using Server-Sent Events (SSE). Quotes are delivered progressively as they’re discovered, so users can act on them immediately.

Why Streaming?

  • ⚡ Faster first quote — get actionable quotes faster

  • 🔄 Progressive discovery — quotes stream in as they’re found, no blocking waits

  • 🛠️ Immediately executable — every quote includes full transaction details

  • 🎯 Better UX — show users the first good option instead of making them wait

Endpoint

GET /cross-chain/quotes/stream

Streams cross-chain swap quotes as SSE events. Each quote is delivered as a standalone event with everything needed for execution.

Same params as /cross-chain/quotes, except:

  • No sortQuotesBy - Quotes stream in discovery order always

What You Get

Server-Sent Events with these message types:

  • Quote Found

data: {
    "event": {
      "type": "quote",
      "data": {
        "quote": { /* full quote object */ },
        "allowanceTarget": "0x000..."
      }
    },
    "zid": "0xbed7b45844099af94219ba8c"
}
  • Stream Done

  • Error (if stream fails)

Client Example

Find nextjs streaming example herearrow-up-right.

Last updated