> For the complete documentation index, see [llms.txt](https://hawkfi.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hawkfi.gitbook.io/whitepaper/hawkfi-laboratory/market-making.md).

# Market Making

Market Making Mode is the HawkFi Laboratory mode for experimenting with Dynamic Limit Order and Market Making Agent configurations before live execution.

## What is Market Making Mode?

In Market Making Mode, Laboratory experiments with LP ranges and liquidity strategies.

In Market Making Mode, Laboratory experiments with [Market Making Agent](/whitepaper/hawkfi-agents/market-making-agents-mma.md)'s Dynamic Limit Order style behavior: buy quotes below price, sell quotes above price, inventory management, quote replacement, quote widening, and fill quality.

## Metrics of Market Making Mode

### Result Metrics

The top result cards summarize performance and risk.

| Metric       | What it means                                                                                 |
| ------------ | --------------------------------------------------------------------------------------------- |
| Net PnL      | The simulated Market Making setup PnL for the selected window.                                |
| Win Rate     | The percentage of positive markouts. The UI can also show markout counts beside the win rate. |
| Pair HODL    | The result from holding the pool pair instead of running the simulated configuration.         |
| Fees         | Fees or fee-related value shown for the simulation.                                           |
| Max Drawdown | The largest peak decline during the backtest.                                                 |

{% hint style="info" %}
Use `Percentage` or `Absolute` to switch how results are displayed.
{% endhint %}

### Equity Curve Metrics

The Equity Curve shows how performance changed over time.

| Line              | What it means                                                               |
| ----------------- | --------------------------------------------------------------------------- |
| Simulated PnL     | The performance of the Market Making configuration being simulated.         |
| Pair HODL PnL     | The result from holding the pool pair instead of running the configuration. |
| Single token HODL | The result from holding one side of the pair, when available.               |
| Cumulative Fees   | The fees accumulated by the simulated setup, when enabled.                  |

Use this chart to see whether the configuration created steady markout over time or relied on a few large moves.

### Price & Range Chart

Price & Range shows pool price, quote range, and rebalance markers.

| Line or label | What it shows                                                                |
| ------------- | ---------------------------------------------------------------------------- |
| Price         | The pool price through the backtest window.                                  |
| Range high    | The upper side of the simulated quote or range area.                         |
| Range low     | The lower side of the simulated quote or range area.                         |
| Rebalance     | Markers showing where the configuration refreshed quotes or rebalanced.      |
| Rebalances    | The total number of quote refresh or rebalance events during the simulation. |

Use this panel to understand how often the configuration moved with price.

### TVL Breakdown

TVL Breakdown shows the simulated token composition over time.

| Example for a simulated SOL-USDC pool | What it means                                                 |
| ------------------------------------- | ------------------------------------------------------------- |
| SOL TVL                               | The simulated SOL value held by the configuration over time.  |
| USDC TVL                              | The simulated USDC value held by the configuration over time. |

Use TVL Breakdown to inspect inventory drift. A Market Making setup can show strong markout while ending with a different token mix, so this chart gives more context than PnL alone.

### Market Making Diagnostics

Market Making Diagnostics is the deeper readout for quote quality, fills, inventory, cost, and markout.

| Diagnostic          | What it means                                                                                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Fills               | Total simulated fills and bid or ask side split.                                                                                                                         |
| Quote Updates       | How many times quotes were updated or refreshed. High activity is useful only if it improves edge.                                                                       |
| Filled Turnover     | How much turnover the simulated quotes created relative to starting capital.                                                                                             |
| LO Fees             | Limit Order fee value shown by the simulation.                                                                                                                           |
| Quote Update Cost   | Modeled operational cost for quote updates.                                                                                                                              |
| Final Inventory     | Final inventory bias after the simulation. Use this to check whether PnL came with unwanted inventory drift.                                                             |
| Open Order Notional | Open order notional usage in the simulated configuration.                                                                                                                |
| Spread Bins         | Quote spread distance relative to the maximum spread setting.                                                                                                            |
| Stoikov offset      | The latest simulated shift applied to the quote center, measured in DLMM bins. A value of `0 bins` means no Stoikov shift is active at that point.                       |
| Fill Model          | Shows how Laboratory determines whether a simulated quote fills, including the candle price range, required fill-through distance, and maximum fills allowed per candle. |
| Suppressed Fills    | The number of potential fills excluded by the simulation's fill limits. Suppressed fills do not affect simulated PnL, inventory, turnover, or equity.                    |
| Peak Fill Density   | The highest number of simulated fills recorded within rolling 30-minute, 60-minute, 4-hour, and 24-hour periods.                                                         |
| Fills / Day         | The average number of simulated fills per day during the selected backtest window.                                                                                       |

### Markout Horizons

Markout horizons show whether fills were favorable after different time windows.

| Markout horizon | What it means                                            |
| --------------- | -------------------------------------------------------- |
| 5m              | Mean net markout five minutes after fills.               |
| 15m             | Mean net markout fifteen minutes after fills.            |
| 30m             | Mean net markout thirty minutes after fills.             |
| 60m             | Mean net markout sixty minutes after fills.              |
| 120m            | Mean net markout one hundred twenty minutes after fills. |

Positive markout means fills were favorable over that horizon in the simulation. Negative markout can suggest the quotes were getting picked off or filled before adverse price movement.

### Simulation Summary

Under the charts, Laboratory shows a compact summary.

| Field          | What it means                                                          |
| -------------- | ---------------------------------------------------------------------- |
| Window         | The exact historical period used for the backtest.                     |
| Time in Range  | The percentage of the selected window covered by the simulation state. |
| Rebalances     | The number of quote or range refresh events shown by the simulation.   |
| Liquidity Mode | The internal simulation mode used to process the backtest.             |

### Liquidity Replay Animation

Liquidity Replay Animation lets you inspect the simulated state frame by frame.

| Field      | What it means                                        |
| ---------- | ---------------------------------------------------- |
| Frame      | The current replay frame out of the full simulation. |
| Timestamp  | The historical time represented by the frame.        |
| Active Bin | The active DLMM bin at that moment.                  |
| Range      | The simulated quote or range area at that moment.    |
| Price      | The pool price at that moment.                       |
| Event      | The current replay event count or state.             |

Use replay when you want to inspect how the configuration moved through time instead of only reading the result cards.

## How to run a Market Making Mode backtest

{% embed url="<https://youtu.be/gWdJ4sJvaiI>" %}

Use this simplified walkthrough to experiment with a Dynamic Limit Order setup in HawkFi Laboratory.

{% stepper %}
{% step %}

#### Select Market Making Mode

Use the `Mode` selector and choose Market Making.
{% endstep %}

{% step %}

#### Paste a pool address

Paste the DLMM pool address into `Pool Address`. You can test examples such as SOL-USDC, cbBTC, whETH, ZEC, JUP, JLP, MET, JTO, or HYPE. Thinner examples such as CARDS, PUMP, or PUMPCADE should be treated as higher-risk experiments and checked carefully against fill quality and inventory drift.

When the pool loads, Laboratory displays the pair, base fee, and bin step.

| Pool detail   | Example shown |
| ------------- | ------------- |
| Pair          | SOL USDC      |
| Base fee      | 0.04%         |
| Bin step      | 4             |
| {% endstep %} |               |

{% step %}

#### Set Start and End

Use `Start` and `End` to choose the historical backtest window.

Use this when you want to experiment with a specific market period, such as a launch window, range period, volatility spike, or recent pool behavior.

For eligible pools, `Event-Driven (BETA)` uses available event history, may adjust the date range automatically, and refreshes optimization results hourly.
{% endstep %}

{% step %}

#### Set Initial USDC

Use `Initial USDC` to set the starting value used for the simulated configuration.
{% endstep %}

{% step %}

#### Choose an Execution Model

Select the `Execution Model` you want to experiment with.

Execution Models are quant-optimized starting defaults for Market Making Agent behavior.

In simple terms, they decide whether the configuration should place orders closer to price for more possible fills, or farther from price for more protection.

| Execution Model | Best for                                                                                                               | Behavior                                                       |
| --------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Blue-chip Wide  | Deep blue-chip pools where protection matters more than fill count.                                                    | Wider baseline quotes and more defensive behavior.             |
| Blue-chip Tight | Major pools such as cbBTC or whETH, when depth supports tighter maker quotes.                                          | Moves quotes closer to price to increase fill opportunity.     |
| Mid-Cap         | Reasonably liquid mid-cap pools such as ZEC, JUP, JLP, MET, JTO, or HYPE, where blue-chip distance may be too passive. | Uses a tighter quote ladder while keeping risk controls.       |
| Small-Cap       | Thinner pools where fills are noisier and inventory can drift quickly.                                                 | Starts closer but adds stronger protection against noisy flow. |
| Meme-Cap        | Very thin, speculative, or micro-cap pools, including examples such as CARDS, PUMP, or PUMPCADE.                       | The most defensive visible model, with fewer expected fills.   |

Use `Reset parameters to defaults` when you want to return the controls to the selected Execution Model defaults.

Want to dive more about Execution Models? See [Execution Models here](/whitepaper/hawkfi-agents/market-making-agents-mma/execution-models.md).
{% endstep %}

{% step %}

#### Adjust primary controls

Use the primary controls to change inventory usage, live order count, inventory split, replace interval, open order notional, and spread factor.

| UI field                  | What it controls                                                                                                                 |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Inventory Utilization     | How much of the available capital can sit in live quotes. Higher usage can create more fill opportunity and more inventory risk. |
| Live Orders               | How many live bid and ask orders the configuration keeps open. More orders create a wider quote ladder.                          |
| Inventory Split           | The target balance between base and quote inventory. More base supports asks. More quote supports bids.                          |
| Unfilled Replace Interval | How long stale unfilled quotes can remain before being replaced. Faster refresh reacts faster but creates more activity.         |
| Max Open Order Notional   | The maximum open order notional used by the simulated configuration.                                                             |
| Spread Factor             | Scales quote distance. Lower values are tighter and more fill-seeking. Higher values are wider and more selective.               |
| {% endstep %}             |                                                                                                                                  |

{% step %}

#### Optional: Open Advanced Settings

Advanced Settings are for users who want more control over how cautious, aggressive, or selective the configuration should be when placing orders.

Most users should start with an Execution Model default, then experiment in Laboratory before making a live configuration more aggressive.

The current Laboratory UI can show these Advanced Settings:

| UI field                     | What it controls                                                                                                                                  |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Adaptive Spread              | Allows quote placement to adjust as market conditions change.                                                                                     |
| EV Gate                      | Turns expected-value gating on or off before placing size.                                                                                        |
| Requote on Fill              | Refreshes quote placement after a fill.                                                                                                           |
| Slippage BPS                 | Sets the slippage assumption in basis points.                                                                                                     |
| Spread Bins                  | Sets the starting quote distance from price in DLMM bins.                                                                                         |
| Level Spacing Bins           | Controls spacing between quote levels when using multiple bids and asks.                                                                          |
| Stoikov gamma (experimental) | Shifts the bid and ask quote center away from excess inventory. `Off` preserves the existing quote center; higher values create a stronger shift. |

`Stoikov gamma (experimental)` ranges from `Off` to `1.0` and is off by default. It changes quote prices, while inventory skew changes side sizes. Use candle simulation for positive gamma values. `Event-Driven (BETA)` currently supports gamma `0` only.

These settings map into the same configuration families used by the [Market Making Agent](/whitepaper/hawkfi-agents/market-making-agents-mma.md):

| Setting group | What it controls                                                                           |
| ------------- | ------------------------------------------------------------------------------------------ |
| Placement     | Where quotes sit around price and how they respond when conditions change.                 |
| Signals       | Whether current price action is clean enough to quote or should be treated more carefully. |
| Momentum      | Protection from one-sided or fast-moving price action.                                     |
| EV Gate       | Whether the configuration requires more expected edge before taking risk.                  |
| Sizing        | How much size the configuration can place on each side.                                    |
| Requote       | When old quotes should be replaced.                                                        |

Want to learn more about Market Making Agent Advanced Settings? See [Advanced Settings here](/whitepaper/hawkfi-agents/market-making-agents-mma/advanced-settings.md).
{% endstep %}

{% step %}

#### Optimize!

Click `Optimize` when you want Laboratory to search across candidate Market Making configurations for the selected pool, window, and deposit amount.

There are three Optimize options.

| Optimize option | What it means                                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Light           | Searches a faster set of candidate configurations.                                                                        |
| Deep            | Searches a wider set of candidate configurations and can take longer.                                                     |
| Ultra Deep      | Searches the widest candidate set. This option requires at least $500 total agent balance for Market Making optimization. |

Optimization can evaluate Stoikov gamma values of `0`, `0.5`, and `1` alongside the other candidate settings.

Open `Advanced` in the optimization modal to adjust the exploration percentage for each optimize depth. Exploration controls how much of the fixed optimization budget is reserved for newer or less common candidate strategies before Laboratory runs the backtests.

| Exploration control        | Default |
| -------------------------- | ------- |
| `Light Exploration %`      | 20%     |
| `Deep Exploration %`       | 25%     |
| `Ultra Deep Exploration %` | 35%     |

A higher exploration percentage tests more uncommon candidate setups. A lower exploration percentage keeps more of the budget focused on known-good candidate regions. The control only changes the candidate mix for the current optimization request; it does not change saved Execution Model settings or live Market Making Agent execution.
{% endstep %}

{% step %}

#### Run Backtest

Click `Run Backtest`.

Laboratory simulates the selected Market Making configuration over the selected pool and time window.

After a backtest, click `Create Market Making Agent`, name the agent, add SOL, then select `Fund and deploy agent`.

Under `Strategy actions`, `Save Model` appears before `Optimize`. Use `Save Model` when you want to preserve a configuration for later use, when that workflow is supported.
{% endstep %}
{% endstepper %}

## Market Making Mode tips

* Start with the Execution Model that matches the pool quality and depth.
* Use Laboratory before making a live Market Making Agent configuration more aggressive.
* Lower Spread Factor can increase fill opportunity, but can also increase toxic fill risk.
* Higher Inventory Utilization can create more opportunity and more inventory risk.
* Review Win Rate and markout diagnostics before trusting Net PnL.
* Watch Final Inventory so a good PnL result does not hide unwanted inventory drift.
* Use Advanced Settings only when you understand the tradeoff being changed.

## Related Pages

* [HawkFi Laboratory](/whitepaper/hawkfi-laboratory/hawkfi-laboratory.md)
* [Market Making Agent](/whitepaper/hawkfi-agents/market-making-agents-mma.md)
* [Market Making Agent Execution Models](/whitepaper/hawkfi-agents/market-making-agents-mma/execution-models.md)
* [Market Making Agent Advanced Settings](/whitepaper/hawkfi-agents/market-making-agents-mma/advanced-settings.md)

## More Questions?

* Join our Discord for questions and discussions on HawkFi: <https://discord.com/invite/hawkfi>
