Priority update API
Endpoints
Priority updates are submitted over WebSocket on the same hosts as the JSON-RPC endpoints (see BuilderNet endpoints) at the path /ws/sendquoteupdate, e.g. wss://rpc.buildernet.org/ws/sendquoteupdate.
Request
Messages are protobuf-encoded:
message PWebsocketQuoteUpdateV1Args {
bytes tx = 1; // RLP-encoded quote tx (empty for cancellation)
uint64 block_number = 2; // Target block
bytes replacement_uuid = 3; // 16-byte quote identifier
uint64 replacement_seq_number = 4; // Monotonic sequence (>0)
bool disable_cross_region_sharing = 5;
// Optional PropAMM metadata.
// Pairs affected by this update. Each entry is 40 bytes: token0 || token1.
repeated bytes asset_pairs = 6;
// 20-byte address a taker must touch to receive a quote.
bytes quote_address = 7;
// Pool addresses whose swaps require this update. Each entry is 20 bytes.
repeated bytes pool_addresses = 8;
}
Replacement and cancellation:
- Replace: send a new message with the same
block_numberandreplacement_uuid, and a higherreplacement_seq_number. - Cancel: same as replace, but with an empty
tx.
Response
message PWebsocketQuoteUpdateV1Response {
bytes replacement_uuid = 1;
uint64 replacement_seq_number = 2;
uint64 timestamp = 3; // RPC receive time (UNIX nanos)
string error = 4; // Error details on failure
}
Errors
When BuilderNet rejects an update on receipt, the error field of the response gives the reason. An empty error means that BuilderNet received the update, not that the update will land.
error | Cause |
|---|---|
invalid replacement uuid: ... | replacement_uuid is not 16 bytes. |
asset_pairs entries must be exactly 40 bytes, quote_address must be empty or exactly 20 bytes, pool_addresses entries must be exactly 20 bytes | An optional field has the wrong length. |
recipient not allowed | The transaction calls a contract that is not registered for your key. Tell us before you change contracts. |
selector not allowed | The transaction calls a function that is not registered for your key. |
rate limited | You send updates faster than BuilderNet accepts them. |
internal error, Disk full | A fault on our side. Send the update again. |
An update that an orderflow rule rejects returns the rule's message in error, if the rule has one.
Authentication
Set the API key in the Authorization header when establishing the WebSocket connection, as Bearer <key> or as the key alone. Send each request as one binary WebSocket message. Each response is also one binary message.
BuilderNet refuses the connection with HTTP status 401 and the text missing or malformed Authorization header if the header is absent, or unknown api key if it does not know the key.
Submission best practices
- Use one
replacement_uuidper quoted instrument and increasereplacement_seq_numbermonotonically. The builder keeps only the highest sequence number for each uuid, so refresh a quote by replacing it rather than creating a new uuid. - Target the next block in
block_numberand resend on each new head. Updates for past blocks are dropped. - The builder drops an update 1 second after BuilderNet first receives it. To keep a quote live, send a new update before then. If your updater stops, your quotes expire within 1 second.