# Auto-Swaps

### Why you should use it

* **Reduce exposure** to hot wallet balances
* **Automatically secure funds** in a on‑chain wallet (Hub on-chain wallet or cold storage)
* **Maintain receiving capacity** without manual intervention

{% hint style="info" %}
You define rules (threshold, swap amount and destination) and Alby Hub takes care of performing the swaps when the conditions are met.
{% endhint %}

### Use cases

* **Liquidity Management**\
  If you have very one-sided flows (mostly incoming, e.g. merchants) and want to maintain your receiving capacity (i.e. inbound liquidity)
* **Security & Risk management**\
  Automatically sweep exceeding funds to cold storage

### Example

1. Open the wallet page of Alby Hub and click the "Swaps" button
2. Switch to the "Swap out" tab and click the button "Auto-Swaps" at the top right
3. Configure auto-swap
   1. Destination (bitcoin address or xpub)
   2. Lightning Balance Threshold (the swap will be triggered by exceeding this amount)
   3. Swap Amount
4. Auto-Swaps will now be automatically performed, you'll see them show up in the transaction list

<figure><img src="/files/Pa4xbIZFz4GP8784sKZz" alt=""><figcaption></figcaption></figure>

* **Threshold**: 3M sats
* **Swap amount:** 2.5M sats
* **Destination**: Cold storage wallet (bitcoin address or xpub)

{% hint style="success" %}
Every time Lightning balance exceeds 3M sats, a new auto-swap is attempted with 2.5M sent to a bitcoin on-chain address, keeping a minimum of 0.5M sats in the hub for day-to-day usage
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.getalby.com/user-guide/alby-hub/node/auto-swaps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
