Documentation
    Preparing search index...

    Quote information for a swap operation

    This type contains all the information needed to execute a swap, including available routes, amounts, and token details.

    type Quote = {
        amount_in: string;
        amount_out: string;
        dexList: Dex[];
        from: string;
        from_token?: { address: string; decimals: number; price: number };
        is_accurate?: boolean;
        routes: any[];
        target: string;
        to_token?: { address: string; decimals: number; price: number };
        trace_id?: string;
    }
    Index

    Properties

    amount_in: string

    Input amount for the swap

    amount_out: string

    Output amount from the swap

    dexList: Dex[]

    List of DEXes used in the routes

    from: string

    Source token address

    from_token?: { address: string; decimals: number; price: number }

    Source token information

    Type declaration

    • address: string

      Token contract address

    • decimals: number

      Token decimal places

    • price: number

      Current token price

    is_accurate?: boolean

    Whether the quote has passed the dry run. If false, the quote is strongly recommended to be discarded.

    routes: any[]

    Available swap routes from different DEXes

    target: string

    Target token address

    to_token?: { address: string; decimals: number; price: number }

    Target token information

    Type declaration

    • address: string

      Token contract address

    • decimals: number

      Token decimal places

    • price: number

      Current token price

    trace_id?: string

    If dry run fails, the trace id of the quote.