hypercall_api/rfq/
qp_ws_state.rs1use crate::boundary::market_inputs::InstrumentsCacheReader;
2use crate::rfq::indicative_quote_cache::IndicativeQuoteCache;
3use crate::rfq::qp_sessions::QpSessionManager;
4use crate::rfq::quote_provider_cache::QuoteProviderCache;
5use crate::rfq::rfq_manager::RfqManager;
6use hypercall_runtime_api::NonceCheckRequest;
7use hypercall_types::ws_protocol::{WsIndicativeMarketData, WsMessage, WsRfqQuotes};
8use std::sync::Arc;
9use tokio::sync::mpsc;
10
11pub trait RfqWebsocketPublisher: Send + Sync {
13 fn publish_indicative_market_data(&self, update: WsIndicativeMarketData);
14 fn publish_rfq_quotes(&self, quotes: WsRfqQuotes);
15 fn publish_to_channel(&self, channel: &str, message: WsMessage);
16}
17
18#[derive(Clone)]
20pub struct QpWsState {
21 pub qp_cache: Arc<QuoteProviderCache>,
22 pub indicative_cache: Arc<IndicativeQuoteCache>,
23 pub instruments_cache: Arc<dyn InstrumentsCacheReader>,
24 pub session_manager: Arc<QpSessionManager>,
25 pub rfq_manager: Option<Arc<RfqManager>>,
26 pub nonce_check_sender: mpsc::Sender<NonceCheckRequest>,
29 pub pubsub: Option<Arc<dyn RfqWebsocketPublisher>>,
31 pub signing_chain_id: u64,
32 pub gateway_resume_token: Option<String>,
35}