Using The API

The LiquidSwap Aggregator API allows you to interact with the protocol programmatically. It provides endpoints for finding liquidity pools, calculating optimal swap routes, fetching token information, and checking wallet balances.

Why Use the LiquidSwap API?

The API enables developers to integrate LiquidSwap's aggregation capabilities directly into their applications, trading bots, or DeFi protocols. Instead of building complex routing logic or maintaining connections to multiple DEXs, you can leverage our optimized infrastructure.

Key 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

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

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&parameter2=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

Ready to start building? Check out our specific endpoint documentation:

Each endpoint includes detailed examples and response formats to help you integrate quickly and efficiently.

Last updated