> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantumvoid.org/llms.txt
> Use this file to discover all available pages before exploring further.

# GLFT Optimal Market Maker

> Academic optimal quoting strategy based on Gueant-Lehalle-Fernandez-Tapia equations

# GLFT Optimal Market Maker

## What It Does

**GLFT quotes both sides of the order book around fair value, earning the spread while keeping inventory in check.** Where the [Perp Market Maker](/strategies/perp-market-maker) uses hand-tuned rules, GLFT computes its bid and ask placement from the **Gueant–Lehalle–Fernandez–Tapia** model — a closed-form solution from academic market-making research. Quotes automatically widen when volatility rises and skew to shed inventory when a position builds up, with far fewer knobs to turn.

In plain terms: the bot continuously asks "given how jumpy this market is, how often orders are arriving, and how much inventory I'm already holding, what is the mathematically best price to bid and ask right now?" — and re-answers that question twice per second.

<Warning>
  GLFT is in **ALPHA**. It is fully functional, but parameter defaults may evolve as production data accumulates. Start with a conservative preset and small sizes.
</Warning>

***

## How It Works

### The GLFT engine

The engine derives optimal bid/ask offsets from mid-price using three live inputs:

```
      ┌─────────┐      ┌───────────┐      ┌─────────┐
      │  Gamma  │      │   Sigma   │      │  Kappa  │
      │  (risk  │      │ (realized │      │ (order  │
      │aversion)│      │volatility)│      │ arrival)│
      └────┬────┘      └─────┬─────┘      └────┬────┘
           └─────────────────┼─────────────────┘
                             ▼
                   Optimal spread calculation
                             │
              ┌──────────────┴──────────────┐
        BID: mid − δb                 ASK: mid + δa
              (both skewed by current inventory)
```

* **Gamma** (risk aversion, default 0.01) — how strongly the engine penalizes holding inventory. Higher gamma → wider spreads, smaller positions.
* **Sigma** (realized volatility) — measured from recent prices. More volatility → wider optimal spreads.
* **Kappa** (order arrival rate) — estimated from order-book liquidity and refined by the Cartea–Jaimungal trade-intensity estimator. Busier books → tighter spreads, because fills come faster.

### Inventory skew

The model's key property: **quotes become asymmetric as inventory builds.**

```
NEUTRAL (q = 0):                 LONG inventory (q > 0):

  ASK: $100.08                     ASK: $100.05  ← tighter (eager to sell)
  MID: $100.00                     MID: $100.00
  BID: $99.92                      BID: $99.90   ← wider (reluctant to buy more)
```

The strategy works its own inventory back toward zero without manual rules.

***

## Key Features

* **Regime detection** — ADX-based classification (ranging / trending / volatile) scales gamma: tighter quoting in ranges (0.7x), defensive against-trend quoting (1.5x), wider in volatile regimes (1.3x)
* **Grid breathing** — spacing widens with drawdown (base 150 bps) and each side (long/short) breathes independently on its own P\&L, with smoothing so transitions don't whipsaw
* **Mantis spread** — composite microstructure signal (book imbalance + aggressor trade flow + Cartea–Jaimungal arrival estimate) that shades the quotes
* **Squeeze detection** — monitors funding extremes and open-interest shifts for squeeze conditions
* **Inventory TP** — take-profit targets tighten exponentially as inventory grows: small positions wait for full profit, large ones exit faster
* **Time decay** — TP targets decay on positions older than 15 minutes; maximum-hold times depend on regime (320 min ranging / 240 volatile / 120 trending)
* **Dynamic sizing** — quote size scales between a base and max ($10→$15 conservative, $25→$50 BloFin aggressive) with conditions
* **S/R snapping** — quotes snap up to 5 bps to nearby order-book walls (≥ \$500) so they rest behind real liquidity
* **Multi-symbol** — one bot instance runs up to 5 symbols (multi presets ship with BTC, ETH, SOL, SUI, XRP), each with independent state and recovery

***

## Supported Exchanges

<CardGroup cols={2}>
  <Card title="BloFin" icon="building-columns">
    * Requires API key, secret, and **passphrase**
    * Configured fees: maker 2 bps, taker 6 bps
    * WebSocket orders and data streams
  </Card>

  <Card title="Bybit" icon="chart-mixed">
    * Requires API key and secret only
    * **Auto fee detection** — fees read from your account, no manual config
    * WebSocket order management
  </Card>
</CardGroup>

All current GLFT presets on both exchanges run **20x leverage**.

***

## Available Presets

GLFT ships with 8 presets — conservative and aggressive, single- and multi-symbol, on both exchanges. In the Marketplace they appear as 4 cards with a Bybit/BloFin toggle. All values below are read from the actual preset configs.

<Tabs>
  <Tab title="BloFin">
    | Preset                 | Min Profit | Quote Size | Max Position   | Drawdown Stop | Leverage |
    | ---------------------- | ---------- | ---------- | -------------- | ------------- | -------- |
    | **Conservative**       | 16 bps     | $10 (→$15) | \$500          | \$100         | 20x      |
    | **Aggressive**         | 12 bps     | $25 (→$50) | \$2,000        | \$500         | 20x      |
    | **Multi Conservative** | 16 bps     | $10 (→$15) | \$500/symbol   | \$100         | 20x      |
    | **Multi Aggressive**   | 12 bps     | $10 (→$20) | \$1,000/symbol | \$500         | 20x      |
  </Tab>

  <Tab title="Bybit">
    | Preset                 | Min Profit | Quote Size | Max Position   | Drawdown Stop | Leverage |
    | ---------------------- | ---------- | ---------- | -------------- | ------------- | -------- |
    | **Conservative**       | 14 bps     | $10 (→$20) | \$500          | \$200         | 20x      |
    | **Aggressive**         | 14 bps     | $10 (→$20) | \$1,000        | \$200         | 20x      |
    | **Multi Conservative** | 14 bps     | $10 (→$20) | \$500/symbol   | \$200         | 20x      |
    | **Multi Aggressive**   | 14 bps     | $10 (→$20) | \$1,000/symbol | \$200         | 20x      |
  </Tab>
</Tabs>

Single-symbol presets default to BTCUSDT; multi presets run BTC, ETH, SOL, SUI, XRP. After the drawdown stop fires, the symbol pauses for 300 seconds before resuming.

<Tip>
  GLFT presets appear in the Marketplace under the **GLFT MM** family filter, tagged ALPHA. See the [Preset Selection Guide](/strategies/preset-guide).
</Tip>

***

## Key Parameters

| Parameter                           | Description                             | Conservative | Aggressive    |
| ----------------------------------- | --------------------------------------- | ------------ | ------------- |
| `min_profit_bps`                    | Minimum profit target per round trip    | 14–16        | 12–14         |
| `quote_size_usdt`                   | Base quote size per order               | \$10         | $10–$25       |
| `max_position_usdt`                 | Maximum position per symbol             | \$500        | $1,000–$2,000 |
| `leverage`                          | Leverage multiplier                     | 20x          | 20x           |
| `glft_gamma`                        | Risk aversion (higher = wider, smaller) | 0.01         | 0.01          |
| `grid.levels`                       | Quote levels per side                   | 2            | 2             |
| `risk_management.max_drawdown_usdt` | Hard stop per symbol                    | $100–$200    | $200–$500     |
| `loop_interval_seconds`             | Quote refresh interval                  | 0.5s         | 0.5s          |

### Grid configuration

<ParamField path="grid.levels" type="integer" default="2">
  Quote levels per side. Level 1 sits at the GLFT-optimal price, Level 2 a further offset out.
</ParamField>

<ParamField path="grid.spacing_bps" type="array" default="[0, 20]">
  Offset per level from the GLFT-optimal price: Level 1 at the optimum, Level 2 20 bps wider.
</ParamField>

<ParamField path="grid.size_pct" type="array" default="[0.6, 0.4]">
  Size split per level: 60% at Level 1, 40% at Level 2.
</ParamField>

<ParamField path="grid.regime_adjust" type="boolean" default="true">
  Scale grid behavior by detected regime (ranging / trending / volatile).
</ParamField>

<ParamField path="grid.inv_skew" type="boolean" default="true">
  Inventory-based quote skewing — quotes less on the side that would grow inventory, blocks adds entirely past 75% of the position cap.
</ParamField>

<ParamField path="grid.per_side_breathing" type="boolean" default="true">
  Long and short sides widen independently based on their own drawdown and age.
</ParamField>

***

## Recovery Grid

When a position goes underwater, normal quoting on the losing side is suppressed and a recovery system takes over.

<Steps>
  <Step title="Detection">
    Underwater position detected; grid adds on the losing side stop (`suppress_grid_adds: true`).
  </Step>

  <Step title="Order-book analysis">
    `orderbook_dca` mode scans for the **strongest** support (longs) or resistance (shorts) walls within a recovery range computed from the last 8 hours of 15-minute price action.
  </Step>

  <Step title="Placement">
    Up to 2 recovery orders are placed at those walls — at least 1% from the last fill, at least 1% apart, and at least 3% from the current price.
  </Step>

  <Step title="Scaled sizing">
    Recovery order size scales with drawdown depth: +50% of the position at 5% unrealized loss, +100% at 10%, +150% at 20%.
  </Step>
</Steps>

Safety rails: DCA pauses during sharp price spikes (15m candle check), orders are only reposted when price moves more than 0.1%, and the recovery range re-anchors if the entry drifts more than 10%.

<Note>
  The recovery grid is **not** a loss guarantee. In a strong trend it adds to a losing position; the `max_drawdown_usdt` hard stop is the final safety net.
</Note>

***

## Risk Warning

<Warning>
  **Market making involves significant risk.** GLFT-specific risks:

  * **Inventory risk** — despite optimal skewing, strong trends can build a full-size position before the stop fires
  * **Recovery risk** — the scaled recovery sizing adds to losers; in severe moves this deepens the final loss at the stop
  * **Leverage** — at 20x, a 5% adverse move equals 100% of position margin
  * **Liquidity** — on thin tokens the optimal spread may not cover adverse selection
  * **Alpha status** — defaults may change between updates

  Only trade funds you can afford to lose. Start conservative and monitor closely.
</Warning>

***

## GLFT vs Perp Market Maker

| Aspect                   | GLFT                              | Perp MM (XGrid family)               |
| ------------------------ | --------------------------------- | ------------------------------------ |
| **Quoting method**       | Closed-form academic equations    | Heuristic rules                      |
| **Parameters**           | \~20 key settings                 | 100+                                 |
| **Spread derivation**    | Automatic from volatility/flow    | Manual `base_spread_bps` + modifiers |
| **Inventory management** | Built-in penalty function         | Configurable skew factor             |
| **Recovery system**      | Order-book DCA with scaled sizing | XGrid counter-scalp + loss tiers     |
| **Leverage (presets)**   | 20x                               | 75x                                  |
| **Best for**             | Fewer knobs, model-driven quoting | Full customization                   |

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Vaults" icon="vault" href="/features/vaults">
    Deploy GLFT through managed vaults
  </Card>

  <Card title="Preset Guide" icon="list-check" href="/strategies/preset-guide">
    All presets across strategies and exchanges
  </Card>

  <Card title="Perp Market Maker" icon="scale-balanced" href="/strategies/perp-market-maker">
    The heuristic-rules alternative
  </Card>

  <Card title="Bot Management" icon="sliders" href="/features/bot-management">
    Deploy, monitor, and manage bots
  </Card>
</CardGroup>
