> 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/configuration/market-time-and-state-settings.md).

# Market Time & State Settings

### Extend market resolution time

#### **Description**

If the timeout extension mechanism within the system is structured to easily react to small actions and extend the timeout, a malicious actor can repeatedly inject small bets to extend the timeout indefinitely.&#x20;

This could expose the market to DoS attacks in the form of denial of settlement, where attackers intentionally create a zombie state in the market, tying up liquidity or paralyzing the settlement process.

#### Attack Scenario

<figure><img src="https://4210179539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2DiVEbUgCTsp2iPassR9%2Fuploads%2FxddsTrq5ZQy88ZRpYuXG%2Fimage.png?alt=media&amp;token=850a81b7-5016-4788-b6f3-67434da20850" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}
To prevent last-minute sniping, a "5-minute extension of the closing time if a bet is placed within 5 minutes of the end of the game" rule exists. However, there is no minimum bet amount or maximum extension time.
{% endstep %}

{% step %}
The attacker repeatedly injects tiny bets (e.g., 0.0001 USDC) at the "dust" level as the market closes. While costing virtually nothing, this continually extends the market's closing time.
{% endstep %}

{% step %}
This causes the market to remain permanently closed, preventing normal settlement and withdrawals.\
Attackers force the market to remain open, waiting for critical news to break, then enter large positions to reap guaranteed profits. The once-fair market is distorted into a "never-ending game" by the attacker.
{% endstep %}
{% endstepper %}

#### **Mitigation**

* **Abnormal pattern monitoring and emergency measures**
  * Detects delay manipulation patterns, such as repeated small bets just before closing and state changes after resolution, based on on-chain logs.
  * Establish operational processes such as `emergencyStop` to immediately halt transactions when necessary, swiftly blocking attempts at market manipulation.


---

# 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/configuration/market-time-and-state-settings.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.
