Quote API
The API allows developers and users to get the best swap quotes to speed up integration.
API base path
https://api.bulbaswap.io/v2/quoteParams
Name
Require
Type
Note
amount
true
number
e.g. 0.1
tokenInAddress
true
string
eth, ETH, weth, WETH, 0x...
tokenOutAddress
true
string
eth, ETH, weth, WETH, 0x...
slippage
false
number
min: 0.01, max: 100, default: auto
minAmountOut
false
number
e.g. 0.2
protocols
false
string
v2/v3/v2,v3 (default: v2,v3)
recipient
false
string
0x...
deadline
false
number
Positive integer, min: 60, max: 600
Example
// Get query
https://api.bulbaswap.io/v2/quote?amount=0.1
&tokenInAddress=ETH
&tokenOutAddress=0xc7D67A9cBB121b3b0b9c053DD9f469523243379A
&slippage=0.5
&minAmountOut=270.9
&recipient=0x3210f5d1a49842634F224dD50a8BadF02e9aB3a4
&deadline=600
&protocols=v2,v3{
"code": 0,
"msg": "success",
"data": {
"methodParameters": {
"calldata": "0xd984396a0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c7d67a9cbb121b3b0b9c053dd9f469523243379a0000000000000000000000003210f5d1a49842634f224dd50a8badf02e9ab3a4000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000010259b200000000000000000000000000000000000000000000000000000000010aa5a6e00000000000000000000000000000000000000000000000000000000d2519ef800000000000000000000000000000000d85d1221bb31493b9d1ccb8bd1220e140000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0ce9a3b911f2f52f93f6bf35475be703998aa670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005300000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000003210f5d1a49842634f224dd50a8badf02e9ab3a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000005191035d329f481eff0143e690e0a4e366dd1e0c0000000000000000000000005300000000000000000000000000000000000011000000000000000000000000c7d67a9cbb121b3b0b9c053dd9f469523243379a0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000",
"value": "0.1",
"to": "0xc0Ce9a3B911f2F52f93F6bf35475be703998aa67"
},
"amount": "100000000000000000",
"amountDecimals": "0.1",
"quote": "279599726",
"quoteDecimals": "279.599726",
"slippage": "0.5",
"minAmountOut": "270.9",
"priceImpact": "0.0024",
"fromTokenPrice": "2802.85",
"toTokenPrice": "1",
"swapFee": {
"swapType": 1,
"feeType": 0,
"feeRate": "0.001",
"feeChain": "morph",
"feeSymbol": "ETH",
"feeContract": "",
"feeDecimals": 18,
"feeTokenPrice": "2802.85",
"feeDueAmount": "0.0001"
},
"gasFee": {
"gasLimit": "1200000",
"gasPrice": "0.000000000015",
"gasFeeAmountInUsd": "0.0651809846024520615",
"gasTotalAmount": "0.00002325525254739",
"gasLevel": "fast"
},
"route": [
[
{
"poolAddr": "0x0000000000000000000000000000000000000000",
"label": "NativeWrapper",
"percent": 100,
"tokenIn": {
"address": "0x0000000000000000000000000000000000000000"
},
"tokenOut": {
"address": "0x5300000000000000000000000000000000000011"
},
"amountIn": "99900000000000000",
"amountOut": "99900000000000000"
}
],
[
{
"poolAddr": "0x5191035d329f481eff0143e690e0a4e366dd1e0c",
"label": "BulbaV3",
"percent": 100,
"tokenIn": {
"address": "0x5300000000000000000000000000000000000011"
},
"tokenOut": {
"address": "0xc7d67a9cbb121b3b0b9c053dd9f469523243379a"
},
"amountIn": "99900000000000000",
"amountOut": "279599726"
}
]
]
}
}Last updated