# Liquidity Provision

* Mint
  * Function: `mint`
  * Pull liquidity of a token pair from `msg.sender` (should have approved enough amount), provide liquidity to Uniswap v3 pool, keep the liquidity position NFT in Particle contract. At the same time, create `LiquidityPosition.Info` to bookkeep the ownership of `tokenId` to `msg.sender`.
* Increase liquidity
  * Function: `increaseLiquidity`
  * Increase liquidity to existing `tokenId` via Uniswap’s NonfungiblePositionManager.
  * Note: there are two internal functions of `increaseLiquidity`. The external facing one (takes `lps` storage as calldata input) authenticates the caller. The inner function is used in two cases: (1) this external facing function for an LP to add liquidity and (2) returning liquidity back to LP when closing a position in `_closePosition`.
* Decrease liquidity
  * Function: `decreaseLiquidity`
  * Decrease liquidity from existing `tokenId` via Uniswap’s NonfungiblePositionManager.
  * Note: the decreased liquidity is stored in owed tokens. Withdrawing the actual amount needs the `collectLiquidity` function below.
  * Note: similar to `increaseLiquidity`, there are two internal functions of `decreaseLiquidity`. The external one (takes `lps` storage as calldata input) authenticates the caller. The inner function is used in two cases: (1) this external facing function for an LP to decrease liquidity and (2) borrowing liquidity from an LP position in `openPosition`.
* Collect liquidity
  * Function: `collectLiquidity`
  * Collect fees and liquidity from owed tokens to the caller (LP) wallet.
  * Note: there are two internal functions of `collectLiquidity`. The external one (takes `lps` storage as calldata input) authenticates the caller. The inner function is used in two cases: (1) this external facing function for an LP to collect fees and (2) borrowing liquidity from an LP position in `openPosition`.
  * Note: this function imposes `amountMax` such that borrowing liquidity wouldn’t withdraw more amounts than requested.


---

# 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://erc20-docs.particle.trade/developer/liquidity-provision.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.
