> For the complete documentation index, see [llms.txt](https://allblue-docs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://allblue-docs.gitbook.io/docs/en/allblue-v2/core-contracts/allbluev2pair.md).

# AllBlueV2Pair

AllBlueV2Pair holds the liquidity for two tokens and processes the core AMM operations of AllBlue V2.

Each Pair also acts as the LP Token contract representing liquidity provider positions.

### Key Functions

| Function        | Description                                        |
| --------------- | -------------------------------------------------- |
| `getReserves()` | Returns the current reserves of token0 and token1  |
| `mint(to)`      | Issues LP Tokens based on newly provided liquidity |
| `burn(to)`      | Burns LP Tokens and returns the underlying tokens  |
| `swap(...)`     | Executes a Swap using the Pair's liquidity         |

### AMM Model

AllBlue V2 uses the Constant Product AMM invariant:

```
x × y = k
```

After each Swap, the Pair verifies that the invariant is maintained after accounting for the applicable Swap Fee.
