1️⃣Get Quote

Returns feasible routes and best quotations

This API returns the best quotes from yBridge

Get the best quote for bridging tokens

GET endpoint/quote

Query Parameters

NameTypeDescription

srcChainId*

String

ID of source chain

fromTokenAddress*

String

Token to be swapped from source chain

amount*

String

Amount of tokens to be swapped.

destChainId*

String

ID of target chain

toTokenAddress*

String

Token to be received on target chain

{
    "isSuccess": false,
    "msg": "The minimum swap amount for this trading pair should be equivalent to {min_amount} {token_symbol}."
    "statusCode": "6",
    "destChainId": "<target chain ID>",
    "fromTokenAddress": "<address>",
    "toTokenAddress": "<address>",
    "fromTokenAmount": "<amount>",
    "contractAddress": null,
    "srcChainId": "<source chain ID>",
    "toTokenAmount": "0",
    "xyFee": null,
}

Example Request

$ curl https://open-api.xy.finance/v1/quote?srcChainId=1&fromTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&amount=500000000000000000&destChainId=56&toTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

This request is asking a quote of 0.5 ETH on Ethereum to BNB on BSC.

IMPORTANT: Note that the amount parameter should be padded with zeroes. For example, pass 100000000 instead of 100 if the decimals of the token is 6.

Last updated