Overview
When you create a swap viaPOST /api/v2/swaps, the response includes
a deposit_actions array. A deposit action is the exact on-chain transaction to submit on the
source chain to fund the swap: a target to_address, an amount, and a blockchain-specific
call_data payload. Submit it and Layerswap detects the deposit and delivers the funds on the
destination chain.
This page is the reference for the deposit action object and the funding modes. The per-chain guides
below show how to build and submit the transaction on each blockchain. For the end-to-end flow
(discover → quote → create → execute → track), see the API Integration guide.
Funding modes
The method you choose when creating the swap determines the deposit action you receive:- Direct transfer (default) and Depository (
use_depository: true) return atype: "transfer"action withcall_datato submit (Depository also addsgas_limitandencoded_args). - Deposit address (
use_deposit_address: true) returns atype: "manual_transfer"action — a generated address withcall_data: null.
use_depository and use_deposit_address are mutually exclusive. Some networks support only a subset
of modes (e.g. Starknet and TON support only the transfer flow) — see each chain guide.Deposit action schema
Each item in thedeposit_actions array has the following structure:
Either
transfer (submit a transaction built from call_data) or manual_transfer (send funds to a
generated deposit address; call_data is null).The transaction target — the solver address, a generated deposit address, or the Depository contract,
depending on the funding mode.
The amount to send in human-readable units (e.g.
0.1 ETH, not wei). 0 for ERC20 depository deposits
(the amount is carried inside call_data).The amount in the token’s smallest unit (wei for ETH, satoshi for BTC, …). For native transfers, send
this as the transaction value.
Blockchain-specific payload used to construct the transaction.
null for manual_transfer. The format
varies by chain — see the guides below.The source network object, including
name, type, chain_id, and node_url.The token being deposited, including
symbol, decimals, and contract (null for native tokens).The token used to pay transaction fees on this network.
Execution order. There is normally a single action; if more than one is returned, execute them in
ascending
order.Suggested gas limit for the contract call. Returned only for Depository deposits.
The individual, decoded contract-call arguments, for integrators who prefer to build the call
themselves. Returned only for Depository deposits.
Step-by-step flow
1
Create a swap
Call
POST /api/v2/swaps. The response contains the
deposit_actions array.2
Read the deposit action
Take the first action (or iterate in
order):3
Submit the transaction
Build and broadcast the transaction on the source chain using
call_data, to_address, and the
amount. The mechanics differ per chain — follow the matching guide below (and
Depository for depository deposits).4
Speed up matching (optional)
Report the transaction hash so Layerswap matches it without waiting for routine polling:
5
Track the swap
Poll
GET /api/v2/swaps/{swapId} and follow the
swap lifecycle to completion.call_data format by chain
Thecall_data format depends on the source blockchain:
For funding via the on-chain contract (
use_depository: true), see the
Depository guide.