Introduction
The Fibrous Router API is a cutting-edge discovery and routing algorithm that offers asset exchanges at the best rates on the market. Our API finds the most efficient paths for token swaps, capable of splitting between different protocols and even different market depths within one protocol in the shortest possible time.Supported Networks
Fibrous Finance API is available on multiple blockchain networks:- Starknet - Cairo-based Layer 2 with batch operations support
- Base - Optimistic rollup on Ethereum with low fees
- HyperEVM - High-performance EVM chain with ultra-fast execution
- Scroll - zkEVM Layer 2 solution with zero-knowledge proofs
- Monad - High-performance Layer 1 with parallel execution
Core Endpoints
All networks (except Starknet) share the same endpoint structure:Get Route
Find the optimal trading route
Execute Swap
Execute a token swap
Get Calldata
Get route and calldata in one call
Health Check
Check API and network status
Starknet has a different architecture and additional capabilities. See Starknet API for details.
Quick Start
Here’s a complete example of how to perform a swap:1
Get the optimal route
2
Execute the swap
3
Send the transaction
Use the returned calldata to send a transaction using your preferred Web3 library.
Base URL
/{network}/{endpoint}
Examples:
https://api.fibrous.finance/base/routehttps://api.fibrous.finance/hyperevm/executehttps://api.fibrous.finance/scroll/calldatahttps://api.fibrous.finance/starknet/route
Authentication
No authentication is required to use the Fibrous Router API. However, rate limits apply to ensure fair usage.Rate Limits
Learn about API rate limits and best practices
Key Features
Multi-Protocol Routing
Multi-Protocol Routing
Fibrous aggregates liquidity from multiple DEX protocols on each network, finding the best possible route for your swap.
Split Routing
Split Routing
Large swaps can be split across multiple protocols and pools to minimize price impact and maximize output.
Real-Time Optimization
Real-Time Optimization
Routes are calculated in real-time based on current liquidity and prices across all integrated protocols.
Gas Optimization
Gas Optimization
Our routing algorithm considers gas costs to ensure the best net outcome for your swap.
Slippage Protection
Slippage Protection
Set custom slippage tolerance to protect against unfavorable price movements during execution.
Response Format
All API responses follow a consistent JSON format:Best Practices
Fresh Routes
Always fetch a new route before executing. Routes can become stale within 30-60 seconds.
Appropriate Slippage
Set slippage based on token volatility and liquidity. Stable pairs: 0.1-0.5%, Volatile: 1-3%
Error Handling
Implement proper error handling and retry logic for production applications.
Gas Estimation
Use the estimated gas from API responses and add a 10-20% buffer for safety.