# Liquidity Positions

### Liquidity Positions: Unlocking Conditional Market Making

Dextr introduces the concept of Liquidity Positions, which are smart contracts empowering LPs with customized market-making strategies using Hooks.

**Hook:** A customizable module that plugs into the Dextr AVMM framework, enabling specific functionalities or strategies for liquidity pools and trading.&#x20;

**Key Features:**

* **Customization with Hooks:** LPs can utilize hooks to customize their Liquidity Positions with conditional logic, enabling strategies aligned with individual risk tolerance and market expectations.
* **Multiple Positions per Pair:** LPs can create multiple Liquidity Positions for the same token pair within the protocol. The LPs can leverage this to define various price ranges for the same token pair.&#x20;
* **Active Positions Require Reserve Balance:** To ensure operational integrity, a Liquidity Position becomes active only when the LP adds assets to the liquidity reserve.
* **Loss Prevention Safeguards:** Built-in logic helps protect LPs from losses by stopping token sales below their average purchase price within set price ranges. LPs can also set a 'Take Profit Percentage,' ensuring that their tokens are only available for sale when the price is high enough to make a profit (determined by "Take Profit Percentage) above the average buying price..
* **Automated Profit Capture:** Offers an automated profit capture system using [REP points](https://dextr-protocol.gitbook.io/dextr-avmm-whitepaper-v3.0/liquidity-provisioning/broken-reference) balance. If, for a trade, multiple eligible LPs are offering the same fee discount, the LP with the highest REP score gets priority, allowing them to buy or sell before lower-ranked LPs, potentially capturing better profits. For example, suppose multiple LPs have matching discount percentages and sufficient liquidity balance, the LP with the highest REP points will execute the trade first, ensuring they capture profits ahead of lower-ranked LPs.

### **Introducing the First Hook: Dollar Cost Averaging (DCA)**

Dextr introduces its first strategy hook: Dollar Cost Averaging (DCA) . This innovative Liquidity Position enables LPs to apply DCA principles for strategic management of liquidity depth. LPs input specific parameters to configure their DCA strategy. Here's how it works:

<table><thead><tr><th width="150">Functionality</th><th width="258">Parameters Involved</th><th>Default Property</th></tr></thead><tbody><tr><td>Concentrated Liquidity</td><td>Upper Bound<br>Lower Bound</td><td><mark style="background-color:red;">Common Range for Buying &#x26; Selling</mark></td></tr><tr><td>Take Profit</td><td>Profit Percentage</td><td><mark style="background-color:red;">Minimum: 0%</mark></td></tr><tr><td>Liquidity Allocation</td><td><p>Token Type</p><p>Threshold Type</p></td><td><mark style="background-color:red;">Inbound Token</mark><br><mark style="background-color:red;">Max USD token swap value</mark> </td></tr><tr><td>Dynamic Fees</td><td>Fee Discount Percentage</td><td><mark style="background-color:red;">Minimum: 0%</mark><br><mark style="background-color:red;">Maximum: 100%</mark></td></tr><tr><td>Order flow Identification</td><td>Discount Applicability</td><td><mark style="background-color:red;">Applicable to All</mark></td></tr><tr><td>Price Discovery</td><td>Single Source<br>Multiple Sources</td><td><mark style="background-color:green;">Global Average (Oracle feed)</mark></td></tr><tr><td>Discounted Fee</td><td><p>Max LP Fee</p><p>Fee Discount %</p></td><td><mark style="background-color:green;">LP Fee Entitlement</mark></td></tr></tbody></table>

<mark style="background-color:red;">**Static LP Input**</mark>**&#x20;  |   &#x20;**<mark style="background-color:green;">**Dynamic, Smart Contract Calculation**</mark>

Based on the inputs to the Liquidity Position parameters, the protocol calculates the following:

**Take Profit Price: Every time an LP settles a trade, the weighted average buying price for the incoming asset is updated. The LP will only be considered for settling the trade if:**&#x20;

$$
\text{Sell Price} >= \text{Weighted Average Buy Price} \times (1 + \text{Take Profit Percentage})
$$

#### **This will ensure that the LP never settles the trade in loss i.e. below the price at which the buy trade for the same asset was settled**

#### **Discounted Fee:** This fee discount applied to a trader is calculated by subtracting the offered discount percentage from the maximum possible discount on the LP fee (100%). [➡️](https://dextr-protocol.gitbook.io/dextr-avmm-whitepaper-v3.0/fee-and-revenue/fee-types#id-1.-trading-fees)

$$
\text{Discounted Fee} = 0.35 \times (1 - \text{Discount})
$$
