# Magnet Stack Coretime Modules

In Magnet Stack, developers have the option to select either the On-demand or Bulk coretime module, depending on their business needs.

### On-demand Coretime Module:

On-demand coretime orders are placed immediately if the profit control conditions are met.

**Profit Control Mechanism:**&#x20;

* Price Limit: Ensures coretime price per block does not exceed a predefined limit.
* Price Threshold (Profit Control): Allows developers to set a target threshold for gas fees in relation to coretime prices ( $$\frac{\text{gas fee collected}}{\text{coretime price}}$$ ). For instance, setting the threshold to 1 means the gas fee matches the coretime price, a value above 1 indicates a profit, and a value below 1 (e.g., 0.7) indicates an acceptable loss.

**Assurance Mechanism**&#x20;

When the on-demand coretime order is paused by profit control beyond the bid threshold set by developers, the assurance mechanism triggers the use of reserve funds to order the necessary blockspace. This prevents excessive waiting times and guarantees timely transaction processing. The system continuously monitors transaction pool gas, coretime prices, and block intervals, activating the assurance mechanism as needed to maintain smooth network operations and financial stability.&#x20;

### Bulk Coretime Order Module:

Coretime order requests are fulfilled through bulk purchases or via Lastic if available.（future steps）

<br>

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXcE2HuXshNHsJYCv9F4tP4W0QwVU8t9smIPnzZBsduPKxRYuJHq8Y6hu08rRczQ6iCrjbAUNUv-WJtXDRN8agNgF5RdHiaiXREaOGavJwFqs3BtqMC3ylockTuuyNxoWp2KsdwsXih8nmSdUoAedvPmN50d?key=3EZhrI3QszGfRLIfgGwqFA" alt="" width="563"><figcaption></figcaption></figure>

### Magnet Stack Coretime Workflow：

\
**On-Demand mode:**

The system first checks if the current coretime price is within the user-configured price limit (the price limit is zero by default indicating no limit)

1. If Assurance function is disabled, the system will keep checking until the the coretime pirce is within limit.

   When the coretime price is within list, the following criteria determine whether gas fees justify the coretime expense:&#x20;

   * If $$\frac{\text{gas fee collected}}{\text{coretime price}} \geq \text{price threshold}$$, coretime order will be placed;
   * if $$\frac{\text{gas fee collected}}{\text{coretime price}} \leq \text{price threshold},$$ then keep waiting, until both conditions are met.
2. In the enabled state of the assurances pallet, if the bid threshold (time threshold) is exceeded, then  `create_order` function will be called to place coretime order

<br>


---

# 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-stack-features/magnet-stack-coretime-modules.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.
