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

# Automation & AI Agents

Set it and forget it. Deploy agents that run your position 24/7 - earning, repaying your debt, refinancing to cheaper rates, and stepping in before liquidation.

***

## 🤖 What is Automation?

**AI-powered agents** that work tirelessly on your DeFi positions while you sleep, work, or enjoy life.

### What the automation actually does

Depending on the agent you deploy, some or all of the following run continuously without you:

|                                | What it does                                                                                                                                                                                                  | Which agents                    |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| 🔁 **Self-repayment**          | Harvests trading fees from your liquidity position and pays them onto your debt                                                                                                                               | Self Repay, Range Hunter        |
| 📊 **Position management**     | Re-checks the market hourly and moves your liquidity out of the pool when the signal turns against your position, then back in once conditions settle                                                         | Self Repay, Yield, Range Hunter |
| 🗓️ **Weekly review**          | Re-scores your position at the Friday options expiry. It keeps the position, or moves it to cash if the signal is risk-off or the position is more than 15% underwater. It does **not** re-centre your range. | Self Repay, Yield               |
| 💱 **Refinancing**             | Moves your debt to a cheaper protocol when the saving beats the gas                                                                                                                                           | Looper, Arb, Range Hunter       |
| 🛡️ **Liquidation protection** | Unwinds part of your position before it can be liquidated                                                                                                                                                     | Every agent that carries debt   |
| 📉 **LP loss limit**           | Closes the liquidity position to cash if it falls more than **15%** below what went in                                                                                                                        | Self Repay, Yield, Range Hunter |

> **What happens if the price leaves your range?** The position is **held**, not sold. It stops earning fees until the price comes back or the signal moves it to cash. Leaving the range is not by itself a reason to exit - the signal decides that, and the 15% loss limit above is the backstop.

> **What happens after the loss limit fires?** The agent stays in **cash until the next Friday** before it will open a new position. That is between one and seven days depending on which day the limit was hit, and a full week if it was hit on a Friday. It is deliberate: the point is not to re-enter immediately after taking a loss. During that window the agent will decline to re-enter even if its signals say conditions have improved, and your activity log will say so. Your funds are in your own wallet the whole time and you can withdraw at any point.

[**See all of this running on real positions →**](https://ratehopper.ai/showcase)

### The self-repaying loop

For the LP Agent - the flagship - the cycle is:

1. **You deploy the agent** with your collateral, chosen strategy and range width
2. **It borrows and opens a liquidity position** with the proceeds
3. **The position earns trading fees** from traders using the pool
4. **The agent harvests those fees and repays your debt** with them
5. **Repeat**, indefinitely, while it also manages the range and guards against liquidation

Small harvests are deliberately skipped: below roughly **$0.10** of collectable fees, or when gas is expensive relative to its recent range, collecting would cost you more than it recovers.

#### What counts as "earned"

Money reaching your debt arrives by three different routes, and only two of them are income:

| Route                                                                                      | Is it earnings?                                            |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **Trading fees** harvested from the position                                               | **Yes.** This is the income the self-repaying loop runs on |
| **Gain** on the position's value above what went in                                        | **Yes**, once realised                                     |
| **Returned capital** - the money you originally put in, coming back when a position closes | **No.** It is your own capital returning, not profit       |

We separate the three at the moment each repayment is made, rather than inferring it afterwards from your wallet balance. That distinction matters more than it sounds: after a position closes and re-opens, returned capital sitting in the wallet is indistinguishable from harvested fees by size alone, and counting it as income would overstate earnings substantially.

So the earnings figures shown to you count harvested fees and realised gain. They do **not** count capital coming back.

***

## Why Use Automation?

### The Problem with Manual Management

**Manual position management is exhausting:**

* ⏰ **Time-consuming** - Checking rates multiple times daily
* 😴 **You sleep** - Rates change while you're offline
* 📉 **You miss opportunities** - Best rates don't wait for you
* 🧠 **Mental load** - Constant worry about missing better rates

### The Automation Solution

**Agents never sleep:**

* ✅ **24/7 Monitoring** - Always watching, always ready
* ✅ **Instant Action** - Execute switches within minutes
* ✅ **No Emotions** - Purely data-driven decisions
* ✅ **Peace of Mind** - Stop worrying, start earning

***

## Agent Types

Four agent types you can deploy yourself today, plus two more covered further down:

### Looper Agent (Rate Optimizer)

The primary automation agent that creates leveraged looping positions and:

* Monitors borrowing rates across all supported protocols
* Compares against your current position
* Calculates if switching would save money (after gas costs)
* Executes switches automatically when profitable
* Supports **in-app position closing** via flash loan unwinding

### Arb Agent

Exploits rate differences between protocols:

* Borrows at low rates on one protocol, lends at higher rates on another
* Automated rate monitoring and rebalancing
* Supports **in-app exit** (vault withdrawal, debt repayment, collateral return)
* Supports **Auto-Exit / Liquidation Protection** via Zodiac Roles module

### LP Agent

AI-powered liquidity provision:

* Natural language interface for creating LP positions
* Auto-calculates optimal token amounts from real-time pool data
* Supports Uniswap V3 on Base
* Supports **in-app exit** for LP positions
* Supports **Auto-Exit / liquidation protection** via Zodiac Roles module

### Custom Agent

Create a guided custom borrowing position directly in Ratehopper:

* Choose protocol (Aave V3, Compound V3, Morpho, or Fluid)
* Use ETH as collateral and USDC as debt asset
* Set borrow percentage and execute through Safe

### Managed USDC LP Agent

A liquidity position opened **straight from your own cash, with no borrowing at all**:

* Same automated LP management as the Self Repay Agent - it enters and exits for you
* No loan, so no interest to pay and **no liquidation risk**
* The simplest way in if you want the yield without the leverage

**Available now.** Deploy one at [ratehopper.ai/earn](https://ratehopper.ai/earn). During beta there is a **1,000 USDC** deposit cap per agent. It also remains available through our AI-to-AI partner integrations.

The Managed USDC LP Agent runs in its **own wallet**, separate from any Safe you already have. Each agent is keyed to its own wallet and its type is fixed when created, so a wallet already running a borrow-based agent cannot also run this one. You are the sole owner of both.

### Range Hunter - the contest

A competitive version of the LP Agent. You mint a Range Hunter NFT, your agent runs for **10 days**, and agents are ranked by how fast they pay down their debt. The fastest take the largest share of an ETH prize pool. Each NFT carries one of five risk personalities, from The Tortoise (cautious) to The Ratehopper (most aggressive).

[**Enter Range Hunter →**](https://ratehopper.ai/contest-onboarding) · [**See the leaderboard →**](https://ratehopper.ai/contest-leaderboard)

***

**Supported Protocols:**

* Aave V3
* Compound V3
* Morpho
* Moonwell
* Fluid
* Uniswap V3 (Self Repay and Managed USDC LP agents); support for further venues is in progress

***

## Setting Up Your First Agent

### Step 1: Deploy Agent

1. Go to **Dashboard** and open your Safe wallet page
2. If you have no active position, use the **Deploy Agent** cards
3. Select an agent type (the **LP Agent** is the usual starting point - it's the self-repaying one)

### Step 2: Configure Settings

**Agent-specific setup examples:**

* **LP Agent** - Choose collateral and borrow amount, a **signal version** (*Adaptive Exit* recommended) and a **range width**, then execute the setup transaction
* **Looper Agent** - Select collateral/debt and leverage, then execute the setup transaction
* **Arb Agent** - Select borrow protocol + vault flow via chat, then execute the setup transaction
* **Custom Agent** - Configure ETH collateral / USDC debt parameters in the setup dialog
* **Range Hunter** - Nothing to configure. Your leverage, range width and signal version are rolled from your NFT's personality at mint

Your signal version and range width are stored on the agent itself, so they survive exit-and-re-enter cycles - you set them once, not every time the agent repositions.

### Step 3: Fund and Activate

1. Ensure your Safe has required token balances and ETH for gas
2. **Sign Transaction** in-app
3. **Execute Transaction** through your Safe flow
4. Confirm your new position appears on your wallet page

### Step 4: Turn on liquidation protection

If your agent carries debt, enable **Auto-Exit** when prompted. This is the thing that unwinds your position before it can be liquidated - see below. Managed USDC LP Agents skip this step: with no debt, there is nothing to be liquidated against.

***

## Exiting Positions

Each agent type has a built-in exit flow:

**Looper Agent:**

1. Navigate to your Dashboard
2. Click **"Close Position"** on your position card
3. The system uses flash loans to atomically unwind the entire leveraged position
4. Funds are returned to your Safe wallet

**Arb Agent:**

1. Open the Arb Agent chat
2. Click **"Exit My Position"** or type "exit"
3. Review the exit summary and click **"Confirm Exit Position"**
4. The agent handles vault withdrawal, debt repayment, and collateral return

**Self Repay Agent / Managed USDC LP Agent:**

1. Open the LP Agent chat
2. Click **"Exit My Position"**
3. Confirm the exit and sign the transaction

**Range Hunter:** No action needed. Your agent is wound down automatically at the end of the 10-day window and your final score is frozen. You then collect your funds back to your own wallet from the contest dashboard.

> Exiting is always available to you. The agent repositioning in and out of the pool on its own is a different thing entirely - that's routine management, not an exit, and your capital stays in the position throughout.

***

## Auto-Exit / Liquidation Protection

**Applies to every agent that carries debt** - LP, Range Hunter, Arb, Looper and Custom. It does **not** apply to the Managed USDC LP Agent, which has no debt to be liquidated against.

1. Trigger setup:
   * **LP Agent:** click **"Set up auto exit"** in chat options
   * **Arb Agent:** type **"set up auto exit"** in the agent chat
   * **Range Hunter:** already configured for you at activation
2. A **Zodiac Roles module** is deployed on your Safe with limited permissions
3. Configure your risk parameters:
   * **Trigger LTV** - the loan-to-value level at which protection fires (recommended 5-10% below your protocol's liquidation threshold)
   * **Repay percentage** - how much of the debt to repay when it fires
4. When your LTV crosses the trigger, the system repays part of your debt to pull you back to safety
5. This runs 24/7, whether or not you're online

**What it is not:** a notification. Auto-Exit acts on your position rather than alerting you and hoping you're awake to respond. If you want to *also* be told, connect [Telegram](/features/notifications.md) - auto-exit events are in the activity feed.

See [Agent Actions - Auto-Exit](/features/agent_actions.md#auto-exit--liquidation-protection) for full details, including exactly what the Zodiac Roles module can and cannot do on your Safe.

***

## Agent Management

### Monitoring Your Agents

**Dashboard View:**

* Agent status (Initializing, Active, Paused, Closed, Error)
* Your current position value and outstanding debt
* **Total debt repaid** - what the agent has cleared for you so far
* Active LP and open debt positions
* Whether liquidation protection is on

**Activity Log:**

Every decision the agent makes is recorded against your position, so nothing happens invisibly:

* Entering and exiting the liquidity pool, with the reason
* Fees harvested and repaid onto your debt
* Auto-exit evaluations and triggers
* Debt swaps proposed and executed
* The weekly Friday review
* Success/failure status and transaction hashes

### Adjusting Agent Settings

You can modify anytime:

* Signal version and range width (LP agents)
* Auto-exit trigger LTV and repay percentage
* Rate thresholds and allowed protocols (refinancing agents)
* Notification preferences

**When to Adjust:**

* Your risk tolerance changes
* You want the agent in and out of the pool more or less readily
* Gas fees are consistently high
* Market conditions change

> Range Hunter agents are the exception - their settings are fixed for the duration of the contest, which is what keeps the competition fair.

### Pausing or Stopping Agents

**Pause:**

1. Go to agent dashboard
2. Click "Pause Automation"
3. Agent pauses but position remains
4. Resume anytime

**Stop Agent:**

* Permanently deactivate
* Remove approvals
* Free up gas reserve

**When to Pause:**

* High gas fee periods
* Major protocol upgrades
* Market volatility
* Personal preference

***

## Safety & Security

### How Agents Are Secure

**Non-Custodial:**

* Agents never hold your funds
* All funds stay in protocols
* You maintain full ownership

**Limited Permissions:**

* Can only switch between approved protocols
* Cannot withdraw to other addresses
* Cannot change your positions beyond switching

**Safe Module (Optional):**

* Additional approval layer
* Multi-signature capability
* Emergency pause function

### Best Security Practices

✅ **Start Small:**

* Test with smaller positions first
* Verify agent works as expected
* Scale up gradually

✅ **Use Safe Module:**

* Enable for large positions
* Adds approval requirement
* Extra peace of mind

✅ **Monitor Regularly:**

* Check dashboard daily
* Review all switches
* Pause if anything seems wrong

✅ **Keep Gas Reserve:**

* Ensure enough ETH for switches
* Agent may pause if insufficient
* Monitor and refill

***

## Troubleshooting

### My debt hasn't gone down yet

**Possible Reasons:**

1. **The position is new.** Figures can take up to \~24 hours to fully index after an agent starts
2. **Fees haven't reached the collection floor.** Harvests below roughly **$0.10** are skipped deliberately - collecting would cost more gas than it recovers
3. **Gas is expensive right now.** The collector waits for gas to fall back within its recent range
4. **Your agent is currently out of the pool.** If the signal has stepped it aside while the market turns risk-off, it isn't earning fees during that time - by design

**What to do:** check the activity log. Every collection decision is recorded there, including the ones that were skipped and why.

### Agent Not Switching (refinancing agents)

**Possible Reasons:**

1. No better rates available
2. Rate improvement below threshold
3. Gas fees too high
4. Insufficient ETH for gas
5. Protocol liquidity issues

**Solutions:**

* Lower rate threshold slightly
* Add more ETH to your Safe
* Check agent logs for details

### My agent keeps entering and exiting the pool

That's the strategy working, not a fault - particularly on **Adaptive Exit (v12)**, which re-checks hourly and deliberately steps aside when its risk signals turn against the position. If you'd prefer fewer moves, **Low-Churn (v8)** holds through most market moves instead. You can change your signal version from your agent settings.

### Unexpected Switches

**Why it might happen:**

* Rates changed rapidly
* Gas fees dropped suddenly
* Your settings allow it

**What to do:**

* Review agent settings
* Adjust thresholds if needed
* Check logs for reasoning
* Contact support if confused

### Agent Paused Automatically

**Common Causes:**

* Insufficient gas
* Protocol temporary issues
* Safety mechanism triggered
* Error in execution

**Resolution:**

* Check notifications
* Review error logs
* Fix underlying issue
* Reactivate when ready

***

## Pricing

### Agent Costs

**Deployment:** Free **Monitoring:** Free **Execution:** Gas, plus Ratehopper's fees on managed liquidity positions

**What You Pay:**

* Standard blockchain gas fees
* Protocol fees (normal DeFi fees)
* Ratehopper fees, only on liquidity positions the agent manages: 2.5% of the trading fees it harvests, and 10% of the profit above cost basis when a position is closed (nothing if it closes at a loss). Rate switching, the Looper Agent and liquidation protection carry no Ratehopper fee. See [What fees does Ratehopper charge?](/support/faq.md#what-fees-does-ratehopper-charge)

**What to expect in practice**

Costs and savings depend on your position size, how volatile rates are, and what gas is doing - so rather than quote an average that won't match your position, we publish live agents you can inspect yourself.

[**See live agents on the showcase →**](https://ratehopper.ai/showcase)

These are real positions running on Base right now, with their tracked figures: what they've deployed, what they've earned in trading fees, and how much debt they've paid down. Every one is verifiable on-chain.

***

## Agent FAQ

**Q: What if I want to withdraw while agent is active?** A: You can withdraw anytime. For full in-app unwind flows use Agent Actions exit options. For manual protocol-level flows, follow our [Manual Withdrawals Guide](/advanced/manual_withdrawals.md) and [Unwinding Positions Guide](/support/unwinding_positions.md).

**Q: Can I have multiple agents on one position?** A: No, one agent per position to avoid conflicts.

**Q: What happens if a protocol gets hacked?** A: Agents only use well-audited protocols, but you should monitor your positions and maintain appropriate insurance/risk management.

**Q: Can I see what the agent will do before it does it?** A: The managed LP strategies act on their own so your position isn't left exposed while waiting for a signature - that's the point of the automation. Every action is recorded in the activity log with its reasoning, and you can watch agents running live on the [showcase](https://ratehopper.ai/showcase) before deploying your own.

**Q: Do I have to fund the repayments myself?** A: No - that's the whole idea. The agent harvests trading fees from your liquidity position and pays them onto your debt. You can always repay more manually if you want to clear it faster.

**Q: What happens if my position stops earning?** A: The loan stops shrinking, but nothing bad happens on its own. Interest continues to accrue, so the debt can grow again if the position sits idle - which is why the signal steps back into the pool once conditions improve, and why liquidation protection runs regardless.

**Q: Can I change my strategy after deploying?** A: Yes, for LP agents - your signal version and range width can be updated from your agent settings, and they persist across exit-and-re-enter cycles. Range Hunter agents are fixed for the duration of the contest.

***

## Next Steps

Ready to automate?

1. [**Getting Started Guide**](/introduction/getting_started.md) - Learn how to deploy your first agent
2. [**Rate Comparison**](/advanced/rate_comparison.md) - Compare rates before automating
3. [**Join community**](/support/contact.md) - Share your results

***

**Want maximum returns with minimum effort?** [Deploy an agent now →](https://ratehopper.ai/dashboard)
