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

# Grid Trading

> Never heard of grid trading? This section explains everything from scratch.

***

## Think of a Market Trader

Imagine you sell apples at a farmers market. You notice the price fluctuates every day: Monday $1.00, Tuesday $0.90, Wednesday $1.10, Thursday $0.95.

Your strategy is simple:

* **Buy** when the price drops
* **Sell** when the price rises
* The difference between buying and selling is your profit

Grid trading is the **automated version of this strategy** applied to crypto — executing hundreds of these buy/sell cycles 24/7 without any human involvement.

***

## What is a "Grid"?

A grid is a **set of predefined price levels** at which buy or sell orders are automatically placed at regular intervals above and below the current market price.

### Simple Example

Suppose Bitcoin is trading at $100,000. We expect it to oscillate between $90,000 and $110,000 over the next month.

We place orders every $2,000:

```
Price        Action
─────────────────────────────────────────
$110,000    SELL  ↑
$108,000    SELL  ↑
$106,000    SELL  ↑
$104,000    SELL  ↑
$102,000    SELL  ↑
──────────── Current price: $100,000 ────
$98,000     BUY   ↓
$96,000     BUY   ↓
$94,000     BUY   ↓
$92,000     BUY   ↓
$90,000     BUY   ↓
```

Here is what happens next:

1. Price drops to $96,000 → **BUY** order at $96,000 fills
2. Price bounces back to $98,000 → **SELL** order at $98,000 fills
3. Profit: **$2,000** on that single round-trip
4. Orders are automatically re-placed at the same levels
5. The cycle repeats indefinitely

Each completed cycle is called a **grid interval**. More price oscillation = more cycles = more profit.

***

## What It Looks Like in Real Time

Here is a simplified simulation of one active trading day:

```
Time    BTC Price    Event
──────────────────────────────────────────────────────────────
09:00   $100,000     Strategy starts, all grid orders placed
09:45   $97,500      ✅ BUY filled at $98,000
10:20   $101,000     ✅ SELL filled at $100,000 → Profit $2,000
11:05   $97,000      ✅ BUY filled at $98,000
12:30   $103,000     ✅ SELL filled at $100,000 → Profit $2,000
                     ✅ SELL filled at $102,000 → Profit $2,000
14:00   $99,000      ✅ BUY filled at $100,000
15:45   $105,000     ✅ SELL filled at $100,000 → Profit $2,000
                     ✅ SELL filled at $102,000 → Profit $2,000
                     ✅ SELL filled at $104,000 → Profit $2,000
──────────────────────────────────────────────────────────────
End of day:    9 trades → $18,000 profit on $500,000 capital = ~3.6%
```

And all of this happens **with zero human input**. Fully automatic.

***

## Perpetual DEX: Where the Trading Happens

Gremlix runs grid strategies not on regular spot exchanges, but on **Perpetual DEX platforms** — decentralized exchanges for perpetual futures contracts.

### What is a Perpetual Contract?

Instead of buying real Bitcoin, you enter a **contract** that tracks Bitcoin's price. This offers several advantages:

| Advantage           | Explanation                                     |
| ------------------- | ----------------------------------------------- |
| **Leverage**        | $10,000 can control a $50,000–$100,000 position |
| **Short selling**   | You can profit even when prices fall            |
| **No custody risk** | No need to store actual BTC                     |
| **Deep liquidity**  | Large orders fill without significant slippage  |

### Why DEX Instead of a Centralized Exchange?

* **Transparency** — every trade is recorded on-chain
* **No KYC** — no identity verification required
* **Self-custody** — your funds are held by a smart contract, not a company
* **Points farming** — new DEXs reward traders for trading volume, adding a bonus yield layer

***

## Dual Grid: Trading Both Directions at Once

A standard grid buys and sells the same asset in one direction. The problem: if the market moves sharply in one direction without reversing, a one-sided strategy accumulates a losing position.

The Gremlix [USDC Vault](/docs/vaults/usdc-dual-grid-vault.md) solves this with a **Dual Grid** — running two grids simultaneously:

### Long Grid (profits from price going up)

```
Price moves UP ↑

$106,000  ← Close long (sell) → PROFIT
$104,000  ← Close long (sell) → PROFIT
$102,000  ← Close long (sell) → PROFIT
──────────── Current price: $100,000 ────────────
$98,000   ← Open long (buy)
$96,000   ← Open long (buy)
$94,000   ← Open long (buy)
```

### Short Grid (profits from price going down)

```
Price moves DOWN ↓

$106,000  ← Open short (sell without ownership)
$104,000  ← Open short (sell without ownership)
$102,000  ← Open short (sell without ownership)
──────────── Current price: $100,000 ────────────
$98,000   ← Close short (buy back) → PROFIT
$96,000   ← Close short (buy back) → PROFIT
$94,000   ← Close short (buy back) → PROFIT
```

### The Result: Profit in Any Direction

```
Market goes UP:    Long grid earns ✅   |  Short grid loses slightly ❌
Market goes DOWN:  Long grid loses slightly ❌  |  Short grid earns ✅
Market oscillates: Both grids earn ✅✅
```

The Dual Grid is a **pseudo-market-neutral strategy** — it does not bet on market direction, it profits from the existence of price movement itself.

***

## Advantages of Grid Trading

### ✅ 1. Passive Income — No Attention Required

Once configured, the strategy runs itself. No need to watch charts or make manual decisions. Gremlix fully automates this — you deposit USDC / BTC / ETH and your capital starts working immediately.

### ✅ 2. Profits From Volatility, Not Predictions

Most traders try to guess: will the price go up or down? Grid trading makes no such assumption. **The more the price bounces back and forth, the more profit is generated.** Volatility is the grid strategy's best friend.

### ✅ 3. Clear, Calculable Returns

Each completed grid interval delivers a fixed spread. Profitability can be estimated in advance based on:

* The width of each interval
* The number of trades executed per day
* The amount of capital deployed

This is **transparent mathematics**, not speculation.

### ✅ 4. Compounding Effect

Profit from each completed grid cycle is automatically added to the total capital in the vault. Each subsequent cycle runs on a slightly larger capital base — classic **compound growth**.

### ✅ 5. Accessible at Any Deposit Size

You do not need to be a whale. A small deposit gets access to the same institutional-grade strategies as large players. The vault mechanism pools capital efficiently regardless of individual size.

### ✅ 6. Bonus: DEX Points Farming

Every grid trade generates trading volume on the Perpetual DEX. That volume earns **protocol points** which convert to DEX tokens at their Token Generation Event (TGE). This is an additional yield layer on top of grid profits — entirely automatic.

***

## Disadvantages of Grid Trading

### ❌ 1. Performs Poorly in Strong Trends

Grid trading **dislikes straight-line price moves**. If Bitcoin rallies from $100,000 to $200,000 without any pullbacks:

```
Scenario: price moves sharply UP without reversing

Long grid:  Sold all positions on the way up → captured some profit, but...
            ...has nothing left to sell once price exits the range
Short grid: Opened shorts on the way up → all positions are losing
```

In this scenario the short leg of the dual grid accumulates unrealized losses. A prolonged, strong trend is the grid's worst enemy.

**How Gremlix mitigates this:** Operators monitor positions and rebuild the grid range when strong trends are detected. This *reduces* but does not eliminate the risk.

### ❌ 2. Price Can Leave the Grid Range

The grid operates within a specific price range. If price exits that range — **no new orders are placed** and the strategy is effectively paused until the range is reset by the operator.

```
Configured range: $90,000 – $110,000
Price moves to:   $130,000

→ Grid stops executing
→ Capital sits idle until operator rebuilds the range
```

### ❌ 3. Liquidation Risk on Perpetual Positions

Since the strategy uses leverage on a Perpetual DEX, an extreme sudden price move (flash crash or spike) could push open positions toward their liquidation level.

Gremlix uses conservative leverage and maintains a capital buffer, but this risk cannot be eliminated entirely.

### ❌ 4. Funding Rates Can Eat Into Profits

Perpetual contracts charge a **funding rate** — periodic payments between long and short traders based on market sentiment.

* In a bull market: longs pay shorts → the short grid leg receives extra income ✅
* In a bear market: shorts pay longs → the short grid leg pays extra ❌

Funding rates add an unpredictable layer to strategy profitability that must be monitored.

### ❌ 5. Trading Fees Accumulate

Every trade costs a fee (maker/taker). With hundreds of grid cycles per day, fees add up. The strategy must generate enough spread per interval to cover these costs.

Gremlix optimizes grid interval widths to ensure fees do not consume the profit margin.

### ❌ 6. DEX Counterparty Risk

Capital is deployed as margin on a third-party Perpetual DEX (HyENA, Ethereal etc.). If that DEX suffers a hack, technical failure, or becomes insolvent — funds could be at risk.

This is an inherent risk of any strategy that relies on external protocols, and cannot be fully eliminated through smart contract design alone.

***

## Comparison: Grid Trading vs. Other Strategies

| Strategy               | Profits from Trends | Profits from Sideways Market | Risk Level          | Passive?        |
| ---------------------- | ------------------- | ---------------------------- | ------------------- | --------------- |
| **Buy & Hold**         | Full ✅              | None ❌                       | Medium              | Fully passive ✅ |
| **Yield Farming (LP)** | Partial             | Medium                       | Impermanent loss ⚠️ | Passive ✅       |
| **Grid Trading**       | Partial             | Maximum ✅                    | Medium–High         | Fully passive ✅ |
| **Active Trading**     | Skill-dependent     | Skill-dependent              | Very High           | Active ❌        |
| **Staking**            | None ❌              | Low                          | Low ✅               | Fully passive ✅ |

**Grid trading sits between staking and active trading** — higher yield than passive staking, without the need to trade manually.

***

## Grid Trading Works Best/Worse

OPTIMAL: Sideways volatility.

<figure><img src="https://3603376872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgA9ZMNVOvkQvQDUuKgk%2Fuploads%2FOfy9cuUBtgj1nujTyDgo%2Fimage.png?alt=media&amp;token=8c7ed10b-7b69-4db1-ac14-b29e50dd4c96" alt=""><figcaption></figcaption></figure>

SUBOPTIMAL: Strong directional breakout.

<figure><img src="https://3603376872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgA9ZMNVOvkQvQDUuKgk%2Fuploads%2FmhE6FHLmr3c4rS6oW0gK%2Fimage.png?alt=media&amp;token=6d22a8bb-012a-4c15-8e25-d42b250975c8" alt=""><figcaption></figcaption></figure>

## Summary: Is Grid Trading Right for You?

**Grid trading through Gremlix is a good fit if you:**

* Want passive yield above staking rates without actively trading
* Hold USDC / BTC / ETH that would otherwise sit idle
* Understand that higher returns come with higher risk
* Are comfortable holding through temporary drawdowns during trending markets
* Want early-stage exposure to DEX points programs

**It may not be a good fit if you:**

* Expect guaranteed profits with zero risk
* Cannot afford temporary drawdowns on your capital
* Need to guarantee a profit on withdrawal at any moment
* Are not comfortable with the risks of Perpetual DEX leverage

***

> **Remember:** Grid trading is a mathematically sound strategy with a proven track record on traditional markets. However, crypto markets are more volatile, and no strategy is risk-free. Always deposit only what you can afford to lose.
