Magnet Stack Coretime Modules
Implementation and Workflow
Last updated
Implementation and Workflow
Last updated
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 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 ( ). 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.
Coretime order requests are fulfilled through bulk purchases or via Lastic if available.(future steps)
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)
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 , coretime order will be placed;
if then keep waiting, until both conditions are met.
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