tycho_simulation/rfq/
client.rs

1use async_trait::async_trait;
2use futures::stream::BoxStream;
3use tycho_client::feed::synchronizer::StateSyncMessage;
4use tycho_common::{
5    models::protocol::GetAmountOutParams, simulation::indicatively_priced::SignedQuote,
6};
7
8use crate::rfq::{errors::RFQError, models::TimestampHeader};
9
10#[async_trait]
11pub trait RFQClient: Send + Sync {
12    /// Returns a stream of updates tagged with the provider name.
13    fn stream(
14        &self,
15    ) -> BoxStream<'static, Result<(String, StateSyncMessage<TimestampHeader>), RFQError>>;
16
17    // This method is responsible for fetching the binding quote from the RFQ API. Use sender and
18    // receiver from GetAmountOutParams to ask for the quote
19    async fn request_binding_quote(
20        &self,
21        params: &GetAmountOutParams,
22    ) -> Result<SignedQuote, RFQError>;
23}