# Liquidity Pool

marginfi's liquidity pool is a shared collateral, *borrow-lend* pool between all margin accounts. Any margin account can access liquidity in the pool according to their available margin.

### Mechanics

Lending and borrowing happen *implicitly* in marginfi. This allows for a better trading experience and more efficient usage of liquidity.

Any given margin account either acts as a lender or a borrower in the pool. Whenever a margin account has positive balance, that is available in the pool to be used by margin accounts that require more collateral than their account balance.

#### Interest Rates

Lenders are incentivized to provide collateral by earning interest paid by borrowers for their collateral.

Interest rates are *compounded* hourly.

* u - utilization ratio
* c - scaling factor

$$
i = -ln(1- u) \cdot c
$$

With the current mainnet-beta configuration (c = 0.2), our interest rate curve looks like this.

![marginfi liquidity pool interest rate curve](/files/gIlGEOf6aYsJrMtbuaZQ)

### Solvency

The pool is protected with the [liquidation mechanism and the insurance fund](/marginfi/protocol/margin-engine/liquidations.md) to ensure marginfi can honor its obligations.

### Limitations

Borrowed liquidity **can't** be withdrawn from your margin account.


---

# Agent Instructions: 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://marginfi.gitbook.io/marginfi/protocol/liquidity-pool.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.
