Swap API
Nabla Finance API for token swaps.
Overview
The Nabla Finance Swap API provides an efficient on-chain routing system that enables users and developers to perform token swaps directly through the Nabla Portal smart contracts. Unlike centralized or custodial aggregators, Nabla operates entirely on-chain — ensuring transparent, verifiable execution and predictable pricing.
The API serves as a simple interface layer to generate calldata and quotes for Nabla Portal transactions. It leverages live price feeds streamed from the Nabla Antenna to ensure that all swaps are priced against the most recent on-chain oracle data.
Key benefits
Accurate real-time pricing: The API uses Nabla’s live price update feed to provide the freshest oracle-signed price data for all supported tokens.
Single-hop efficiency: Swaps are executed directly through the Nabla Portal without routing across multiple DEXes, minimizing gas usage and reducing latency.
Secure execution: All calldata is generated server-side using verified price data and passed directly to the Nabla smart contracts — ensuring transparent, deterministic execution.
Developer-friendly design: The REST interface provides standardized endpoints for quoting swaps, generating calldata, and retrieving supported tokens, making it easy to integrate Nabla into bots, frontends, or backends.
Predictable pricing and slippage control: The API includes built-in parameters for slippage tolerance and maximum trade deviation, ensuring consistent execution even in volatile markets.
Supported networks
Arbitrum One (chain id: 42161)
Base (chain id: 8453)
Berachain (chain id: 80094)
Hyperliquid (chain id: 999)
API reference
For detailed information about each endpoint, refer to the Nabla Finance Swap API swagger docs:
Quick Start
Script
Example swap from USDC to WETH on Arbitrum One.
.env (place in same directory)
.env (place in same directory)Last updated