# Providing liquidity

> Depositing into a LithosDex pool, the two ways a position earns, checking a provision NFT, and closing a position without losing fees.

Source: https://lithosprotocol.org/docs/lithosdex/liquidity

**Level:** Advanced

*Assumes you know what an automated market maker is and what price movement does to a liquidity position. Read the [LithosDex overview](https://lithosprotocol.org/docs/lithosdex/overview) first.*

Liquidity providers own a LithosDex pool's reserves and earn the fees every swap pays. This page covers
opening a position, the two ways it earns, claiming those earnings, and closing it again. It applies to
every pool, ERG:LIT included. How to place orders in general is in [Trading with orders](https://lithosprotocol.org/docs/lithosdex/orders).

## What a position is

A position on LithosDex is a **provision**: a box of its own on Ergo that records how many **shares**
of one pool you own. It holds none of the pool's assets, only a 0.6 ERG floor. The assets you deposited
sit in the pool, and your shares say how much of them is yours.

Each provision comes with an **owner NFT**, a token minted for that provision alone and sent to your
wallet. Claiming the provision's fees and closing it both require the NFT as an input.

> **Danger: The owner NFT is the position**
>
> Whoever holds the NFT owns the provision, its fees and its share of the reserves. Sending the NFT to
> another address hands all of that over. Losing it loses the position, and nothing can recover it.

## Opening a position

A deposit adds both sides of the pool at its current ratio. To deposit from the web interface, follow
these steps:

1. Open **LithosDex**, choose the pool in the header, then open the **Liquidity** tab.
2. Under **Add liquidity**, enter one side. The interface fills in the other side at the current
   price. On pools other than ERG:LIT, it does so while **Balanced** is ticked.
3. Check the quote, including the shares you receive and, for an order, the fewest shares it accepts.
4. On an unverified pool, tick **I understand this pool is not on the verified list**.
5. Select the deposit button. With **Use orders** on, it places a deposit order. With it off, it sends
   the deposit directly.

The deposit also funds the new provision box with 0.6 ERG, which comes back to you when you close it.
If the pool moves before your deposit lands, whatever does not match the new ratio is returned rather
than traded.

As an order, a deposit carries a minimum number of shares. It protects you from a pool someone moved in
the same block: a deposit that would buy fewer shares than your minimum does not fill.

## How a position earns

Each swap pays two fees to providers, and they reach you in different ways. The rates below are
ERG:LIT's. Every other pool sets its own, shown on its **About this pool** card:

| Fee | Share of each swap | How you receive it |
|---|---|---|
| Pool fee | 0.15% | It stays in the reserves, so each of your shares is worth more when you close |
| Permanent fee | 0.15% | It is set aside and claimed separately, without closing the position |

**Permanent fees are kept apart from the reserves**, so price movement in the pool does not touch
them. What your shares are worth in the reserves does move with the price, as in any automated market
maker. The permanent fees you have earned do not.

## Claiming permanent fees

Permanent fees pass through two steps before they reach you:

1. **The pool collects them.** Every swap sets its permanent fee aside inside the pool box.
2. **A flush moves them to the vault.** The vault is a separate box that pays providers. Miners flush
   at the end of the order runs they put in their own blocks, and anyone can flush from the **Flush**
   tab.

Once fees are in the vault, the **Fees** tab lists them as **Claimable now**. Select
**Claim settled permanent fees** on a provision to send them to your wallet. Fees still in the pool are
listed as **Awaiting flush** and become claimable after the next flush.

Each provision is owed its own share of every fee that arrived while it existed. Claiming takes nothing
from anyone else, and what you do not claim stays owed to you.

## Checking a provision NFT

Anyone can mint a token and name it like an owner NFT, so a token's name proves nothing. To check one,
enter its token id under **Look up a provision NFT** on the **NFT search** tab. The client confirms the
NFT owns an open provision, and shows that provision's pool, shares, fees and share of the reserves. A
redeemed provision's NFT is reported as redeemed.

Wallet LD-NFT links and clickable provision collateral open this search page with the token ID
already entered. You can also search for NFTs you do not own. The result links to the pool’s **Liquidity** tab.

The **Wallet** page checks the NFTs in your own wallet the same way. See
[Checking your wallet](https://lithosprotocol.org/docs/operations/wallet-page).

## Closing a position

Closing redeems your shares for their part of the reserves, returns the provision box's 0.6 ERG, and
burns the owner NFT. To close from the web interface, open the **Liquidity** tab and use
**Remove liquidity**.

**A redemption forfeits every permanent fee the provision has not claimed.** The provision box is
spent, and the fees owed to it go with it. The interface handles this for you in each mode:

| Mode | What happens to fees |
|---|---|
| Order | Fees already in the vault are claimed in the same transaction that places the order. Fees still awaiting a flush, and any that arrive while the order waits, are lost when it fills |
| Direct | Nothing is claimed. The interface warns you and requires **Redeem anyway and give up these fees** before it sends |

To keep everything, flush from the **Flush** tab, claim from the **Fees** tab, and redeem afterwards.

## Keeping an idle position alive

Ergo lets anyone collect a box that has sat untouched for four years. A provision can safely sit much
longer than that:

- **Claiming renews it.** A claim replaces the provision box with a new one, which starts the clock
  again.
- **Anyone may refresh an old one.** After 525,600 blocks, about two years on mainnet, anyone may
  replace a provision box with an identical new one. A refresh moves nothing and changes no owner.
- **On a token/token pool, a refresh pays the refresher.** The refresher may take up to 0.01 ERG from
  the provision box, but never take the box below 0.4 ERG. That is about 20 refreshes, or 40 years.
- **The 0.6 ERG floor covers the rest.** If neither of the above happens, the floor pays storage
  rent, and the provision survives with a smaller floor. It covers two collections on an ERG/token
  pool, and one on a token/token pool, whose provision box is larger.

## Next steps

- [Trading with orders](https://lithosprotocol.org/docs/lithosdex/orders): order fees, statuses and cancelling.
- [Creating a pool](https://lithosprotocol.org/docs/lithosdex/creating-a-pool): starting a pool of your own, with yourself as its first
  provider.
- [LithosDex overview](https://lithosprotocol.org/docs/lithosdex/overview): how the price and fees work.
