Skip to main content

Module rfq_v2

Module rfq_v2 

Source
Expand description

Typed low-level client for the RFQ V2 HTTP contract (/private/rfqs*).

Callers supply complete signed payloads. crate::rfq_v2_signing builds and signs them with a crate::HypercallWallet; remote signers and non-Rust implementations sign the same EIP-712 messages and use the same transport.

§Availability

Compiled with the rfq-v2 cargo feature, on by default since 0.3.0. RFQ V2 is open to every account in production from October 16, 2026.

A non-production environment can run RFQ V2 in two other modes. Disabled, it refuses every RFQ V2 request, including private reads and AuthenticateRfqV2 socket authentication, with HTTP 403 and error code rfq_v2_disabled. Over HTTP that surfaces as ClientError::RfqV2Api with status: 403 and that code; on the socket, crate::WsClient::connect_rfq_v2 fails. Allowlist-only, it answers 403 rfq_v2_not_allowlisted to accounts not on the list.

§Operation IDs

Every client-chosen operation ID must be a UUIDv7 whose embedded timestamp, measured against the server clock, is at most one hour old and at most 30 seconds in the future. Any other ID is refused with HTTP 400 rfq_v2_invalid_operation_id. Mint a fresh Uuid::now_v7() for each new operation, and reuse an ID only to retry the identical signed request while it is still inside that window.

Structs§

RfqV2BestQuoteCriteria
Exact parent and size constraints for deterministic local quote selection.
RfqV2ParentUnitGrid
Leg sizes are whole micro-units of a contract held in a u64. A fill of units package units is units * quantity_micros_per_unit / 1e6 contract micro-units on each leg, and an execution is refused when any leg’s quantity is fractional or exceeds u64.
RfqV2ReadCredentials
Caller-provided read session for role-filtered private RFQ data.

Enums§

RfqV2BestQuoteError

Functions§

encode_rfq_v2_read_grant
Encode a signed private-read grant as a bearer token. The grant must be EIP-712 signed for AuthorizeRfqReadV2 under the Hypercall domain.
select_best_rfq_v2_quote
Select the best eligible firm quote. Selection is local and executes nothing.