The swap `id` and the `receiver` are assigned by Layerswap — use the exact values from the deposit
diff --git a/api-reference/refunds.mdx b/api-reference/refunds.mdx
index d074eee..06ff748 100644
--- a/api-reference/refunds.mdx
+++ b/api-reference/refunds.mdx
@@ -1,7 +1,6 @@
---
title: 'Refunds'
description: 'Learn how Layerswap handles refunds'
-icon: arrow-rotate-left
---
When a swap cannot be completed after the user has sent funds, Layerswap automatically initiates a refund. The refund is always processed on the **source chain** in the **source token**. Gas fees for processing the refund transaction are deducted from the refund amount.
diff --git a/api-reference/swap-lifecycle.mdx b/api-reference/swap-lifecycle.mdx
index a245320..dd00b80 100644
--- a/api-reference/swap-lifecycle.mdx
+++ b/api-reference/swap-lifecycle.mdx
@@ -1,7 +1,7 @@
---
title: 'Swap lifecycle'
+sidebarTitle: 'Overview'
description: 'Understand the different statuses a swap goes through from creation to completion or refund.'
-icon: arrows-spin
---
diff --git a/docs.json b/docs.json
index a4d785e..90cf7d9 100644
--- a/docs.json
+++ b/docs.json
@@ -131,7 +131,34 @@
"group": "Documentation",
"pages": [
"integration/API",
- "api-reference/depository",
+ {
+ "group": "Deposit Actions",
+ "icon": "paper-plane",
+ "pages": [
+ "api-reference/deposit-actions/overview",
+ {
+ "group": "Deposit methods",
+ "icon": "money-bill-transfer",
+ "pages": [
+ "api-reference/deposit-actions/choosing-a-method",
+ "api-reference/depository"
+ ]
+ },
+ {
+ "group": "Network support",
+ "icon": "network-wired",
+ "pages": [
+ "api-reference/deposit-actions/evm",
+ "api-reference/deposit-actions/bitcoin",
+ "api-reference/deposit-actions/solana",
+ "api-reference/deposit-actions/starknet",
+ "api-reference/deposit-actions/ton",
+ "api-reference/deposit-actions/tron",
+ "api-reference/deposit-actions/fuel"
+ ]
+ }
+ ]
+ },
{
"group": "Swap lifecycle",
"icon": "arrows-spin",
diff --git a/integration/API.mdx b/integration/API.mdx
index 47514b3..a920f24 100644
--- a/integration/API.mdx
+++ b/integration/API.mdx
@@ -1,34 +1,181 @@
---
title: 'API Integration'
-description: ''
+description: 'Move tokens across chains with the Layerswap API: discover routes, quote, create a swap, execute the deposit, and track it to completion.'
icon: server
---
## Overview
-Layerswap API is set to enable fast and reliable crypto token swaps across networks
-
-Layerswap handles millions of dollars in transactions every day across multiple networks. We ensure quick and reliable crypto transfers, giving the freedom to move crypto anywhere.
-
-## Quickstart
-
-
-
- Get supported sources/networks, available routes and swap fees.
-
-
- Create Swap using the Layerswap API.
-
-
- Layerswap will monitor the source network for a transaction and will try to match it with the corresponding swap
-
-
- Once the transaction is matched and added to the swap, Layerswap will initiate a counterparty transaction to the destination_address
-
-
- Poll via Get Swap endpoint to see if the matching transaction Input was added to the swap
-
-
- If the webhook is configured, Layerswap will deliver a swap status update notification to the partner-specified URL
-
-
\ No newline at end of file
+The Layerswap API moves tokens across chains programmatically. The flow is the same for every route:
+**discover** a route, request a **quote**, **create** a swap, submit one on-chain **deposit** on the
+source chain, and Layerswap **delivers** the funds on the destination chain — then you **track** the swap
+to completion.
+
+- **Base URL:** `https://api.layerswap.io`
+- **API key (optional):** include your key in the `X-LS-APIKEY` header to attribute swaps to your
+ account (for analytics and reporting). Create one on the [API Keys](/api-keys) page.
+- **Endpoints:** every endpoint, with request/response schemas, is in the **Endpoints** section of this
+ tab — and is linked inline throughout this guide.
+
+## Core concepts
+
+| Term | Meaning |
+| --- | --- |
+| **Network** | A blockchain, identified by name (`ETHEREUM_MAINNET`, `ARBITRUM_MAINNET`, …). EVM networks also accept their numeric `chain_id`. |
+| **Token** | An asset on a network, identified by **symbol** or **contract address**. Prefer the contract address — see the warning in step 1. |
+| **Route** | A supported `(source network, source token) → (destination network, destination token)` pair. |
+| **Quote** | The expected output amount, fees, and duration for a given input amount. |
+| **Swap** | A single cross-chain transfer you create. It moves through a [lifecycle](/api-reference/swap-lifecycle) from creation to completion. |
+| **Deposit action** | The exact on-chain transaction to submit on the source chain to fund a swap. Returned with the swap — see [Deposit Actions](/api-reference/deposit-actions/overview). |
+| **Depository** | An optional Layerswap contract you can fund through instead of a plain transfer — ideal for smart-contract, server, and programmable wallets. See [Depository](/api-reference/depository). |
+
+## 1. Discover routes & tokens
+
+Find which networks and tokens you can bridge between, and the amount limits for a route.
+
+| Endpoint | Returns |
+| --- | --- |
+| [`GET /api/v2/sources`](/api-reference/swaps/get-sources) | Source networks and their tokens (optionally filtered by `destination_network` / `destination_token`) |
+| [`GET /api/v2/destinations`](/api-reference/swaps/get-destinations) | Destination networks and their tokens (optionally filtered by `source_network` / `source_token`) |
+| [`GET /api/v2/limits`](/api-reference/swaps/get-swap-route-limits) | `min_amount` / `max_amount` (and their USD values) for a specific route |
+
+Each token in the `/sources` and `/destinations` response includes `symbol`, `contract`, `decimals`,
+`price_in_usd`, `status`, and `group` — the **token family** (e.g. `ETH`, `USDC`, `USDT`) that ties a
+token's variants together across networks.
+
+
+ **Identify tokens by contract address, not by a hard-coded symbol.** A token's `symbol` is a display
+ label and can change — Arbitrum's USDT was renamed to **USDT0**, so a hard-coded
+ `"source_token": "USDT"` silently stops matching. The contract address is stable. Either pass the
+ **contract address** as `source_token` / `destination_token`, or fetch the live token list from
+ `/sources` and resolve by the `group` field. **Don't hard-code symbols, contract addresses, or
+ decimals — discover them.**
+
+
+```js
+const sources = await fetch("https://api.layerswap.io/api/v2/sources", {
+ headers: { "X-LS-APIKEY": process.env.LAYERSWAP_API_KEY },
+}).then((r) => r.json());
+
+// Resolve the USDT-family token on Arbitrum by its `group`, not its symbol —
+// this stays correct even though Arbitrum's USDT is now displayed as USDT0.
+const arbitrum = sources.data.find((n) => n.name === "ARBITRUM_MAINNET");
+const usdt = arbitrum.tokens.find((t) => t.group === "USDT");
+
+usdt.symbol; // "USDT0" → display label, may change
+usdt.contract; // "0x..." → stable identifier, use this as source_token
+```
+
+The full catalog is also browsable at [Networks & Tokens](/networks-tokens).
+
+## 2. Get a quote
+
+[`GET /api/v2/quote`](/api-reference/swaps/get-quote) returns the expected output, fees, and duration for
+a given `amount`, without creating a swap — provide the route plus an `amount`. Example response:
+
+```json
+{
+ "data": {
+ "quote": {
+ "receive_amount": 99.5,
+ "min_receive_amount": 98.5,
+ "total_fee": 0.5,
+ "total_fee_in_usd": 0.5,
+ "blockchain_fee": 0.15,
+ "service_fee": 0.35,
+ "avg_completion_time": "00:02:00",
+ "rate": 0.995,
+ "slippage": 0.5
+ }
+ }
+}
+```
+
+See [Fees](/fees) for how fees are composed.
+
+## 3. Create the swap
+
+[`POST /api/v2/swaps`](/api-reference/swaps/create-swap) creates the swap and returns it together with the
+`deposit_actions` you'll execute next. Choose **one** funding method:
+
+| Funding method | Set | Best for |
+| --- | --- | --- |
+| **Direct transfer** (default) | neither flag | Simple EOA wallets transferring to the solver |
+| **Deposit address** | `use_deposit_address: true` | Exchanges, custodial flows, users sending from anywhere |
+| **Depository contract** | `use_depository: true` | Aggregators; smart-contract, server, and programmable wallets — see [Depository](/api-reference/depository) |
+
+`use_depository` and `use_deposit_address` are mutually exclusive.
+
+```bash
+curl -X POST https://api.layerswap.io/api/v2/swaps \
+ -H "X-LS-APIKEY: $LAYERSWAP_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "source_network": "ARBITRUM_MAINNET",
+ "source_token": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
+ "destination_network": "BASE_MAINNET",
+ "destination_token": "USDC",
+ "destination_address": "0xRecipient",
+ "amount": 100,
+ "use_depository": true
+ }'
+```
+
+The response contains the created `swap` (with its `id` and `status`), the `quote`, and the
+`deposit_actions` array.
+
+## 4. Execute the deposit action
+
+A **deposit action** is the exact on-chain transaction to submit on the source chain. Read it from the
+swap response (or re-fetch via
+[`GET /api/v2/swaps/{swapId}/deposit_actions`](/api-reference/swaps/get-deposit-actions)):
+
+```js
+const action = swap.deposit_actions[0];
+// action.to_address, action.amount_in_base_units, action.call_data, action.network, action.token
+```
+
+How you submit it depends on the source chain — the `call_data` format differs per network (EVM calldata,
+a Bitcoin `OP_RETURN` memo, a Solana transaction, etc.). Follow the chain-specific guide:
+
+- **[Deposit Actions](/api-reference/deposit-actions/overview)** — per-chain execution (EVM, Bitcoin,
+ Solana, Starknet, TON, Tron, Fuel).
+- **[Depository](/api-reference/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 on-chain 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`](/api-reference/swaps/speed-up-deposit).
+
+## 5. Track the transfer
+
+Poll the swap to follow it to completion:
+
+- [`GET /api/v2/swaps/{swapId}`](/api-reference/swaps/get-swap-details) — the swap and its `transactions`
+ (`input` = your source deposit, `output` = the destination delivery).
+- [`GET /api/v2/swaps/by_transaction_hash/{transactionHash}`](/api-reference/swaps/get-swap-by-transaction-hash)
+ — look up a swap by its source transaction hash.
+
+A typical swap moves `user_transfer_pending` → `ls_transfer_pending` → `completed`. Other terminal states
+are `failed`, `expired`, `pending_refund`, and `refunded`. See the [Swap Lifecycle](/api-reference/swap-lifecycle)
+for every state and transition, and [Refunds](/api-reference/refunds) for failure handling.
+
+## Next steps
+
+
+
+ Execute the deposit on each supported chain.
+
+
+ Fund a swap by calling our on-chain contract.
+
+
+ Every swap state and how to react to it.
+
+
+ How quotes and fees are calculated.
+
+
diff --git a/snippets/depository-deposit-evm.mdx b/snippets/depository-deposit-evm.mdx
new file mode 100644
index 0000000..35195f4
--- /dev/null
+++ b/snippets/depository-deposit-evm.mdx
@@ -0,0 +1,25 @@
+```ts viem
+import { createWalletClient, custom, parseAbi } from "viem";
+
+// `swap` is the POST /api/v2/swaps response
+const action = swap.deposit_actions[0];
+const wallet = createWalletClient({ transport: custom(window.ethereum) });
+
+// ERC-20 only: approve the Depository (to_address) to pull the tokens.
+// The amount is the 4th depositERC20 argument, returned in encoded_args.
+if (action.token.contract) {
+ await wallet.writeContract({
+ address: action.token.contract,
+ abi: parseAbi(["function approve(address spender, uint256 amount) returns (bool)"]),
+ functionName: "approve",
+ args: [action.to_address, BigInt(action.encoded_args[3])],
+ });
+}
+
+// Submit the prepared depositNative / depositERC20 call exactly as returned
+await wallet.sendTransaction({
+ to: action.to_address, // the Depository contract
+ data: action.call_data,
+ value: BigInt(action.amount_in_base_units), // 0 for ERC-20, the deposit amount for native
+});
+```
diff --git a/snippets/depository-deposit-tron.mdx b/snippets/depository-deposit-tron.mdx
new file mode 100644
index 0000000..fc583b3
--- /dev/null
+++ b/snippets/depository-deposit-tron.mdx
@@ -0,0 +1,51 @@
+```ts TronWeb
+import { TronWeb } from "tronweb";
+
+// `swap` is the POST /api/v2/swaps response; PRIVATE_KEY signs the deposit
+const action = swap.deposit_actions[0];
+const [id, , receiverHex, amountHex] = action.encoded_args; // [id, token, receiver, amount]
+const amount = BigInt(amountHex).toString();
+
+const tronWeb = new TronWeb({
+ fullNode: action.network.node_url,
+ solidityNode: action.network.node_url,
+ privateKey: PRIVATE_KEY,
+});
+const sender = tronWeb.defaultAddress.base58;
+
+// encoded_args carry EVM-style hex addresses — convert the receiver to a Tron address
+const receiver = tronWeb.address.fromHex("41" + receiverHex.replace(/^0x/, ""));
+
+// 1) Approve the Depository (to_address) to spend the TRC-20 amount
+const approveTx = (
+ await tronWeb.transactionBuilder.triggerSmartContract(
+ action.token.contract, // TRC-20 token (base58)
+ "approve(address,uint256)",
+ { feeLimit: 100_000_000 },
+ [
+ { type: "address", value: action.to_address },
+ { type: "uint256", value: amount },
+ ],
+ sender,
+ )
+).transaction;
+await tronWeb.trx.sendRawTransaction(await tronWeb.trx.sign(approveTx));
+
+// 2) Call depositERC20(bytes32 id, address token, address receiver, uint256 amount)
+// on the Depository (wait for the approval to confirm first)
+const depositTx = (
+ await tronWeb.transactionBuilder.triggerSmartContract(
+ action.to_address, // Depository contract (base58)
+ "depositERC20(bytes32,address,address,uint256)",
+ { feeLimit: 100_000_000 },
+ [
+ { type: "bytes32", value: id },
+ { type: "address", value: action.token.contract },
+ { type: "address", value: receiver },
+ { type: "uint256", value: amount },
+ ],
+ sender,
+ )
+).transaction;
+await tronWeb.trx.sendRawTransaction(await tronWeb.trx.sign(depositTx));
+```