> For the complete documentation index, see [llms.txt](https://docs.lexer.markets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lexer.markets/innovations-and-mechanism/risk-control.md).

# Risk Control

LEXER aims to reduce risk as much as possible in order to protect liquidity provider's fund and to provide a safe and fair protocol for traders to swap and trade perpetual future contracts.&#x20;

## Oracle Updates: Frontrunning Risks

**Risk**: By knowing the next Oracle price, bots could potentially harm the liquidity pool if they frontrun the price update transaction with that knowledge.

**Control**: Continuous on-chain Oracle price update is necessary to maintain the swap and perpetual service on LEXER. Though we are not able to prevent bots from knowing the price on the next Oracle update, one effective way of risk control is to disconnect the order request and order execution.

**Implementation**: LEXER handles traders' order requests and order executions in two separate transactions.

## Price Manipulation

**Risk**: Manipulators could potentially take deterministic profit by making future contract trades by manipulating the oracle price and draining the liquidity pool.

**Control**: Multiple past exploits indicate that simply getting Chainlink price feeds may not reflect the actual market condition and that the majority of manipulation takes advantage on thin depth of liquidity to move the market and execute an exploit.

**Implementation**: After considerable research, our oracle price takes orderbook depth from different centralized exchanges, such as Binance, OKX and Bybit into consideration. Lexer also has standards in picking markets with rich liquidity depth or high market cap to further decrease the chance of manipulation risk.&#x20;


---

# 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.lexer.markets/innovations-and-mechanism/risk-control.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.
