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-APIKEYheader 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:
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.
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 viaGET /api/v2/swaps/{swapId}/deposit_actions):
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.
POST /api/v2/swaps/{swapId}/deposit_speedup.
4. Track the transfer
Poll the swap to follow it to completion:GET /api/v2/swaps/{swapId}— the swap and itstransactions(input= your source deposit,output= the destination delivery).GET /api/v2/swaps/by_transaction_hash/{transactionHash}— look up a swap by its source transaction hash.
user_transfer_pending → ls_transfer_pending → completed. 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:
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.