> For the complete documentation index, see [llms.txt](https://hyperalpha.gitbook.io/hyperalpha-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hyperalpha.gitbook.io/hyperalpha-docs/platform-features/order-timeout-and-auto-cancellation.md).

# Order Timeout & Auto-Cancellation

In high-velocity derivative execution environments, unfilled Limit Orders (Maker Mode) operating without structural constraints hide catastrophic systemic risks.

HyperAlpha (hyperalpha.org) features an institutional-grade, continuous Automated Timeout Cleanup system. Running as a dedicated background daemon, this module ensures that your deployed margin balance commands maximum liquidity and is programmatically barred from becoming trapped at obsolete, toxic price echelons.

### 1. The Quantitative Imperative of the Timeout Mechanism

* Eradicating Capital Stagnation: Every unfilled pending order blocks and locks a precise quota of your active clearing margin. The automated timeout cleanup mechanism promptly purges these stagnant liabilities, releasing frozen cash flow back to your profile to capture the next incoming high-conviction signal.
* Intercepting "Toxic Passive Fills": Cryptocurrency perpetual markets expand and compress within milliseconds. A limit entry calculated 5 minutes ago becomes highly hazardous during sudden market trend reversals or cascading protocol liquidations. Without a programmatic auto-cancellation guardrail, your terminal risks absorbing a "toxic passive fill" at a severe disadvantageous market extreme exactly as a master profile capitulates.

### 2. Microsecond Technical Execution Infrastructure

The exact millisecond a copy or discretionary limit order intent is fired onto the ledger, the HyperAlpha framework assigns an immutable cryptographic Lifecycle Timestamp to the transaction metadata:

#### Precision Expiration Calculation Formula

The engine processes your custom specified timeout variable (configured in minutes) to hard-code the exact absolute epoch timestamp ($$ExpireTime$$) governing the order viability:

$$ExpireTime = FollowTime + (\text{Timeout} \times 60,000 \text{ ms})$$

#### High-Concurrency Asynchronous Sweeping Loop

1. Continuous Telemetry Polling: HyperAlpha’s high-frequency Scheduler Service maps the active state machine every 5 seconds, running multi-threaded sweeps across all database log entries tagged with an active `Open` or `Pending` status.
2. Threshold Bridge Detection: The absolute millisecond the platform’s core atomic clock outpaces the pre-calculated $$ $ExpireTime$ $$ while the ledger reports the order status as un-executed.
3. Programmatic Invalidation: The engine bypasses standard interface queues to dispatch a high-priority `Cancel Order` command straight into the Hyperliquid matching engine, programmatically freeing your locked margin balance with zero latency.

### 3. Position-Sizing & Timeline Tailoring Strategies

Operators can micro-adjust their expiration lifecycles inside the \[Copy-Trading Settings] dashboard to seamlessly align the timeout variables with their underlying trading thesis:

* Aggressive Settings (High-Frequency Scalping): Enforce a tight 1 - 3 minute execution window. This limits your capital to participating exclusively in immediate, momentum-driven price action, mitigating structural tail risk.
* Conservative Settings (Macro Swing Allocations): Extend parameters to a 10 - 30 minute envelope. This expands the "Breathing Room" of the order block, granting the horizontal order-book spread ample time to fluctuate and secure your targeted limit entry price.
* Standard Safety Window: If left unconfigured, the infrastructure natively deploys an automated 5-minute default fallback safety window.


---

# 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:

```
GET https://hyperalpha.gitbook.io/hyperalpha-docs/platform-features/order-timeout-and-auto-cancellation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
