API Overview
π° Earn Revenue from Every Trade
The LiquidSwap API isn't just about integrating swap functionalityβit's about building a sustainable business. Every swap routed through your application can generate revenue for you.
π Why Developers Love Our API
β Earn up to 1% on every swap your users make β Keep 97.5% of all fees collected (we keep just 2.5%) β Automatic payments sent directly to your wallet β Bonus revenue from positive slippage capture β Ready-to-use code - integrate in minutes, not weeks
π‘ Perfect for Building
Trading dApps - Add swap functionality and monetize your users
Portfolio Tools - Earn from rebalancing and trading features
DeFi Protocols - Integrate optimal swap routing with revenue sharing
Trading Bots - Build high-frequency trading systems with built-in monetization
Mobile Wallets - Add trading features that generate passive income
How the API Works
The LiquidSwap API provides programmatic access to our DEX aggregation infrastructure. Instead of building complex routing logic or maintaining connections to multiple DEXs, you can leverage our optimized system and earn revenue from every trade.
Core Benefits:
Simplified Integration: Access all major DEXs through a single, consistent API
Real-Time Data: Get up-to-date pricing, liquidity, and routing information
Optimized Routes: Benefit from our advanced routing algorithms without building your own
Comprehensive Coverage: Access tokens and pools across the entire Hyperliquid ecosystem
Revenue Sharing: Monetize your integration from day one
Common Use Cases
Trading Applications:
Build custom trading interfaces with aggregated liquidity
Create portfolio management tools with optimal execution
Develop trading bots that automatically find the best rates
DeFi Protocols:
Integrate swap functionality into yield farming platforms
Add liquidity optimization to lending protocols
Build complex DeFi strategies that require efficient token swapping
Analytics & Tools:
Create price comparison tools across multiple DEXs
Build liquidity analysis dashboards
Develop arbitrage detection systems
Mobile & Web Apps:
Add token swapping to mobile wallets
Create simplified trading interfaces for specific use cases
Build educational tools that demonstrate DeFi concepts
Quick Start - Start Earning in 5 Minutes
Ready to integrate and start earning? Here's how:
Step 1: Make your first API call
curl "https://api.liqd.ag/v2/route?tokenIn=0x5555555555555555555555555555555555555555&tokenOut=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb&amountIn=100&feeBps=10&feeRecipient=YOUR_WALLET_ADDRESS"
Step 2: Use the returned calldata
to execute the swap Step 3: Collect your 0.1% fee automatically
That's it! Every swap now generates revenue for you.
Revenue Sharing Details
Set Your Fee: Add
feeBps
parameter (10 = 0.1%, 100 = 1%)Collect Payments: Add
feeRecipient
parameter with your wallet addressKeep 97.5%: You keep 97.5% of the fee, LiquidSwap keeps 2.5%
Automatic Payments: Fees are automatically sent to your wallet
Bonus Revenue Streams
Positive Slippage: When users get better prices, you earn 50% of the extra profit
Volume Incentives: Higher volume = better terms (contact us for details)
LIQD Staking: Our protocol revenue gets distributed to LIQD stakers
API Features
Route Finding:
Calculate optimal swap paths between any token pair
Support for both exact input and exact output swaps
Multi-hop routing for tokens without direct liquidity pairs
Real-time price impact and slippage calculations
Pool Discovery:
Find all available liquidity pools for a token pair
Compare rates and fees across different DEXs
Identify the best pools for specific trade sizes
Token Information:
Access comprehensive token metadata
Search tokens by name, symbol, or address
Get real-time token balances for any wallet
Wallet Integration:
Check token balances for specific addresses
Get transaction-ready data for smart contract interactions
Support for both native tokens and ERC-20s
Base URL
All API endpoints are accessible at:
https://api.liqd.ag
Getting Started
The LiquidSwap API is RESTful and returns JSON responses. All endpoints support GET requests and don't require authentication for read-only operations.
Basic Request Structure:
GET https://api.liqd.ag/{endpoint}?parameter1=value1¶meter2=value2
Response Format: All API responses follow a consistent structure:
{
"success": true,
"data": {
// Response data here
}
}
Error Handling: When requests fail, the API returns appropriate HTTP status codes and error messages:
{
"success": false,
"error": "Error description",
"details": "Additional error information"
}
Rate Limits & Best Practices
To ensure optimal performance for all users:
Be Respectful: Don't hammer the API with unnecessary requests
Cache Results: Token metadata and pool information don't change frequently
Handle Errors: Implement proper error handling and retry logic
Use Appropriate Timeouts: Set reasonable request timeouts in your applications
Next Steps - Choose Your Integration Path
π Quick Integration (Recommended)
Get started immediately with our ready-to-use API
Route Finding - Get optimal swap routes with built-in revenue sharing
Smart Contract Integration - Execute trades on-chain with provided calldata
Perfect for most developers who want to add swap functionality quickly.
π§ Advanced Integration
Build custom trading tools and analytics
Find Pools - Discover available liquidity pools across all DEXs
Token List - Access comprehensive token metadata and search
Token Balances - Check wallet balances for any address
Ideal for building advanced trading interfaces, analytics tools, or DeFi protocols.
π Example Use Cases
π― Revenue Optimization Tips
Start with 0.1% fees (
feeBps=10
) to test the integrationHigher volume = better rates - contact us for volume discounts
Positive slippage sharing - earn extra when users get better prices
Monitor performance - track your revenue and optimize user experience
Each endpoint includes detailed examples, response formats, and revenue sharing implementation to help you integrate quickly and start earning immediately.
Last updated