Magnet Stack Coretime Modules

Implementation and Workflow

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:

  • 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 ( gas fee collectedcoretime price\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

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.

Bulk Coretime Order Module:

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

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:

    • If gas fee collectedcoretime priceprice threshold \frac{\text{gas fee collected}}{\text{coretime price}} \geq \text{price threshold} , coretime order will be placed;

    • if gas fee collectedcoretime priceprice threshold,\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

Last updated