> For the complete documentation index, see [llms.txt](https://docs.algebra.finance/algebra-integral-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algebra.finance/algebra-integral-documentation/algebra-integral-technical-reference/plugins/whitelist-discount-fee.md).

# Whitelist Discount Fee

## Overview

To attract big market makers (actors who make a big volume of swaps) DEXes might offer them better swap costs at the expense of swap fees. Using the dedicated plugin we can configure Algebra pool(s) with a registry of preferred (‘whitelisted’) addresses that can make swaps with reduced fees. This approach allows a trade-off between lower gains for LP providers (and protocol as well) from the single swap in favor of boosting the total swap volume.

## Details

We can base our setup on the concept of ‘Whitelist Registry’ that is essentially a smart contract maintaining the ledger of preferred addresses and their respective discounts for each pool:

<figure><img src="/files/ZT0cykoqoPJVXebV36UJ" alt=""><figcaption></figcaption></figure>

Discount defined above is applied to the swap fee before any redistribution happens. First the discount is applied and then the remaining fee is assigned to the LPs and protocol. This means that all parties lose their fee part in equal measure.

Discount can be set up to 100% in which case the fee is essentially forfeited. Setting a discount value to 0% means removing the address from the whitelist. **The tx.origin parameter** is used to identify the user and calculate the discount. In our plugin implementation, the discount is applied to the dynamic fee.

## How to configure discount fee plugin

The owner or address having the role “FEE\_DISCOUNT\_MANAGER” is able to set the discount value in thousandths (1000 = 100%)

To set fee discount you need to call method of registry contract:

**setFeeDiscount(address user, address\[] memory pools, uint16\[] memory newDiscounts)**

To get the current fee discount for user and pool, you need to call:

**feeDiscounts(address user, address pool) returns (uint16 feeDiscount);**

If the fee discount registry contract is not sufficient to cover some use cases. Owner can develop and replace it with its own version of Fee Discount Registry. Fee Discount Registry should implement the **feeDiscounts(address user, address pool) returns (uint16 feeDiscount)** method, which returns the discount value for the given user and pool.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.algebra.finance/algebra-integral-documentation/algebra-integral-technical-reference/plugins/whitelist-discount-fee.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
