curl --location 'https://api.fibrous.finance/hyperevm/execute' \
--header 'Content-Type: application/json' \
--data '{
"route":{
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage":0.1,
"destination":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}'
import requests
import json
url = "https://api.fibrous.finance/hyperevm/execute"
payload = json.dumps({
"route": {
"success": True,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": None
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": None
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": False
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.fibrous.finance/hyperevm/execute',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
{
"route": {
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"amount_in": "10000000000000000000",
"amount_out": "551266196",
"min_received": "550714930",
"destination": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"rate": "1000000",
"protocol_id": "13",
"pool_address": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"swap_type": 0,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000019"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "990000",
"protocol_id": "18",
"pool_address": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "10000",
"protocol_id": "15",
"pool_address": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
]
}
Execute
Execute a swap through Fibrous liquidity pools
POST
/
hyperevm
/
execute
curl --location 'https://api.fibrous.finance/hyperevm/execute' \
--header 'Content-Type: application/json' \
--data '{
"route":{
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage":0.1,
"destination":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}'
import requests
import json
url = "https://api.fibrous.finance/hyperevm/execute"
payload = json.dumps({
"route": {
"success": True,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": None
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": None
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": False
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.fibrous.finance/hyperevm/execute',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
{
"route": {
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"amount_in": "10000000000000000000",
"amount_out": "551266196",
"min_received": "550714930",
"destination": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"rate": "1000000",
"protocol_id": "13",
"pool_address": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"swap_type": 0,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000019"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "990000",
"protocol_id": "18",
"pool_address": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "10000",
"protocol_id": "15",
"pool_address": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
]
}
Endpoint
https://api.fibrous.finance/hyperevm/execute
Request Body Parameters
RouteResponse
required
The route object returned from the
/hyperevm/route endpoint. This contains all necessary information about the swap path and expected outcomes.number
default:"0.5"
required
Maximum acceptable slippage in percentage (0.1 to 100). Example:
0.5 for 0.5% slippage tolerancestring
required
Unix timestamp (in seconds) after which the transaction will revert. Defaults to 20 minutes from the current time if not specified.
Response
object
object[]
Error Responses
Route Expired
{
"success": false,
"error": "Route expired",
"details": "The provided route has expired. Please fetch a new route."
}
Slippage Exceeded
{
"success": false,
"error": "Slippage exceeded",
"details": "The swap would result in more slippage than allowed"
}
Insufficient Balance
{
"success": false,
"error": "Insufficient balance",
"details": "Wallet does not have enough tokens for the swap"
}
Invalid Deadline
{
"success": false,
"error": "Invalid deadline",
"details": "Deadline must be a future timestamp"
}
curl --location 'https://api.fibrous.finance/hyperevm/execute' \
--header 'Content-Type: application/json' \
--data '{
"route":{
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage":0.1,
"destination":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}'
import requests
import json
url = "https://api.fibrous.finance/hyperevm/execute"
payload = json.dumps({
"route": {
"success": True,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": None
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": None
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": False
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped HYPE",
"address": "0x5555555555555555555555555555555555555555",
"decimals": 18,
"price": "55.16"
},
"inputAmount": "10000000000000000000",
"outputToken": {
"name": "USD₮0",
"address": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"decimals": 6,
"price": "1.001"
},
"outputAmount": "551266196",
"time": 0.369,
"estimatedGasUsed": "44164800000000",
"estimatedGasUsedInUsd": 0.00487137744,
"route": [
{
"percent": "100%",
"swaps": [
[
{
"protocol": 13,
"poolName": "hybraFinanceV3",
"poolAddress": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"fromTokenAddress": "0x5555555555555555555555555555555555555555",
"toTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"percent": "100.00%",
"extraData": {
"fee": 25
}
}
],
[
{
"protocol": 18,
"poolName": "kittenSwapAlgebraV4",
"poolAddress": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "99.00%",
"extraData": null
},
{
"protocol": 15,
"poolName": "gLiquidV3",
"poolAddress": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"fromTokenAddress": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"toTokenAddress": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"percent": "1.00%",
"extraData": null
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false
},
"slippage": 0.1,
"destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.fibrous.finance/hyperevm/execute',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
{
"route": {
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"amount_in": "10000000000000000000",
"amount_out": "551266196",
"min_received": "550714930",
"destination": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x5555555555555555555555555555555555555555",
"token_out": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"rate": "1000000",
"protocol_id": "13",
"pool_address": "0x5a716e045421b0977ca5bfb4f3394139c6a069bc",
"swap_type": 0,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000019"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "990000",
"protocol_id": "18",
"pool_address": "0x3cf44ef1500c1d559c8e81dffd6baeb0966b2712",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"token_in": "0xfd739d4e423301ce9385c1fb8850539d657c296d",
"token_out": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"rate": "10000",
"protocol_id": "15",
"pool_address": "0x5e43a757ba769d4cd5fe568ae2429d4ae69e0ecf",
"swap_type": 2,
"extra_data": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
]
}
Best Practices
- Route Freshness
- Always use a fresh route from the
/hyperevm/routeendpoint - Routes can become stale due to market movements
- Implement retry logic with fresh routes if execution fails
- Always use a fresh route from the
- Slippage Management
- Set appropriate slippage tolerance based on:
- Token pair volatility
- Trade size
- Market conditions
- Higher values increase success rate but may result in worse prices
- Lower values ensure better prices but may cause more failed transactions
- Set appropriate slippage tolerance based on:
- Deadline Setting
- Set reasonable deadlines to prevent stale transactions
- Consider network congestion when setting deadlines
- Default of 20 minutes is suitable for most cases
- Gas Optimization
- Monitor
gasUsedin responses to optimize future transactions - Consider using direct routes for major pairs
- Bundle multiple swaps if possible
- Monitor
See Also
- Route Endpoint - Find the optimal route for your swap
- Calldata Endpoint - Get raw transaction data
- Gas Estimation - Understanding gas costs