Query a Swap

Query a swap from the API

Follow the above OpenAPI spec to query the routes endpoint, and receive a swap quote.

The return data will have the shape:

interface ReturnData {
    expectedOut: string,
    routerAddress: Address,
    details: {
        path: Address[],
        pairs: Address[],
        extras: string[],
        inputAmount: BigNumberString,
        expectedOutputAmount: BigNumberString,
        deadline: number,
        partner: number,
        sig: string
    }
}

type Address = string
type BigNumberString = string
Field
Description

expectedOut

Non decimal-adjusted output amount for the given trade. When displayed on a UI, you will have to account for decimals.

routerAddress

Address at the correct router implementation to perform the swap

details

Last updated