Skip to main content

Overview

Layerswap bridges tokens across networks through a REST API: you quote a route, create a swap, submit one deposit transaction on the source network, and track it while Layerswap delivers on the destination.
  • Base URL: https://api.layerswap.io
  • API key (optional): send it in the X-LS-APIKEY header to attribute swaps to your account and get higher rate limits. Create one on the API Keys page.

1. Get a quote

Start with a quote for the exact route and amount you want. It returns the amount you’ll receive, the fees, and the estimated time — and tells you whether the route is supported. GET /api/v2/quote — pass the source and destination network and token, plus an amount:
Identify tokens by contract address, not a hard-coded symbol. A symbol is a display label and can change — Arbitrum’s USDT is now USDT0, so a hard-coded "source_token": "USDT" silently stops matching. Pass the contract address, or look the token up from /sources (see below). Don’t hard-code symbols or decimals — read them from the API.
See Fees for how the fee fields are composed.

2. Create the swap

POST /api/v2/swaps creates the swap and returns the deposit_actions you’ll send next. Choose one funding method: use_depository and use_deposit_address are mutually exclusive.
The response includes the created swap (its id and status), the quote, and the deposit_actions.

3. Send the deposit

Each deposit action in the response is a ready-to-send transaction for the source network. Read it from the swap response (or re-fetch via GET /api/v2/swaps/{swapId}/deposit_actions):
How you submit it depends on the source network — the call_data is EVM calldata on one network, a Bitcoin OP_RETURN memo on another, a full Solana transaction on another. Follow the matching guide:
  • Sending the deposit — per-network execution (EVM, Bitcoin, Solana, Starknet, TON, Tron, Fuel).
  • Depository — when you created the swap with use_depository: true.
Submit the returned call_data verbatim. It encodes the swap id and the assigned receiver; altering it means Layerswap can’t match your deposit to the swap.
After broadcasting, you can optionally speed up matching by reporting the transaction hash to POST /api/v2/swaps/{swapId}/deposit_speedup.

4. Track the transfer

Poll the swap to follow it to completion: A typical swap moves user_transfer_pendingls_transfer_pendingcompleted. Other terminal states are failed, expired, pending_refund, and refunded. See the Swap Lifecycle for every state and transition, and Refunds for failure handling.

Discovering routes & tokens

Most integrations already know the route they want and can go straight to a quote. When you need to enumerate what’s available — to build a token picker, or to check support up front — three endpoints list it: Each token carries a stable contract and a group — its token family (e.g. ETH, USDC, USDT) — so you can resolve a token reliably even when its symbol changes:
Or browse everything at Networks & Tokens.

Next steps

Sending the deposit

Execute the deposit on each supported network.

Depository

Fund a swap by calling our on-chain contract.

Swap Lifecycle

Every swap state and how to react to it.

Fees

How quotes and fees are calculated.