Base API Overview
Welcome to the Base API documentation. Our API provides powerful endpoints for finding optimal trading routes and executing swaps on Base network. ETH addresses accepted by the API are listed belowToken | Address |
---|---|
ETH | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
ETH | 0x0000000000000000000000000000000000000000 |
Base URL
Common Concepts
Authentication
No authentication is required for the API endpoints.Rate Limiting
Please refer to our Rate Limit documentation for details about rate limiting.Common Token Addresses
Here are some commonly used token addresses on Base:Token | Address | Decimals |
---|---|---|
ETH | 0x0000000000000000000000000000000000000000 | 18 |
USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | 6 |
USDbC | 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA | 6 |
WETH | 0x4200000000000000000000000000000000000006 | 18 |
DAI | 0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb | 18 |
Response Codes
Code | Description |
---|---|
200 | Success - The request was successful |
400 | Bad Request - Check your request parameters |
429 | Too Many Requests - You’ve hit the rate limit |
500 | Internal Server Error - Something went wrong on our end |
Available Endpoints
Route
Find the optimal trading route through Fibrous’ liquidity pools to maximize output and minimize slippage.Execute
Generate calldata for the Fibrous router contract to execute the swap.Calldata
Get the calldata for executing the swap transaction.Best Practices
Slippage Protection
- Always set a reasonable slippage value (0.1% - 1% for stable pairs)
- Use higher slippage for volatile pairs or low liquidity tokens
- Monitor price impact to ensure favorable trades
Gas Optimization
- Use the
direct
parameter for simple swaps between major tokens - Set
excludeProtocols
to skip specific protocols if needed - Consider batch swaps for multiple transactions
Error Handling
- Always check the
success
field in responses - Implement proper error handling in your code
- Monitor transaction status after execution
Quick Start Example
Here’s a complete example of how to perform a swap using our API:- First, get the optimal route:
- Then, get the execution calldata:
- Finally, execute the transaction using the returned calldata with your preferred Web3 library.
Need Help?
- Check our FAQ for common questions
- Join our Discord for community support
- Contact us at contact@fibrous.finance for direct support