LCX Liberty. American DeFi. Your keys. Your assets. Your control.
API reference
API overview
Base URL, conventions, and the full endpoint list.
Base URL
https://swap-api.lcx.com
Every endpoint below sits under /v1. The version is in the path, and a breaking change gets a new path. /v1 will not change shape underneath you.
Conventions
- Amounts in, human. Pass
"1.5"withdecimals. - Amounts out, raw. Base units as strings, because an 18-decimal integer does not survive a JavaScript number.
- Addresses are checksummed on the way out and case-insensitive on the way in.
- Everything is JSON, including errors. See Errors.
All endpoints
| Endpoint | Purpose |
|---|---|
POST /v1/quote | Best route and expected output. |
POST /v1/swap | Quote and signable calldata in one call. |
POST /v1/build | Calldata for a quoteId you already hold. |
POST /v1/submit | Broadcast a signed swap through the path most likely to fill it. |
GET /v1/allowance | Does this taker need to approve, and of whom. |
POST /v1/permit | EIP-2612 typed data for a gasless approval. |
GET /v1/tokens | Token list and search for a chain. |
GET /v1/price | USD price for one token. |
POST /v1/prices | USD prices for many tokens. |
GET /v1/chains | Supported chains and index health. Never counts. |
GET /v1/swaps | A wallet's swap history, every chain. |
GET /v1/swaps/health | Per-chain indexer state behind that history. |
GET /v1/stats | Index size and engine benchmark. |
GET /v1/usage | Your plan, calls used and remaining. Never counts. |
GET /v1/plans | Every plan and its limits. Never counts. |