GET
/
starknet
/
route
curl -L \
  "https://api.fibrous.finance/starknet/route?amount=1000000000000000000&tokenInAddress=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7&tokenOutAddress=0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8" \
  --header "Accept: */*"
{
  "success": true,
  "inputToken": {
    "name": "Ethereum",
    "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "decimals": 18,
    "price": 1590.87
  },
  "outputToken": {
    "name": "USD Coin",
    "address": "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
    "decimals": 6,
    "price": 0.999982
  },
  "route": [
    {
      "percent": "100%",
      "swaps": [
        {
          "protocol": 5,
          "poolName": "JediSwap",
          "poolAddress": "0x...",
          "percent": "100%",
          "extraData": {
            "fee": 500
          }
        }
      ]
    }
  ],
  "time": 0.8,
  "estimatedGasUsed": "250000",
  "estimatedGasUsedInUsd": 0.001
}

https://api.fibrous.finance/starknet

Find the optimal trading route for a token swap through Fibrous Finance’s liquidity pools on Starknet. 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

Input token amount in wei format. For tokens with 18 decimals, multiply the amount by 10^18.

Example: "1000000000000000000" (1 ETH)

tokenInAddress
string
required

Input token address.

Example: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" (ETH)

tokenOutAddress
string
required

Output token address.

Example: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8" (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.

Example: ["JediSwap", "10kSwap"]

Response

success
boolean

Indicates if the request was successful.

inputToken
object

Details about the input token

outputToken
object

Details about the output token

route
array

Array of route segments, each containing:

time
number

Time taken to find the route in seconds

estimatedGasUsed
string

Estimated gas that will be used for the swap

estimatedGasUsedInUsd
number

Estimated gas cost in USD

curl -L \
  "https://api.fibrous.finance/starknet/route?amount=1000000000000000000&tokenInAddress=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7&tokenOutAddress=0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8" \
  --header "Accept: */*"
{
  "success": true,
  "inputToken": {
    "name": "Ethereum",
    "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "decimals": 18,
    "price": 1590.87
  },
  "outputToken": {
    "name": "USD Coin",
    "address": "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
    "decimals": 6,
    "price": 0.999982
  },
  "route": [
    {
      "percent": "100%",
      "swaps": [
        {
          "protocol": 5,
          "poolName": "JediSwap",
          "poolAddress": "0x...",
          "percent": "100%",
          "extraData": {
            "fee": 500
          }
        }
      ]
    }
  ],
  "time": 0.8,
  "estimatedGasUsed": "250000",
  "estimatedGasUsedInUsd": 0.001
}