Skip to main content

Introduction

Fibrous Router SDK is a TypeScript library that provides a simple and efficient way to integrate optimal token swaps into your decentralized applications. Built on top of the Fibrous Router API, it handles all the complexity of finding the best routes and executing swaps across multiple chains.

Why Use the SDK?

Type Safety

Full TypeScript support with comprehensive type definitions

Multi-Chain

Single interface for Base, HyperEVM, Citrea, Monad, and Starknet

Easy Integration

Simple API that abstracts away complex routing logic

Optimized Routes

Automatically finds the best swap paths across all DEXs

Supported Chains

The SDK supports the following blockchain networks:

Quick Start

1

Install the SDK

2

Initialize the Router

3

Get the Best Route

4

Execute the Swap

Key Features

πŸ” Smart Routing

The SDK automatically finds the optimal route by:
  • Aggregating liquidity from multiple DEX protocols
  • Splitting large trades across multiple paths
  • Minimizing price impact and slippage
  • Considering gas costs in route optimization

Batch Operations

Execute multiple swaps in a single transaction (Starknet):

Token Management

Easy access to supported tokens:

Protocol Flexibility

Exclude specific protocols or use only certain ones:

Complete Example

Here’s a complete example of swapping tokens on Base:

Chain-Specific Examples

SDK vs API

Use the SDK when:
  • Building a TypeScript/JavaScript application
  • You want type safety and autocomplete
  • You need simplified integration
  • Working with multiple chains
  • You want built-in error handling

Requirements

  • Node.js: Version 18.x or higher
  • Web3 Provider: ethers.js v6+ or starknet.js v5+
  • TypeScript: Version 4.5+ (recommended)

Installation

Next Steps

Installation Guide

Detailed installation and setup instructions

Core Functions

Explore all available SDK methods

Get Best Route

Learn how to find optimal swap routes

Execute Swaps

Build and execute swap transactions

Resources

Support

Need help? We’re here for you: