quoteOut

Get a quote to retrieve the swapped tokens from the specified network (to Network) with bridge and data transfer options.

Request Parameters:

NameTypeDescriptionExample

network (required)

String

The network from which the tokens will be swapped

polygon

fromTokenAddress (required)

String

The address of the token to be swapped

0xb58e26ac9cc14c0422c2b419b0ca555ee4dcb7cb

toTokenAddress (required)

String

The address of the token to receive in the target network

0x2791bca1f2de4661ed88a30c99a7a9449aa84174

sellAmount (required)

String

The amount of tokens to be swapped

10000000000000000

bridgeType (required)

String

The type of bridge to be used for the token transfer 0: Wormhole 1: Stargate 2: Celer

1

bridgePayload (required)

String

The payload or additional information required by the bridge

0x...........

dataTransferType (required)

String

The type of data transfer method to be used for the token transfer 0: Wormhole 1: LayerZero

1

dataTransferPayload (required)

String

The payload or additional information required for the data transfer

0x........

slippage (required)

Number

The slippage tolerance for the token swap

0.1

liquiditySources (optional)

String[]

An array of liquidity sources to consider for the quote

Request URL:

https://api.magpiefi.xyz/aggregator/quote-out?network=polygon&fromTokenAddress=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&toTokenAddress=0x0000000000000000000000000000000000001010&sellAmount=100000000&bridgeType=1&bridgePayload=0x&dataTransferType=0&dataTransferPayload=0x&slippage=0.1&liquiditySources=uniswap-v2

Response Example:

{
  "id": "string",
  "amountOut": "string",
  "magpieAggregatorAddress": "string",
  "fees": [
    {
      "type": "gas",
      "value": "string"
    }
  ]
}

Last updated