GET
/
base
/
route
curl -L \
  "https://api.fibrous.finance/base/route?amount=1000000000000000000&tokenInAddress=0x4200000000000000000000000000000000000006&tokenOutAddress=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" \
  --header "Accept: */*"
{
  "success": true,
  "routeSwapType": 2,
  "inputToken": {
    "name": "Wrapped Ether",
    "address": "0x4200000000000000000000000000000000000006",
    "decimals": 18,
    "price": 4337.55
  },
  "inputAmount": "1000000000000000000",
  "outputToken": {
    "name": "USD Coin",
    "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "decimals": 6,
    "price": 0.999796
  },
  "outputAmount": "4303439184",
  "route": [
    {
      "percent": "100%",
      "swaps": [
        [
          {
            "protocol": 9,
            "poolName": "PancakeSwap V3",
            "poolAddress": "0x72ab388e2e2f6facef59e3c3fa2c4e29011c2d38",
            "fromTokenAddress": "0x4200000000000000000000000000000000000006",
            "toTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
            "percent": "100%",
            "extraData": {
              "fee": 100
            }
          }
        ]
      ]
    }
  ],
  "estimatedGasUsed": "347407383168",
  "estimatedGasUsedInUsd": 0.0031034457390210508,
  "bestQuotesByProtocols": [],
  "time": 0.858,
  "initial": true
}

Endpoint

https://api.fibrous.finance/base/route
Find the optimal trading route through Fibrous Finance’s liquidity pools to maximize output and minimize slippage. This endpoint analyzes multiple protocols, pool depths, and potential paths to deliver the most efficient swap execution for your tokens.

Query Parameters

amount
string
required
The amount of input tokens in wei format. For tokens with 18 decimals, multiply the amount by 10^18.Example: "1000000000000000000" for 1 ETH
tokenInAddress
string
required
The address of the input token.Example: "0x4200000000000000000000000000000000000006" for ETH
tokenOutAddress
string
required
The address of the output token.Example: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" for USDC
reverse
boolean
If true, the amount parameter represents the desired output amount instead of input amount. Default: false
direct
boolean
If true, only direct swaps between the input and output tokens will be considered. Default: false
excludeProtocols
array[string]
Array of protocol names to exclude from routing. Default: []

Response

success
boolean
Indicates if the request was successful.
routeSwapType
number
Type of swap route.
inputToken
object
Details about the input token.
outputToken
object
Details about the output token.
outputAmount
string
The estimated amount of output tokens in wei format.
estimatedGasUsed
string
Estimated gas cost for the swap in wei.
estimatedGasUsedInUsd
number
Estimated gas cost in USD.
route
array
Array of route segments with detailed swap information.
curl -L \
  "https://api.fibrous.finance/base/route?amount=1000000000000000000&tokenInAddress=0x4200000000000000000000000000000000000006&tokenOutAddress=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" \
  --header "Accept: */*"
{
  "success": true,
  "routeSwapType": 2,
  "inputToken": {
    "name": "Wrapped Ether",
    "address": "0x4200000000000000000000000000000000000006",
    "decimals": 18,
    "price": 4337.55
  },
  "inputAmount": "1000000000000000000",
  "outputToken": {
    "name": "USD Coin",
    "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "decimals": 6,
    "price": 0.999796
  },
  "outputAmount": "4303439184",
  "route": [
    {
      "percent": "100%",
      "swaps": [
        [
          {
            "protocol": 9,
            "poolName": "PancakeSwap V3",
            "poolAddress": "0x72ab388e2e2f6facef59e3c3fa2c4e29011c2d38",
            "fromTokenAddress": "0x4200000000000000000000000000000000000006",
            "toTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
            "percent": "100%",
            "extraData": {
              "fee": 100
            }
          }
        ]
      ]
    }
  ],
  "estimatedGasUsed": "347407383168",
  "estimatedGasUsedInUsd": 0.0031034457390210508,
  "bestQuotesByProtocols": [],
  "time": 0.858,
  "initial": true
}