> For the complete documentation index, see [llms.txt](https://docs.delphirhc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delphirhc.com/the-oracle/manipulation-resistance.md).

# Manipulation resistance

A plain TWAP is already much harder to move than a spot price, because the attacker has to hold the pool at a false price for a meaningful share of the window rather than for one block. Delphi adds a second defence that limits how far the recorded price can move per second, so that even a single enormous swap cannot write an extreme value into the history.

## The rate limit

The tick the oracle records is not always the pool's actual tick. It is the pool's tick clamped to a band around the previously recorded tick, and the band widens with time: the recorded tick may move at most 300 ticks per second, which is roughly three percent per second or about six times per minute. A pool that trades continuously and moves at ordinary speeds never hits the limit, so the recorded tick and the real tick are the same.

Idle time counts toward the allowance, but only up to thirty seconds. Without that cap a pool that had been quiet for an hour would have accumulated enough allowance for a single swap to jump the recorded price anywhere, which is exactly the situation the limit exists to prevent.

## What an attacker faces

Consider a swap that pushes spot up five hundred percent in one block. The pool's real tick jumps, but the recorded tick moves at most as far as the allowance permits, and then continues to move toward the real tick at the capped rate on every subsequent swap or read. To get the recorded price to the false level the attacker has to keep the pool there while the cap catches up, and to move a thirty-minute average appreciably they have to keep it there for a large part of thirty minutes. During that whole time the pool is mispriced against every other venue, and anyone can sell into it at the inflated price. The cost of the attack is the arbitrage they hand out, and it grows with both the size of the move and the length of the window.

The consequence is the one you want: an oracle that lags a genuine sharp move for a few minutes, and that barely notices a move which is sold back within the same block.

## What it does not do

The rate limit does not make thin pools safe by itself. A pool with very little liquidity can be moved far for very little money, and if the attacker is willing to hold it there the average will follow. That is why the oracle exposes `depth`, so a reader can measure how much quote asset it takes to move the price and refuse to trust pools where the answer is small. See [Maturity and depth](/the-oracle/maturity-and-depth.md).


---

# 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.delphirhc.com/the-oracle/manipulation-resistance.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.
