> For the complete documentation index, see [llms.txt](https://docs-processing.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-processing.crypto-chief.com/sweeps/overview.md). Agents can also search and read this documentation through its [MCP server](https://docs-processing.crypto-chief.com/~gitbook/mcp).

# Overview

A sweep moves funds from a deposit wallet to its bound master wallet.

### Why there are two wallets

A customer pays into a **static wallet** assigned to them or a **transit wallet** issued for one invoice. Once the sweep confirms, those funds are available on the **master wallet** for payouts.

{% hint style="info" %}
A deposit webhook confirms the customer’s payment. A sweep webhook confirms that an asset reached your master wallet. [Sweep Webhook](https://docs-processing.crypto-chief.com/webhooks/sweep-webhook.md)
{% endhint %}

***

### When a sweep happens

Three things trigger one:

| Trigger       | What causes it                                                                                                                                                                                                   |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **momentum**  | A deposit arrives and is swept straight away.                                                                                                                                                                    |
| **threshold** | A balance is left to accumulate and swept once it crosses a USD figure. Re-checked about every half hour while an asset is below the bar, so a sweep can be triggered by a price move rather than a new payment. |
| **force**     | You ask for it, through [Force Sweep](https://docs-processing.crypto-chief.com/sweeps/force-sweep.md). This bypasses the policy, including `turned_off`.                                                         |

The policy is set per project and can be overridden per wallet — see [Auto-Sweep Settings](https://docs-processing.crypto-chief.com/sweeps/auto-sweep-settings.md). A wallet on `turned_off` is never swept automatically and can still be swept on demand.

***

### What actually happens

A sweep is queued work, not a synchronous transfer. From the moment it is triggered:

1. **The destination is resolved.** The master wallet bound to that deposit wallet is looked up **at sweep time**, not when the sweep was requested.
2. **Assets are enumerated — tokens first, native coin last.** Deliberately in that order: the native coin pays for the token transfers, so sending it away first would strand them.
3. **Each asset is checked for gas.** A wallet holding only USDT cannot pay for its own transfer. If it cannot, the sweep pauses at `waiting_gas` while the wallet is funded, and the transfer happens on a later pass — see below.
4. **The transfer is broadcast.** The full balance of the asset is moved; there is no partial sweep.
5. **The platform waits for confirmations.** The sweep is re-checked every few minutes and stays `broadcasted` while `sweep_confirmations` grows. Only when it reaches `required_confirmations` is the sweep `completed`.
6. **You are notified** — see [Knowing a sweep happened](#knowing-a-sweep-happened).

Steps 2 to 5 repeat per asset, so one wallet with three tokens produces three sweep records, not one.

**What is left behind.** A native-coin sweep pays its own network fee out of the amount being moved, so the balance does not reach zero. On **XRP** and **TON** an account reserve is also held back, because emptying the account entirely would close it.

### Sweeping an external wallet

If your deposit wallet is external, both automatic and forced sweeps send `wallet.signature.requested` to its signer. An ERC-20 sweep on Ethereum can require two transactions signed by the deposit wallet, one for the token and one for the remaining ETH. The receiving master can be internal or external. [Signing requests and responses](https://docs-processing.crypto-chief.com/managing-wallets/external-wallets.md)

If your external master supplies the gas, its signer also receives a request for the native-coin transfer from the master to the deposit wallet. If CryptoChief supplies the gas, CryptoChief signs that top-up.

***

### Gas: why a wallet cannot always pay for its own transfer

Moving a token costs the chain's native coin, and a deposit wallet that has only ever received USDT has none. The platform funds it first — a separate on-chain transfer recorded as `gas_pump_tx_hash` on the sweep.

Who provides that funding is the **fee mode**, set per project and overridable per wallet:

| `fee_mode` | Who funds the gas                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------------------- |
| `client`   | The merchant's own master wallet.                                                                       |
| `service`  | The platform, reimbursed in API credits.                                                                |
| `mix`      | **The default.** Tries `client` first and falls back to `service` if the master wallet cannot cover it. |

If the deposit wallet already holds enough native coin, it pays for itself and none of this applies, whatever the mode.

On **TRON** a transfer needs energy rather than a coin balance, and the platform can supply it for the moment of the transfer instead of sending TRX to be burnt — usually far cheaper. Which of the two is used is the `gas_source` setting, also on [Auto-Sweep Settings](https://docs-processing.crypto-chief.com/sweeps/auto-sweep-settings.md). The cost is billed to your API credits in every `fee_mode`.

***

### What a sweep costs

* **Sweep operation.** A forced sweep incurs the operation fee when the API accepts the request. An automatic sweep incurs it once per task when an asset transfer completes. [Billing Model](https://docs-processing.crypto-chief.com/getting-started/billing-model.md)
* **Gas reimbursement.** When a service wallet supplies gas, the platform converts the confirmed network fees for the top-up and sweep transactions into API credits, including the gas markup. Each transaction hash counts once. There is no gas debit while the sweep is `waiting_gas`. A confirmed EVM transaction that reverts can still incur a fee.

`total_fee_usd` on each sweep record includes the top-up fee, the transfer fee and any TRON energy rental for that asset. It uses estimates where the chain has yet to report a fee. Use your credit history to reconcile the operation fee and gas reimbursement.

{% hint style="warning" %}
This is why sweeping dust is worth avoiding: the cost of a sweep does not scale with the amount moved, so consolidating $3 can cost a meaningful fraction of it. If that is showing up in your numbers, the answer is the `threshold` policy, not fewer sweeps.
{% endhint %}

***

### Knowing a sweep happened

A `sweep.confirmed` webhook identifies the asset, amount and transaction that reached the master wallet. If the task sweeps both a token and the native coin, it can produce two events with the same `task_id`. [Sweep Webhook](https://docs-processing.crypto-chief.com/webhooks/sweep-webhook.md)

[**Sweep History**](https://docs-processing.crypto-chief.com/sweeps/sweep-history.md) is the record, for reconciliation and for looking at a sweep still in flight. It includes checks that did **not** sweep: a skipped row carries its reason, for example `below threshold: $37.20 < $100.00`, so "still accumulating" is distinguishable from "not working".

Do not poll history in a loop waiting for a confirmation — those calls are billed, and the webhook already tells you.

***

### In this section

* [Force Sweep](https://docs-processing.crypto-chief.com/sweeps/force-sweep.md) — trigger one on demand.
* [Sweep History](https://docs-processing.crypto-chief.com/sweeps/sweep-history.md) — every sweep on the project.
* [Sweep History by Wallet](https://docs-processing.crypto-chief.com/sweeps/sweep-history-by-wallet.md) — the same, for one address.
* [Auto-Sweep Settings](https://docs-processing.crypto-chief.com/sweeps/auto-sweep-settings.md) — read and write the policy, per wallet.
