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

Last updated