# Coretime Order Control and Assurance

{% hint style="info" %}
Coretime order control and assurance functions are for on-demand coretime only.
{% endhint %}

#### Coretime Orders and Price Control

**Price Limit:**\
The Price Limit is a parameter that sets the maximum allowable price for coretime orders. This limit ensures that users are protected from excessive costs, particularly during periods of high demand or network congestion.&#x20;

**Price Threshold:**\
The Price Threshold controls profitability from gas collection.&#x20;

$$
\text{Price Threshold} = \frac{\text{Gas Fee Collected}}{\text{Coretime Price}}
$$

For example, a threshold of 0.7 means that the total gas fee collection equals 70% of the real-time on-demand coretime price, implying that a 30% loss is acceptable; a threshold of 1.6 means that the total gas fee collection equals 160% of the real-time on-demand coretime price, implying that a 60% profit is required.

**Coretime Workflow：**&#x49;n the on-demand model, the system first checks if the current core time price is within the user-configured price limit (setting price limit = 0 disables this check). If the price exceeds the limit and Assurance is disabled, the system continuously checks until the core time price is within the limit. It then compares the gas fee with the core time cost: if (gas fee collected / core time price) > price threshold, it purchases core time; otherwise, it waits until both conditions are met. If Assurance is enabled and any condition is not met, the assurance pallet checks the difference between the current block number of the relay chain and last bid block number. If the difference is bigger than “bid threshold”, then Assurance pallet calls create\_order function to place order.

#### **Assurance Mechanism in Magnet**

Magnet’s Assurance mechanism is designed to ensure the reliability and execution of coretime orders, providing a safeguard against disruptions in block production.&#x20;

In cases where coretime order placement is halted by the order control mechanisms (Price Limit & Price Threshold) for an extended period, the Assurance mechanism steps in. If the halt persists beyond the defined bid threshold—measured in relay chain blocks—this function forces the placement of the coretime order, ensuring that block production continues uninterrupted.

For example, if the bid threshold is set to 8 relay chain blocks, the Assurance mechanism allows the system to pause on-demand order placement for up to 8 blocks if the Price Limit and Price Threshold conditions are not met. Beyond this threshold, the Assurance mechanism intervenes to guarantee that orders are placed and the network remains stable.


---

# Agent Instructions: 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://doc.magport.io/overview/magnet-network-features/coretime-order-control-and-assurance.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.
