> For the complete documentation index, see [llms.txt](https://docs.autonomynetwork.io/autonomy-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autonomynetwork.io/autonomy-docs/autonomy-network/products/autoswap/integrating-limits-stops-into-your-dex.md).

# Integrating Limits/Stops Into Your DEX

Especially after the collapse of FTX, centralized exchange (CEX) users are moving to DEXes, compounding the trend of DEX volume eating up CEX volume. Currently DEXes typically only provide market orders, and these new users coming from CEXes are demanding the features they're used to using - namely, limit orders and stop losses. Fortunately it's easy to add these onto an existing DEX without any modification to the underlying DEX! [AutoSwap](https://autoswap.trade/) is an example of this.

Generally, as with anything on Autonomy, the condition and action of a `Request` needs to be defined in a smart contract so that the condition can be guaranteed - this is the smart contract that is the `target` of a `Request` . The same condition/action contract can be used for many DEXes that have the same interface, such as UniswapV2 forks. DEXes that are unique require a modified condition/action contract that uses the interface of the unique DEX.

## UniswapV2 Forks

The condition/action contract for UniswapV2 forks [already exists](https://github.com/Autonomy-Network/uniV2-limits-stops/blob/master/contracts/UniV2LimitsStops.sol) and is deployed on many EVM chains! Integrating limits/stops into your DEX therefore requires no new contracts to be deployed, it only requires modification to your UI.

Fortunately this modification is made even easier with our frontend SDKs:\
<https://www.npmjs.com/package/@autonomylabs/limit-stop-orders>\
<https://www.npmjs.com/package/@autonomylabs/limit-orders-react>

## Other DEXes

If your DEX is not a UniswapV2 fork, then the [UniswapV2 condition/action contract](https://github.com/Autonomy-Network/uniV2-limits-stops/blob/master/contracts/UniV2LimitsStops.sol) needs to be modified slightly to use the interface of your DEX. This can be done by your team or Autonomy depending on the specific situation - hop into our Discord and create a ticket to chat with us about your situation! Either way it should require fairly minor changes and take only 1-2 weeks.


---

# 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.autonomynetwork.io/autonomy-docs/autonomy-network/products/autoswap/integrating-limits-stops-into-your-dex.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.
