Skip to content
API overview

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's decimals. 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 send decimals: it is optional, and one that disagrees with the token is refused with decimals_mismatch rather 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

EndpointPurpose
POST /v1/quoteBest route and expected output.
POST /v1/swapQuote and signable calldata in one call.
POST /v1/buildCalldata for a quoteId you already hold.
POST /v1/multi/quoteSeveral tokens in and several out, as one transaction.
POST /v1/multi/buildCalldata for a bundle you quoted.
GET /v1/multi/xcorridorsWhat can cross between two chains, and whether in one transaction.
POST /v1/multi/xquoteThe far side of a cross-chain bundle.
POST /v1/multi/xbuildIts bridge deposit, or the bundle and the deposit as one transaction.
GET /v1/bridge/transfersWhere a cross-chain transfer is, by wallet or by id.
POST /v1/submitBroadcast a signed swap through the path most likely to fill it.
GET /v1/allowanceDoes this taker need to approve, and of whom.
POST /v1/permitEIP-2612 typed data for a signed approval.
GET /v1/tokensToken list and search for a chain.
GET /v1/priceUSD price for one token.
POST /v1/pricesUSD prices for many tokens.
GET /v1/chainsSupported chains and index health. Never counts.
GET /v1/swapsA wallet's swap history, every chain.
GET /v1/swaps/healthPer-chain indexer state behind that history.
GET /v1/usageYour plan, calls used and remaining. Never counts.
GET /v1/plansEvery plan and its limits. Never counts.