> For the complete documentation index, see [llms.txt](https://eigenphi-1.gitbook.io/classroom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eigenphi-1.gitbook.io/classroom/mev-types/arbitrage/arbitrage-using-2-tokens-between-2-trading-venues.md).

# Arbitrage Using 2 Tokens Between 2 Trading Venues

We will start with the simplest arbitrage, which is the most straightforward incarnation of "buy low and sell high." &#x20;

For the sake of clarity, we will use liquidity pools, LP, to refer to different kinds of trading venues.

[Searchers](/classroom/users-of-eigenphi/searcher.md) undertake two transactions involving two tokens between two liquidity pools utilizing the exchange rate spread of the tokens.&#x20;

Here comes Alice. Being a searcher, she finds the exchange rate of $USDC for $WETH in a liquidity pool--called LP1- on UniSwap v3 is 2,900:1, which means 2,900 $USDC for 1 $WETH. Meanwhile, the exchange rate of the same pair in another liquidity pool--called LP2--on UniSwap v3 is 3,050:1, which means 1 $WETH can exchange for 3,050 $USDC.&#x20;

Alice sees an arbitrage opportunity here: the price of $WETH for $USDC in LP2 is lower than in LP1. Here is what Alican does:&#x20;

1. Alice sells 100 $WETH in LP2 and receives 305,000 $USDC.&#x20;
2. Alice sells 305,000 $USDC in LP1 and receives 105.27 $WETH.&#x20;

![](/files/Az3pyXMNfjzlH3w4MTxN)

Now the arbitrage is done, and Alice's revenue is 5.27 $WETH, resulting from 105.27 $WETH minus 100 $WETH.&#x20;

The cost of this arbitrage is the gas fees of the two transactions Alice paid to the network. Let's assume it is 0.01 $WETH. Then the profit Alice reaped from this arbitrage is 5.26 $WETH, resulting from 5.27 $WETH minus 0.01 $WETH.&#x20;

After having some basic ideas about arbitrage, let's move on to more complicated ones.


---

# 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://eigenphi-1.gitbook.io/classroom/mev-types/arbitrage/arbitrage-using-2-tokens-between-2-trading-venues.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.
