> For the complete documentation index, see [llms.txt](https://liquify-6.gitbook.io/liquify-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liquify-6.gitbook.io/liquify-docs/using-liquify/automation.md).

# Automation

### How Automation Works

When liquidity providers enable auto-refill, their positions need external processing to:

1. Claim XRD from matured stake claim NFTs
2. Deduct the automation fee
3. Re-add the remaining XRD as liquidity

Anyone can process these transactions on behalf of the liquidity owner and earn the automation fees!

### Understanding Thresholds

**Refill Threshold**: The minimum XRD amount that must be claimable before a position can be processed.

Example:

* Position has 50,000 XRD liquidity
* Refill threshold set to 49,900 XRD
* When 49,900+ XRD becomes claimable from stake claims, it appears in automation queue
* Anytime liquidity is increased such as this, its position is reset to the back of of the queue at that same discount

### Navigate to Automation

Click the **Automate** tab to view positions ready for processing.

<figure><img src="/files/3QgHtNs1HIdqoko5JRsl" alt=""><figcaption></figcaption></figure>

### Automation Queue

The queue shows:

* **ID**: Receipt number
* **Discount**: Position's discount rate
* **Claimable**: XRD ready to claim
* **Fills**: Number of stake claims to process
* **Reward**: Your fee for processing

### Select Positions

1. Click positions to select them (or use "Select All")
2. Selected positions show a checkmark
3. Total reward updates at the bottom

### Process Automation

1. Review selected positions and total reward
2. Click "Process X Receipts for Y XRD"
3. Approve the transaction
4. Receive automation fees immediately

### Limitations

The number of receipts that can be  processed is entirely dependent on the total number of fills that each receipt has.  In order to ensure transactions do not fail from exceeding maximum number of events,&#x20;

```rust
max_fills_per_cycle
```

&#x20;is an updatable variable in component state and currently set to 50 fills per transaction.  It is possible to collect multiple receipts and automation fees in a single transaction as long as the sum of the fills involved is less than this value.  It is also possible to only collect an receipt's fills partially if a single receipt has > 50 fills.

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