Aggregator API

The Linx Aggregator API, accessible at api.linxlabs.org, provides developers with programmatic access to the Linx DEX Aggregator’s liquidity aggregation and swap execution capabilities on the Kadena and Alephium blockchains. This API enables seamless integration of the Linx DEX Aggregator into external applications, such as wallets, DeFi platforms, and trading bots, enhancing the composability of the Linx Lending ecosystem. By leveraging the API, developers can access optimized trade routes, execute swaps, and tap into the protocol’s liquidity aggregation across chain-native decentralized exchanges (DEXs).
Key Features
Dual-Chain Support: The API supports liquidity aggregation and swap execution on both Kadena and Alephium, querying DEXs native to each blockchain independently.
Optimized Trade Routes: The API provides access to the Linx DEX Aggregator’s sophisticated routing algorithm, ensuring the best prices and minimal slippage for token swaps.
Public Access: Available at api.linxlabs.org, the API is open to developers without requiring permission, fostering widespread adoption and integration.
Fee Integration: Swap fees (0.7%) processed through the API contribute to the Linx Lending protocol via LINX token buybacks, aligning developer usage with ecosystem growth.
Scalable and Efficient: Built to leverage the high throughput and low latency of Kadena and Alephium, the API ensures fast and cost-effective interactions.
API Functionality
The Linx Swap API enables developers to interact with the Linx DEX aggregator through a set of RESTful endpoints. The API operates as follows:
Chain Selection: Developers specify the target blockchain (Kadena or Alephium) in API requests to access chain-specific DEX liquidity.
Liquidity Query: The API queries available DEXs on the selected chain to retrieve real-time data on token pairs, pool sizes, and prices.
Route Optimization: The API returns the optimal trade route for a given swap, calculated by the aggregator’s algorithm to minimize cost and slippage.
Fee Handling: A 0.7% fee is applied to each swap, with up to 100% of fees allocated to LINX token buybacks on the open market, as determined by protocol governance.
Key Endpoints
The Aggregator API provides the following core endpoints (hosted at api.linxlabs.org):
POST /v1/quote: Retrieves the best trade route on Alephium for a specified token pair, amount. Parameters include tokenIn, tokenOut, amount, slippage, address and public key. (Coming soon: support for selecting blockchains)
Example: POST /v1/quote with payload
Response: JSON object with the optimal route, expected output amount, and estimated slippage.
GET /v1/tokens: Returns a list of available tokens and their metadata on the specified chain
Example: GET /v1/tokens
Response: JSON array of token data, including token (contract) id.
Security and Reliability
Rate Limiting: The API implements rate limiting to prevent abuse and ensure fair access for all developers.
Authenticated Transactions: Swap executions require signed transactions from the user’s wallet (e.g., Linx Wallet or other compatible wallets), ensuring secure and trustless operations.
Audited Smart Contracts: The underlying smart contracts for swap execution, deployed on Kadena and Alephium, are audited by reputable firms to minimize vulnerabilities.
Benefits for Developers
Seamless Integration: The RESTful API is easy to integrate into wallets, DeFi platforms, or trading bots, with documentation available at api.linxlabs.org/docs.
Access to Optimized Liquidity: Developers can offer users the best swap prices by leveraging the Linx DEX Aggregator’s routing algorithm.
Cross-Chain Flexibility: Support for both Kadena and Alephium allows developers to build applications targeting multiple blockchain ecosystems.
Benefits for the Linx Ecosystem
Increased Adoption: The API encourages third-party integrations, driving user engagement with the Linx App and Linx Wallet.
Fee Reinvestment: The 0.7% swap fees, with up to 100% allocated to LINX buybacks, enhance the protocol’s treasury and create deflationary pressure on the LINX token supply.
Composability: (Coming soon) The API enables developers to combine DEX aggregation with Linx lending and borrowing features, creating powerful DeFi workflows.
Last updated