> For the complete documentation index, see [llms.txt](https://flype-protocol.gitbook.io/flype-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flype-protocol.gitbook.io/flype-protocol/imm/the-math-behind-imm/transaction-fee.md).

# 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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;token=2ab631d5-ac1d-438b-a08e-3650056e6d5d" alt=""></div>
