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 are base units, in and out. Pass
amountIn, an integer string in the token's smallest unit ("1500000"for 1.5 USDC), and read the same in every response, which also names each side'sdecimals. Strings, because an 18-decimal integer does not survive a JavaScript number. - A human figure is accepted too.
amount: "1.5"is scaled by the token's own decimals, which the API knows. You do not senddecimals: it is optional, and one that disagrees with the token is refused withdecimals_mismatchrather than priced as a different trade. - 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/multi/quote | Several tokens in and several out, as one transaction. |
POST /v1/multi/build | Calldata for a bundle you quoted. |
GET /v1/multi/xcorridors | What can cross between two chains, and whether in one transaction. |
POST /v1/multi/xquote | The far side of a cross-chain bundle. |
POST /v1/multi/xbuild | Its bridge deposit, or the bundle and the deposit as one transaction. |
GET /v1/bridge/transfers | Where a cross-chain transfer is, by wallet or by id. |
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 signed 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/usage | Your plan, calls used and remaining. Never counts. |
GET /v1/plans | Every plan and its limits. Never counts. |