# Transaction fee

Let’s consider the trading fee ɛ (ɛ \~0.003) impact with its four possible use cases, as follows:

### Buy X:

If a trader wants to buy amount 0<ΔX\<Xc:&#x20;

he should pay:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FyZTxMH2i4ttbXrCcvtLJ%2Fimage.png?alt=media&#x26;token=9f4391b3-a192-42ae-b7b0-2641d7212f67" alt=""></div>

If a trader wants to sell amount ΔY>0:&#x20;

he will receive:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FfJz59nFMP1LWxtm5BY3q%2Fimage.png?alt=media&#x26;token=8d6fc27a-752c-4e24-8ecb-8b765ff54589" alt=""></div>

### Sell X:

If a trader wants to buy amount 0<ΔY< Yc, he should pay:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FiasTBqScMSZjcgY8EAgg%2Fimage.png?alt=media&#x26;token=31209434-27d6-46f5-ab5b-d3208bffa2d8" alt=""></div>

If a trader wants to sell amount ΔX>0, he will receive:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FXLEOnTAKjmfjd4Dbg6pV%2Fimage.png?alt=media&#x26;token=2051980b-de98-4e27-9363-52191dca0dd4" alt=""></div>

Implementing fees will change the optimal arbitrage strategy as follows:

* If q>1 and f(q)<1/(1+ɛ), the buy strategy would be:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2F0R5vArcoBFQxVAqjttH8%2Fimage.png?alt=media&#x26;token=bf1cc12d-d154-4c81-b6e1-57654e725570" alt=""></div>

* if q<1 and f(q)> 1+ɛ, the sell strategy would be:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FqeUvjAbTfN9bgFRVYKOl%2Fimage.png?alt=media&#x26;token=2ab631d5-ac1d-438b-a08e-3650056e6d5d" alt=""></div>


---

# 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://flype-protocol.gitbook.io/flype-protocol/imm/the-math-behind-imm/transaction-fee.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.
