Magnet
  • Welcome to Magnet
  • Overview
    • Magnet Network Features
      • Magnet Coretime
      • Coretime Order Control and Assurance
      • Workflows of Magnet Network
      • Profit Calcuation and Distribution
    • Magnet Stack Features
      • Magnet Stack Coretime Modules
  • Product Guides
    • Setup a Local Node
      • Installing Substrate Dependencies
      • Launching the Local Relay Chain
      • Build the Magnet Node
      • Prepare the parachain Collator
      • Register on the Local Relay Chain
    • Deploy Contracts on Magnet Network
      • EVM Contract Deployment
      • WASM Contract Deployment
      • MoveVM Contract Deployment
    • Bridge Asset
      • Bridging Asset between EVM and Substrate
      • Bridging Asset with XCM
    • Develop Coretime-Ready chain with Magnet Stack
      • Preparation: Reserve a ParaID
      • Preparation: Generate the Collator's Address
      • Preparation: Purchase Bulk Core
      • Using Magnet Stack : Coretime Configuration
      • Using Magnet Stack : Virtual Machine Configuration
      • Using Magnet Stack : Functional Models
      • Using Magnet Stack : Summary
      • Deployment & Connection to Rocococ
        • Define the collator's address
Powered by GitBook
On this page
  • On-demand Coretime Module:
  • Bulk Coretime Order Module:
  • Magnet Stack Coretime Workflow:
  1. Overview
  2. Magnet Stack Features

Magnet Stack Coretime Modules

Implementation and Workflow

PreviousMagnet Stack FeaturesNextSetup a Local Node

Last updated 9 months ago

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}} coretime pricegas fee collected​ ). 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:

  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

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

if gas fee collectedcoretime price≤price threshold,\frac{\text{gas fee collected}}{\text{coretime price}} \leq \text{price threshold}, coretime pricegas fee collected​≤price threshold, then keep waiting, until both conditions are met.