1️⃣Get Quote
This endpoint will return currently available routes with estimated target token amount for your quote. You can also designate specific bridges or aggregator to customize the route. If there is no available route, it will return an error_code, which you can reference here to get error detail.
Parameter/Response Details
Use
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
as the address for the native token in your parameter.If you would like to know more about commissionRate fields and fee collection function, please refer to Monetization / Take Fees
If you would like to know latest supported bridge provider and swap provider, please refer to Supported Blockchains/Bridges/DEXs
The
estimatedGas
field in the API response is an estimated value. For now, please use a method similar to RPC, such as eth_estimateGas, to re-estimate the actual gas limit. You can refer to the following sample code to do that:
Example Request
This request is asking a quote of 1 ETH on Optimism to ETH on Arbitrum Chain and designate yBridge as bridgeProvider.
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.
Here you can find our full API reference
Last updated