Skip to main content

Module rfq

Module rfq 

Source
Expand description

High-level RFQ quote builder for Quote Providers.

Constructs valid, signed RfqResponse messages from an inbound RfqRequest and per-leg prices. The builder enforces the public RFQ response constraints so invalid quotes are caught client-side instead of being rejected later.

§Example

use hypercall_client::{HypercallWallet, rfq};
use hypercall_client::qp_client::ServerInbound;
use rust_decimal_macros::dec;

let wallet = HypercallWallet::from_private_key("0x...", 999)?;

// When you receive an RfqRequest from the server:
// let msg: ServerInbound = ...;
// if let ServerInbound::RfqRequest { rfq_id, legs, .. } = msg {
//     let quote = rfq::build_rfq_quote(&rfq_id, &legs, &[dec!(0.05)], 3000, &wallet).await?;
//     outbound_tx.send(quote).await?;
// }

Functions§

build_rfq_decline
Build a decline response for an RFQ.
build_rfq_quote
Build a signed RFQ quote response from an inbound RFQ request.