> For the complete documentation index, see [llms.txt](https://docs.crescent.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crescent.network/introduction/crescent-dex/sequential-matching.md).

# Sequential Matching

Most orders are processed in batches, but some orders are processed sequentially for additional features like multi-hop swap. Since sequential matching happens after batch matching, it has no effect on batch matching and will require higher fees than normal, so it should only be used when absolutely necessary.

Unlike batch matching, sequential matching makes it easier for users to predict in advance how much they will receive from a swap. This isn't just about increased predictability of transaction outcomes, it also means that it's easier to bundle multiple actions involving swaps and process them all at once. To illustrate, consider a scenario where a liquidity provider possesses only one token and intends to swap a portion of it before providing liquidity within a desired price range. By considering only the state of the pool and their own order, without taking into account other users' orders, it becomes feasible to calculate how their order will impact the pool's price and determine the percentage of each token that should be offered within their desired price range based on the adjusted price.

This enhanced modularity of the swap function allows for the composition of multiple actions as a combination of different functions, which can then be processed together within a module. This capability streamlines the execution of multi transactions and contributes to a more efficient and flexible trading experience.

It might be difficult to completely prevent MEVs during the sequential match phase, so in the future, we may decide to open up slots to users who want MEVs, charge a large fee, and return the revenue to ecosystem participants.

<figure><img src="/files/nj8jS8byJzrfDkdi3KOj" alt=""><figcaption><p>Concept of sequential matching</p></figcaption></figure>


---

# 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://docs.crescent.network/introduction/crescent-dex/sequential-matching.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.
