# Exchange Fee And Fee Distribution

## Exchange Fee

```js
uint public constant INVERSE_BASIS_POINT = 10000;
uint public exchangeFeeRate = 0;
```

The exchange fee rate is predefined in the protocol. Users can't specify this in their orders. Once an order is taken by someone, the exchange fee will be deducted automatically.

```
exchangeFeeAmount = exchangePrice * exchangeFeeRate / INVERSE_BASIS_POINT
```

Initially, the `exchangeFeeRate` will be set to zero. Later, we will import governance mechanism to modify the exchange fee rate.

## Fee Distribution

### Order Maker Relayer Benefit

```js
uint public constant INVERSE_BASIS_POINT = 10000;
uint public makerRelayerFeeShare = 8000;
```

Order maker relayers are the tools which facilitate users to make buy/sell orders on the protocol. These tools can specify their own addresses to gain the benefit.

```
orderMakerRelayerBenefitAmount = exchangeFeeAmount * makerRelayerFeeShare / INVERSE_BASIS_POINT
```

### Order Taker Relayer Benefit

```js
uint public constant INVERSE_BASIS_POINT = 10000;
uint public takerRelayerFeeShare = 1500;
```

Order taker relayers are the tools which facilitate users to take buy/sell orders on the protocol. These tools can specify their own addresses to gain the benefit.

```
orderTakerRelayerBenefitAmount = exchangeFeeAmount * takerRelayerFeeShare / INVERSE_BASIS_POINT
```

### Protocol Fund

```js
uint public constant INVERSE_BASIS_POINT = 10000;
uint public protocolFeeShare = 500;
address public protocolFeeRecipient;
```

The `protocolFeeRecipient` is an address owned by the protocol developer team. They can gain benefit from the exchange fee.

```
protocolBenefitAmount = exchangeFeeAmount * protocolFeeShare / INVERSE_BASIS_POINT
```

## Governance

```js
uint public exchangeFeeRate = 0;
uint public makerRelayerFeeShare = 8000;
uint public takerRelayerFeeShare = 1500;
uint public protocolFeeShare = 500;
```

The above parameters in the protocol will be modified by on-chain governance.


---

# 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.niftyconnect.org/niftyconnect-protocol-document/docs/exchange-fee-distribution.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.
