> For the complete documentation index, see [llms.txt](https://docs.afx.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.afx.xyz/vaults/lp-vault.md).

# LP Vault

The LP Vault — also known as **AFX Provider (ALP)** — is the protocol-level liquidity vault. It serves as the backbone of the AFX exchange, providing liquidity for trading, handling liquidation takeovers, and absorbing market-making risk.

## Overview

* **Operator Fee:** 0% (no management fee)
* **Profit Share:** 0% (all returns go to depositors)
* **Deposit Currency:** USDC
* **Lock Period:** Deposits are locked for **4 days** before becoming withdrawable.

## How It Works

The LP Vault consists of multiple sub-vaults, each serving a specific function:

* **Market Making Sub-Vaults:** Execute market-making strategies to provide liquidity on the order book and earn the bid-ask spread.
* **Liquidation Takeover Sub-Vaults:** Absorb positions from liquidated users and close them at a discount, earning the liquidation fee and any favorable price difference.

A strategy smart contract manages the trading signals and returns for each sub-vault. The Vault manager (protocol team) configures strategy allocation and risk parameters but cannot directly withdraw user funds.

## Revenue Sources

1. **Trading fees:** After deducting the **Referral commission** from the AFX-wide fee revenue, 50% of the remaining amount will be transferred to the LP Vault as earnings.
2. **Liquidation takeover margin:** Remaining maintenance margin from liquidated positions.
3. **Liquidation fees:** 0.5% of the maintenance margin collected during position takeover.
4. **Strategy earnings:** The LP Vault will be managed by professional traders who implement trading strategies. Any profits generated will also remain within the LP Vault.

## NAV Calculation

Since the LP Vault has multiple sub-vaults with different performance, the main Vault NAV is a **weighted average** of each sub-vault's NAV:

```
Main Vault NAV = Σ (Sub-Vault NAV_i × Weight_i)
```

For example, if Sub-Vault 1 has NAV = 1.1 (weight 40%), Sub-Vault 2 has NAV = 1.2 (weight 30%), Sub-Vault 3 has NAV = 1.4 (weight 20%), and Sub-Vault 4 has NAV = 1.3 (weight 10%), then:

```
Main Vault NAV = 1.1 × 40% + 1.2 × 30% + 1.4 × 20% + 1.3 × 10% = 1.21
```

## Deposits

* Minimum deposit: No minimum beyond what is required by the blockchain transaction.
* No maximum deposit limit.
* Deposits are locked for **4 days** before they can be withdrawn.
* Shares are minted at the current NAV at the time of deposit.

## Withdrawals

All withdrawals are processed from the main Vault. If the main Vault has sufficient available balance, the withdrawal is processed immediately. If not, sub-vaults contribute funds proportionally based on their configured ratios.

Each sub-vault reserves **20% of min(Balance, Available Balance)** as a liquidity buffer. If sub-vault funds are still insufficient after using the buffer, the system may cancel orders or close positions (starting from smallest margin) to free up capital.


---

# 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:

```
GET https://docs.afx.xyz/vaults/lp-vault.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
