> For the complete documentation index, see [llms.txt](https://docs.algo724.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algo724.com/bot-strategies-and-creation/hedge-bot.md).

# Hedge Bot

The Hedge Bot is a powerful strategy designed to generate profit in **bearish (downtrending) or sideways markets**. Unlike "long" bots that buy first and sell later, the Hedge Bot works by selling an asset at a high price and aiming to buy it back at a lower price.

This bot operates using the **base currency** of a trading pair (for example, the ETH in an `ETH/USDT` pair).

<figure><img src="/files/1SJTXcjdluAR47A7xagW" alt=""><figcaption></figcaption></figure>

#### When to Use It?

The Hedge Bot is the ideal tool when you expect an asset's price to **decline or fluctuate within a range**. It can be used for two main goals:

1. To generate profit in the quote currency (e.g., USDT) from a price drop.
2. To increase your total holdings of the base currency (e.g., accumulate more ETH) by trading its volatility.

#### How It Works

The core logic of the Hedge Bot is simple: **sell high, buy low**.

1. **Initial Position**: The bot starts with a set amount of the base currency that you own (e.g., 1 ETH).
2. **Grid Setup**: It places a grid of sell orders *above* the current price and buy orders *below* the current price.
3. **Trading Cycle**: When the price rises to hit a grid line, a sell order is executed. The bot then waits for the price to fall to a lower grid line. When it does, the corresponding buy order is triggered, repurchasing the asset at a cheaper price and locking in a profit from the price difference.

**Note on Short Selling**: If you connect the bot to a margin or futures account and the initial asset is borrowed, this "sell high, buy low" process functions as an automated **short-selling** strategy.

#### Key Advantages

* **Profits in Bear Markets**: This is one of the few strategies that allows you to be profitable even when the market is in a downturn.
* **Accumulate Your Favorite Assets**: You can use the bot during volatile periods to strategically trade around your core position, with the goal of increasing your total coin holdings.
* **Capitalizes on Volatility**: It thrives in choppy, sideways markets by profiting from the frequent price swings.

#### Potential Drawbacks

* **Losses in a Strong Uptrend**: If the price rises significantly and does not return to the bot's grid, you will have sold your asset at what turned out to be a low price. In a true short-selling scenario, this could lead to significant losses if not managed carefully.
* **Requires Base Currency**: To run this bot, you must already own the base asset you wish to trade or have the ability to borrow it on your exchange.

#### Example Scenario

Imagine you hold **5 ETH**, and the current price is **$3,000**. You expect the price to be volatile and possibly trend down, so you launch a Hedge Bot.

1. The price rises slightly to **$3,050**, and your bot sells 1 ETH. You now have 4 ETH and the USDT equivalent of $3,050.
2. As you predicted, the market turns, and the price falls to **$2,950**.
3. The bot automatically buys back 1 ETH at this lower price, using $2,950 of the USDT it was holding.
4. **Result**: The trading cycle is complete. You still hold your original **5 ETH**, and you have an extra **$100 in profit** from the trade.

#### Configuration

The Hedge Bot comes with three presets to match your specific market outlook:

* **Sell high**: This preset is for when you believe the price is near a peak and will soon decline. It sets the **current price as the lower boundary** of its grid and places sell orders at higher price levels, patiently waiting for a final price spike before it starts selling.
* **Balance**: This is the ideal preset for a **sideways or ranging market**. It places the **current price in the middle** of the trading range, ready to immediately sell on small price increases and buy back on small price dips.
* **Bearish**: This is the most aggressive bearish preset. It's for when you believe the price will **drop immediately**. The bot will **sell a portion of the base currency right away** to enter a position, and then set up a grid to trade the subsequent price movements.
