# LiquidityMath

### Functions[​](https://docs.uniswap.org/contracts/v3/reference/core/libraries/LiquidityMath#functions) <a href="#functions" id="functions"></a>

#### addDelta[​](https://docs.uniswap.org/contracts/v3/reference/core/libraries/LiquidityMath#adddelta) <a href="#adddelta" id="adddelta"></a>

```solidity
  function addDelta(
    uint128 x,
    int128 y
  ) internal pure returns (uint128 z)
```

Add a signed liquidity delta to liquidity and revert if it overflows or underflows

**Parameters:**[**​**](https://docs.uniswap.org/contracts/v3/reference/core/libraries/LiquidityMath#parameters)

| Name | Type    | Description                                    |
| ---- | ------- | ---------------------------------------------- |
| `x`  | uint128 | The liquidity before change                    |
| `y`  | int128  | The delta by which liquidity should be changed |

**Return Values:**[**​**](https://docs.uniswap.org/contracts/v3/reference/core/libraries/LiquidityMath#return-values)

| Name | Type    | Description         |
| ---- | ------- | ------------------- |
| `z`  | uint128 | The liquidity delta |


---

# 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://bonsaiswap.gitbook.io/bonsaiswap-docs/developers/technical-reference/core/libraries/liquiditymath.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.
