wss://solver-relay-v2.chaindefuser.com/ws
Authentication
This endpoint requires a Partner JWT, sent as anAuthorization: Bearer header on the WebSocket handshake request (not X-API-Key, that header is only for the REST RPC endpoint):
subscribe
Subscribe to quote requests or quote status events.string
required
Subscription name:
"quote" or "quote_status"Example request
Example request
Example response
Example response
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.quote_id— Identifier for this auction; include it in yourquote_responsedefuse_asset_identifier_in/defuse_asset_identifier_out— Token pairexact_amount_inorexact_amount_out— Fixed side of the trademin_deadline_ms— Minimum validity time your signed offer should supportmin_wait_ms/max_wait_ms— Auction collection window (see Auction timing)protocol_fee_included— Whentrue, 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
- The auction starts when the relay publishes the quote request.
- From
0 → min_wait_ms, the relay collects responses and does not settle early. - After
min_wait_ms, if any responses have arrived, the relay may close after a short grace period (or immediately for certain whitelisted solvers). - At
max_wait_ms, the auction always closes. - Once closed, the quote is removed. Late
quote_responsecalls fail withquote not found or already finished.
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.
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 uniqueid 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 forexact_amount_inrequestsamount_in- Proposed amount forexact_amount_outrequests
object
required
Signed intent data (same format as
publish_intent)string[]
Optional hashes of other quotes needed to fulfill this intent
Example request
Example request
Example response
Example response
result-"OK"when the quote response is accepted
unsubscribe
Unsubscribe from a subscription.string
required
Subscription ID returned by
subscribeExample request
Example request
Example response
Example response
result-"OK"when unsubscribed successfully