> For the complete documentation index, see [llms.txt](https://dexx.gitbook.io/dexx-tutorial-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dexx.gitbook.io/dexx-tutorial-book/q-and-a/what-is-a-sandwich-attack-and-how-can-i-check-if-ive-been-attacked.md).

# What is a "sandwich attack," and how can I check if I’ve been attacked?

A sandwich bot attack is a common malicious trading tactic that occurs on-chain. It typically involves high-frequency trading bots (often called sandwich bots) that quickly buy or sell tokens to capitalize on price discrepancies. These bots may engage in front-running transactions or manipulate gas fees to complete transactions before regular users, allowing them to profit from price changes.You might be a victim of a sandwich bot attack if you notice the following signs:

1. **Significant Price Difference:** The actual price of your transaction differs greatly from the price just a second earlier.
2. **Coinciding Transactions:** There’s a buy and a sell transaction right before and after your trade, both originating from the same address.
3. **Bot Mark:** Your transaction address is marked as a bot on DEXTOOLS.
4. **Typical Trade Amounts:** The amounts being traded by the bot usually fall between $6,000 and $9,000.
5. **Your Transaction Type:** Your transaction is a buy order.

\
If your trade doesn’t meet these criteria, it's likely that you weren't attacked by a sandwich bot, but rather that someone else made a trade ahead of you, driving the price up.To protect yourself from these attacks, you can activate the "MEV protection" in DEXX, which can help prevent this risk.


---

# 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:

```
GET https://dexx.gitbook.io/dexx-tutorial-book/q-and-a/what-is-a-sandwich-attack-and-how-can-i-check-if-ive-been-attacked.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.
