> For the complete documentation index, see [llms.txt](https://hertzflow.gitbook.io/hertzflow-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hertzflow.gitbook.io/hertzflow-docs/liquidity-provision/how-it-works.md).

# How It Works

## Overview

When you provide liquidity on HertzFlow, you deposit USDT into isolated market pools that serve as the counterparty to leveraged traders. In return, you earn yield from trading fees, borrow fees, and trader losses.

It works like this: traders pay fees and borrow your capital to open leveraged positions. When traders lose, the pool grows. When traders win, the pool pays out. Over time, fee income and the statistical edge of the house tend to generate consistent positive returns for LPs.

<figure><img src="/files/TUR1Fn3yNJLocwqImzab" alt=""><figcaption></figcaption></figure>

## Two Ways to Provide Liquidity

{% tabs %}
{% tab title="HertzFlow Liquidity Pool (HzLP)" %}

### HzLP: Market-Specific Pools

Each market has its own isolated liquidity pool. When you deposit USDT, you receive **HzLP tokens** representing your share of that pool.

**How it works:**

* You pick a specific market (e.g., BTC/USD, ETH/USD)
* Your capital only backs trades in that market
* Your returns depend on that pool's fee income and trader PnL
* If the BTC pool has a bad day, your ETH pool deposit is unaffected

**Best for:** LPs who want granular control over which markets they're exposed to.
{% endtab %}

{% tab title="HertzFlow Vault (HzV)" %}

### HzV: Vault Aggregation

Vaults aggregate liquidity across multiple markets that share the same strategy. Your capital shifts automatically between markets based on demand and fee opportunities.

**How it works:**

* You deposit USDT and receive **HzV tokens**
* The vault allocates your capital across multiple pools
* Rebalancing happens automatically, with no manual management needed
* Your returns reflect aggregate vault performance

**Best for:** LPs who want diversified exposure with minimal effort.
{% endtab %}
{% endtabs %}

## Depositing

When you deposit USDT into a pool, you receive HzLP tokens (or HzV tokens for vaults). The protocol automatically splits your deposit 50/50 between long and short collateral reserves, regardless of current open interest.

**Your HzLP/HzV token price:**

```
Token Price = Pool AUM / Total Token Supply
```

As traders pay fees and realize losses, the pool's AUM increases and your tokens become worth more. Conversely, trader profits decrease pool value.

**Deposit limits:** Each pool has a maximum AUM cap to prevent over-concentration:

```
Max Deposit = Max AUM - Current AUM
```

If a pool is near capacity, you'll see the remaining deposit cap in the interface.

## Withdrawing

Withdrawing burns your HzLP/HzV tokens and returns USDT at the current token price. Withdrawals settle **instantly** on-chain, with no waiting periods.

However, withdrawal amounts are subject to two real-time constraints that protect remaining LPs and ensure adequate liquidity for active positions. Your effective withdrawal limit is the **lower** of these two checks:

1. **PnL Factor Constraint**: limits withdrawals when traders hold large unrealized profits
2. **Liquidity Reserve Constraint**: ensures enough liquidity remains to cover open positions

{% hint style="info" %}
The remaining withdrawal cap is always visible in the pool interface. If it's lower than expected, it usually means traders currently hold large unrealized profits or the pool is supporting large open positions.
{% endhint %}

## How Your Request Is Processed (and Cancelling a Stuck One)

Deposits and withdrawals don't settle the instant you click. Each one is a **two-step request**, and understanding this explains both the short wait you sometimes see and what to do if a request gets stuck.

**The two steps:**

1. **You submit.** Your USDT (for a deposit) or your HzLP/HzV tokens (for a withdrawal) are held in escrow by the contract. Nothing is minted or redeemed yet.
2. **A Keeper executes.** An off-chain Keeper node picks up your request, reads the latest price, and completes it — *this* is the moment your LP tokens are minted or your USDT is returned. It usually happens within a few seconds, so you'll rarely notice the gap.

{% hint style="info" %}
Because the price is read at **step 2, not step 1**, the exact rate that applies is the one live when the Keeper executes — a big reason the settled amount can differ slightly from the preview (see the next section).
{% endhint %}

### When a request gets stuck

Occasionally the Keeper can't execute right away — the market is closed, the price feed is briefly unavailable, or the node is catching up. Your funds stay safely in escrow the whole time, but the request sits in a **pending** state instead of completing.

If a request has been pending for more than about **30 seconds**, HertzFlow lets you take it back into your own hands. You'll find it in two places:

* **On the pool/vault page** — a **Your Pending** tab appears (with a count badge) listing every stuck request. Cancel one with **Cancel**, or clear them all with **Cancel all**.
* **In the wallet panel** — the Portfolio tab shows **Pending Pool Orders** / **Pending Vault Orders** cards; tap the **✕** on a card to cancel it directly.

Cancelling returns your escrowed USDT or HzLP/HzV **straight back to your wallet**. No LP is minted or burned, and the request never touched the pool's price or your balance. You only pay the small gas for the cancel transaction; the amount you had in escrow (plus any prepaid execution fee) comes back.

{% hint style="info" %}
Some requests are cancelled **for you** automatically. If the Keeper tries to execute but a check fails (slippage, minimum size, or the pool's deposit cap), it cancels the request in the same step and returns your funds. Both kinds show up in your history as **Cancelled Deposit** / **Cancelled Withdrawal** — either way, your money came back and nothing was lost.
{% endhint %}

If you tap Cancel at the same moment the Keeper finally processes the request, your cancel may harmlessly fail with **"This order has already been processed. Please refresh the page to check the latest status in history."** Just refresh — the request either completed or was already cancelled, and you'll see its final state in your activity history.

## Why Your Withdrawal Amount Isn't the Same as Your Deposit

A common worry for new LPs: *"I deposited, then withdrew almost right away, and the number changed. Did I lose money to fees?"*

Almost certainly not. There *is* a small deposit/withdrawal fee, but it's a **fixed, known percentage** — far too small to explain most of what you see. What really changed is the **token price**, and that's a feature, not friction.

**About the fee:** deposits and withdrawals carry a small fee set **per market** (reference: **7 bps**, i.e. 0.07%). It's applied on top of the price math below, and it's the same whether the pool went up or down — so it's predictable, not the reason the numbers "drift." Deposits and withdrawals are *not* charged the dynamic price-impact fees that trading actions incur.

Think of HzLP/HzV tokens like **shares in a fund**. When you deposit, you buy shares at the current price. When you withdraw, you sell them back at the current price. Between those two moments, the price per share is *always moving* — so the same number of tokens is worth a different amount of USD, and the same amount of USD buys a different number of tokens.

### How the token price is calculated

The price of one HzLP/HzV token is simply the pool's total value divided by all tokens in circulation:

```
Token Price = Pool AUM (USD) / Total Token Supply
```

This single number drives both directions:

**Depositing (minting tokens):**

```
Tokens Minted = Deposit Value (USD) / Pool AUM (USD) × Total Token Supply
```

**Withdrawing (burning tokens):**

```
USD Returned  = Tokens Burned × (Pool AUM (USD) / Total Token Supply)
Tokens Received in Stablecoin = USD Returned / stablecoin price
```

### Worked example

Start with a pool worth **$10,000** holding **100,000** tokens (price = $0.10 each):

| Step                                      | Pool AUM | Total Supply | Action                                               |
| ----------------------------------------- | -------- | ------------ | ---------------------------------------------------- |
| You deposit **$100**                      | $10,000  | 100,000      | `100 / 10,000 × 100,000` = **1,000 tokens**          |
| Time passes (fees + trader losses accrue) | $10,100  | 101,000      | pool grew, others deposited                          |
| You withdraw **1,000 tokens**             | $10,100  | 101,000      | `1,000 × (10,100 / 101,000)` = **$100** (before fee) |

Ignoring the small per-market fee, you put in $100 and got \~$100 of value back at this price. If the pool had earned more before you withdrew, you'd get *more*; if traders had been winning, you'd get *less*. The token count you hold stays fixed; its **value** floats with the pool. The 7 bps fee comes off the top of each side and is tiny next to these movements.

### What's actually moving

Between your deposit and your withdrawal, several things change at the same time — which is why the exact USDT figure rarely matches to the cent:

* **Pool AUM changes continuously** — trading fees and trader losses push it up; trader profits pull it down. This is exactly how you earn yield.
* **Total supply changes** — other LPs are depositing and withdrawing alongside you, so the price-per-token denominator shifts.
* **Settlement price moves** — the final step converts your USD value back into the stablecoin at its live market price, which can sit slightly above or below $1.
* **Timing** — the longer you wait between actions, the more the pool state (AUM + supply) can drift.
* **The deposit/withdrawal fee** — a small, fixed per-market charge (reference 7 bps), applied on each side.

{% hint style="success" %}
**Bottom line:** Apart from a small, predictable per-market fee (reference 7 bps), there is no hidden "wear." The bigger gap you may see between what you put in and what you take out is the pool's value changing over time — not friction. Over a normal holding period, fee income and trader losses are designed to make that change work *in your favor*.
{% endhint %}

## Automatic Rebalancing

Every deposit is split 50/50 between long and short collateral. The protocol handles this automatically. This ensures the pool can serve both sides without bias, regardless of open interest distribution.

Deposits and withdrawals have **zero price impact fees**. Unlike trading actions, your LP operations won't be charged dynamic impact fees.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hertzflow.gitbook.io/hertzflow-docs/liquidity-provision/how-it-works.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
