Skip to main content
NEAR Intents exposes a WebSocket endpoint for market makers (solvers) to receive and respond to quote requests in real-time. Endpoint: wss://solver-relay-v2.chaindefuser.com/ws

Authentication

This endpoint requires a Partner JWT, sent as an Authorization: Bearer header on the WebSocket handshake request (not X-API-Key, that header is only for the REST RPC endpoint):
To obtain a Partner JWT, register through the Partner Portal.

subscribe

Subscribe to quote requests or quote status events.
string
required
Subscription name: "quote" or "quote_status"
Response fields:
  • result - Subscription ID used for receiving events and unsubscribing

quote events

After subscribing to "quote", you’ll receive events like this:
Event
Only one of exact_amount_in or exact_amount_out will be specified in each request.
Event fields:
  • quote_id — Identifier for this auction; include it in your quote_response
  • defuse_asset_identifier_in / defuse_asset_identifier_out — Token pair
  • exact_amount_in or exact_amount_out — Fixed side of the trade
  • min_deadline_ms — Minimum validity time your signed offer should support
  • min_wait_ms / max_wait_ms — Auction collection window (see Auction timing)
  • protocol_fee_included — When true, this is typically a router sub-leg auction with a shorter accept window

Auction timing (min_wait_ms / max_wait_ms)

Each quote request opens a short auction on the relay. You do not set these fields when responding — they are chosen by the quote requester (or by the router for multi-hop sub-legs) and appear on the inbound event. Timeline
  1. The auction starts when the relay publishes the quote request.
  2. From 0 → min_wait_ms, the relay collects responses and does not settle early.
  3. After min_wait_ms, if any responses have arrived, the relay may close after a short grace period (or immediately for certain whitelisted solvers).
  4. At max_wait_ms, the auction always closes.
  5. Once closed, the quote is removed. Late quote_response calls fail with quote not found or already finished.
Effective windows solvers see max_wait_ms is still the upper bound in both cases. When responses arrive quickly, the auction often ends around min_wait_ms + grace, not only at max_wait_ms.
Router FastQuote legs (protocol_fee_included: true, min_wait_ms: 1) require end-to-end response latency well under ~50ms. A ~50ms WebSocket round trip is enough to miss the window even if your handler itself finishes in under 1ms.

quote_status events

After subscribing to "quote_status", you’ll receive settlement notifications:
Event
quote_status events published while your connection is down are lost by default. To recover missed events after a disconnect, opt into Guaranteed Delivery.

quote_response

Respond to a quote request with a signed intent. A unique id is required in the JSON-RPC message.
signed_data is produced by signing your token_diff intent with the NEAR key you registered on the Verifier contract, it’s not something you construct by hand. See the Example Solver for the real signing code, and publish_intent for the exact signed_data shape.
string
required
Quote request identifier from the event
object
required
  • amount_out - Proposed amount for exact_amount_in requests
  • amount_in - Proposed amount for exact_amount_out requests
object
required
Signed intent data (same format as publish_intent)
string[]
Optional hashes of other quotes needed to fulfill this intent
Response fields:
  • result - "OK" when the quote response is accepted

unsubscribe

Unsubscribe from a subscription.
string
required
Subscription ID returned by subscribe
Response fields:
  • result - "OK" when unsubscribed successfully