# M5 - Liquidity Building Module

**Module overview**

The liquidity module is programmatically executed on any given Dex pool and can be registered on any DEX router.\
The Module algorithm calculates the number of tokens that need to be sold at each price level and adds them to the liquidity pool on a decentralized exchange (DEX). \
This Module is designed to assist token owners in increasing liquidity as specific price levels are reached. Create a structured and efficient approach to increase liquidity in the Uniswap Pair/Pool.&#x20;

The module consists of a list of Solidity functions to implement a "liquidity building" trading logic on a  pool. This function interacts with the Uniswap router. The purpose of this function is to ascertain the number of tokens to be sold in a Dex Pool to maintain a desired liquidity/market cap.\
\
Lower price impact indicates better liquidity provisioning and improved trading conditions for token holders. Reduce slippage and make it easier for investors and traders to buy and sell large amounts of tokens. This can make it cheaper for customers to trade, as they will be able to buy and sell at more favorable prices.<br>

**Parameters and Inputs**

* Initial Price, Step Increase, Step Number: define the price levels where liquidity building initiates. The liquidity concentration occurs in steps, with each step incrementing based on the defined increase and the number of steps.
* Min/Max Price Impact: determine the thresholds for executing liquidity concentration trades. avoid frontrunners, while the Min Price Impact parameter prevents insignificant transactions.
* Allocation: The allocation represents the number of tokens dedicated to liquidity concentration.
* Price Query: The LP Building module includes a function to query the current price of TokenIn  in relation to TokenOut from the specified pool. The Initial Price serves as the price level at which liquidity starts to be built.
* Token Amounts Calculation: This function calculates the number of tokens to be sold at each step and determines the maximum number of tokens to sell in a given transaction. The Max Price Impact parameter is defined to&#x20;

**Use cases**&#x20;

* Reduced spreads: reduce the spread between the buying and selling prices of assets.&#x20;
* Accommodate larger investors:  make it easier for big investors to enter and exit the market.
* Mitigate price swings: stabilize prices by making it easier for buyers and sellers to enter and exit the market.
* Protecting against frontrunning attempts by bots, by using algorithms to calculate the USD value of the token and liquidity pool.

**Performance of metrics**

* Percentage increase in liquidity against the total liquidity value added to the pool.
* Volume generated as a result of the Liquidity Building strategy.&#x20;
* Evaluate how the liquidity additions influence the token's average market spreads.&#x20;


---

# 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://docs-thedexer.gitbook.io/dexer/m5-liquidity-building-module.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.
