Skip to main content

Quote

Struct Quote 

Source
pub struct Quote { /* private fields */ }
Expand description

The solver’s response for a single order.

Implementations§

Source§

impl Quote

Source

pub fn order_id(&self) -> &str

The server-assigned order ID (UUID v4).

Source

pub fn status(&self) -> QuoteStatus

Whether the solver found a valid route for this order.

Source

pub fn backend(&self) -> BackendKind

Which backend produced this quote.

Source

pub fn route(&self) -> Option<&Route>

The route to execute, if status is QuoteStatus::Success.

Source

pub fn amount_in(&self) -> &BigUint

The amount of token_in the solver expects to consume (token units).

Source

pub fn amount_out(&self) -> &BigUint

The expected amount of token_out received after executing the route (token units).

Source

pub fn gas_estimate(&self) -> &BigUint

Estimated gas units required to execute the entire route.

Source

pub fn amount_out_net_gas(&self) -> &BigUint

Amount out minus estimated gas cost, expressed in output token units.

Computed server-side using the current gas price and the quote’s implied exchange rate. This is the primary metric the solver uses to rank routes.

Source

pub fn price_impact_bps(&self) -> Option<i32>

Price impact in basis points (1 bps = 0.01%). May be None for quotes without a route.

Source

pub fn block(&self) -> &BlockInfo

The Ethereum block at which this quote was computed.

Source

pub fn token_out(&self) -> &Bytes

The token_out address from the originating Order (20 raw bytes).

Populated by FyndClient::quote and used by FyndClient::execute_swap to parse the settlement log.

Source

pub fn receiver(&self) -> &Bytes

The receiver address from the originating Order (20 raw bytes).

Defaults to sender when the order had no explicit receiver. Populated by FyndClient::quote and used by FyndClient::execute_swap to verify the Transfer log recipient.

Source

pub fn transaction(&self) -> Option<&Transaction>

The server-encoded on-chain transaction, present when EncodingOptions was set.

Contains the router contract address, native value, and ABI-encoded calldata ready to submit. Returns None when no EncodingOptions were passed in the request.

Source

pub fn fee_breakdown(&self) -> Option<&FeeBreakdown>

Fee breakdown, present when EncodingOptions was set in the request.

Contains router fee, client fee, max slippage, and the minimum amount the user will receive on-chain (the value used as min_amount_out in the transaction).

Source

pub fn solve_time_ms(&self) -> u64

Wall-clock time the server spent solving this request, in milliseconds.

Populated by FyndClient::quote. Returns 0 if not set.

Trait Implementations§

Source§

impl Clone for Quote

Source§

fn clone(&self) -> Quote

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Quote

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Quote

§

impl RefUnwindSafe for Quote

§

impl Send for Quote

§

impl Sync for Quote

§

impl Unpin for Quote

§

impl UnsafeUnpin for Quote

§

impl UnwindSafe for Quote

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more