# Grid bot

> Range trading on the BotRadix DEX, Hyperliquid and Uniswap: levels, profits and risks.

Source: https://docs.botradix.com/grid/

Grid is a range-trading bot. It places a ladder of price levels around a reference price and trades each crossing: it sells into rises and buys into falls, so it earns from price oscillating inside the range.

You will find it under **Grid**, at [botradix.com/Grid](https://botradix.com/Grid) (the old `/GlobalPendingOrders` address redirects there).

## How the levels are built

The bot takes an anchor price (normally the market price when the grid starts) and builds geometric levels above and below it:

```text
level n = anchor × (1 + spacing)^n        n = …, −2, −1, +1, +2, …
```

Levels above the anchor are funded with the base asset and levels below with USDC (the quote asset). A small hysteresis prevents a tiny bounce from immediately reversing a level that was just traded.

**Example.** With an anchor of 100, a spacing of 1% and 3 levels per side, the levels are approximately 101, 102.01 and 103.03 above, and 99.01, 98.03 and 97.06 below.

## Where it runs

| Venue | Market type | Notes |
|---|---|---|
| BotRadix DEX (default) | Perpetual futures on Base | Runs through your DEX API key. Each level needs at least 18.10 USDC. Cross pairs are built from two USDC legs |
| Hyperliquid | Perpetual futures | Leverage, long or short direction. At least 16 USDC per level |
| Uniswap (Base) | Spot | 1x, spot only. Spacing of at least 2.30% |

On asset/USDC markets the bot keeps a mesh of resting orders on the venue. On two-asset synthetic pairs it places no resting orders: each level crossing confirmed by PairForge rotates both legs.

## Parameters

| Parameter | Default | Range and notes |
|---|---|---|
| Total amount | 1,000 USDC | Split across the levels |
| Leverage | 5 | 1 to 50; fixed at 1x on Uniswap |
| Spacing | 0.5% | 0.05% to 25%; at least 2.30% on Uniswap |
| Levels per side | 4 + 4 | 1 to 100 per side; up to 59 in total on Uniswap |
| Direction | Long | Long or short; Uniswap is spot |

If the amount per level would fall below the venue minimum, the bot automatically uses fewer levels.

## How profit is calculated

The bot keeps an average-cost inventory per asset:

- **Realized profit** on each reduction = (price − average cost) × quantity (reversed for short grids), minus fees.
- **Unrealized profit** = (current price − average cost) × open quantity.

## Managing a running grid

| Action | Effect |
|---|---|
| Activate / Update | Starts the grid or applies new parameters |
| Stop | Stops trading. **Existing positions and inventory are not closed** |
| Close inventory | Closes only the inventory that belongs to this grid |
| Delete | Removes the grid configuration |

Only one live automation can run per asset and venue; Quant and Grid cannot automate the same asset on the same venue at the same time.

The trash button of the Positions panel does the same as **Close inventory** and, once the venue confirms the position at 0, removes the grid. See [History, PnL and exports](https://docs.botradix.com/history/#trash-close-and-remove-an-open-position).

## Access

Grid availability depends on your access tier (see [BAQ](https://docs.botradix.com/baq/#access-tiers)). On the BotRadix DEX, one grid is included in the free tiers.

## Risks to understand

- In a strong trend the grid keeps buying into a falling market (or selling into a rising one) and accumulates inventory on the losing side.
- With leverage, accumulated inventory can be liquidated.
- Every trade pays fees; very tight spacing can produce many trades whose fees exceed the captured moves.
- Stopping a grid does not reduce your exposure; close the inventory if you want to exit.
- See [Risks](https://docs.botradix.com/risks/) for the complete list.
