> For the complete documentation index, see [llms.txt](https://funarchy.gitbook.io/funarchy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://funarchy.gitbook.io/funarchy/security-for-prediction-market/oracle-and-data/oracle-data-validation-logic-insufficiency.md).

# Oracle Data Validation Logic Insufficiency

<figure><img src="https://4210179539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2DiVEbUgCTsp2iPassR9%2Fuploads%2FsFdky99hPhNHOpEMsCfA%2Fimage.png?alt=media&amp;token=e49d3618-e793-41b0-bb84-ce21eba73236" alt=""><figcaption></figcaption></figure>

#### Description

In prediction markets, external data provided by oracles is a key factor in directly determining the market's final outcome.

However, if the protocol relies on this data without internal validation, there is a risk that abnormal values, such as errors and outliers, will be directly reflected in the settlement logic.

Without a minimal verification layer to verify the authenticity or normality of data, temporary glitches or abnormal values ​​in oracles can be immediately confirmed as "results," resulting in unfair settlements for users that are different from reality and undermining the integrity of the entire market.

Ultimately, the absence of data verification logic is a structural vulnerability in prediction markets that leads to the following chain of consequences.

> **Single oracle dependency + lack of protocol validation → error propagation → incorrect settlement → user financial loss**

#### Real World Case Study

{% hint style="info" %}
[**Chainlink Oracle Error Issue**](https://ambcrypto.com/chainlink-oracle-glitch-costs-moonwell-1m-as-defi-suffers-another-exploit/)
{% endhint %}

There was an incident where an error occurred in the internal aggregation process of Chainlink's price feed, resulting in a value posted on-chain that was significantly higher than the actual market price of wrstETH.

This wasn't a normal price fluctuation in the market, but rather a temporary glitch in the oracle system, resulting in incorrect data. The protocol was designed to trust this value without verification, and the attacker successfully used the abnormally high collateral price to execute excessive loans and drain funds.

This case clearly demonstrates that even highly reliable oracles can provide incorrect values ​​due to technical flaws, and without a validation layer to filter or block these errors, a single error can lead to the loss of the entire protocol.

In particular, since Polymarket uses the Chainlink price at a specific point in time as the settlement standard, there is a structural risk that an incorrect snapshot will be confirmed as the market result if a similar oracle error occurs.

#### Mitigation

* **Outlier Detection → Restricted Governance Override**
  * If the value provided by the oracle shows a statistically significant outlier compared to the norm, the tick is not used for immediate settlement, but a Liveness Period is opened to allow for a Challenge, allowing limited governance intervention.\
    \
    This method can effectively mitigate the risk of settlement errors by selectively filtering out only exceptional situations such as oracle errors and system glitches while maintaining normal automatic settlement speed.
* **Explicit Rulebook Specification for Outlier Handling**
  * Because the way oracle values ​​are processed directly impacts settlement results, any exceptions or correction logic must be clearly defined in advance in the rulebook and communicated to users. In particular, filtering techniques such as applying TWAP or removing outliers can inherently distort the settlement criteria of prediction markets because the values themselves are replaced with processed values rather than the “actual data at that moment” observed in reality.\
    \
    Therefore, such filtering should not be applied arbitrarily, and if the rulebook clearly states "in what circumstances and how it is used in a limited manner," it can address the technical risks of prediction markets without harming user trust.


---

# 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://funarchy.gitbook.io/funarchy/security-for-prediction-market/oracle-and-data/oracle-data-validation-logic-insufficiency.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.
