Order Processor pallet

Before attempting to use the order processor pallet directly we recommend reading the Coretime Order Processing ⚙️ page.

We are looking forward to see the development of programs which will fulfill a coretime order when seeing a profitable opportunity.

Risks & Rewards

The orders pallet is designed to minimize risk for anyone looking to fulfill an order. To reduce these risks, we have implemented the following limitations for order creators and contributors:

  • Only expired orders can be canceled. Orders looking for a region that is currently or will be active in the future cannot be canceled. This ensures that when someone purchases a region to fulfill an order, they are not at risk of the order creator canceling it. This way, they can be confident that the order can be fulfilled, unless another user fulfills it before them. Expired orders are those that were not fulfilled, and the region they are looking for has already expired. These regions hold no real value, and anyone can cancel the order so that contributors can claim their contributions. Fulfilling such order is restricted.

  • Contributions can only be removed for expired orders. This restriction is implemented so that the user fulfilling the order can know in advance the amount they will receive before purchasing the region they will sell.

The reward of selling a region to an order is receiving all the tokens that were collected by the order.

Rewards for contributing to an order can vary depending on the parachain. It is up to the parachains/order creators to define how they will incentivize contributions. With further development on RegionX, we will facilitate the process of rewarding contributors for parachains.

fulfill_order

Extrinsic for fulfilling an order.

Arguments:

  • origin: Signed origin; the region owner.

  • order_id: The order which the caller intends to fulfill.

  • region_id: The region that the caller intends to sell to the Coretime order. The region must match the order requirements otherwise the extrinsic will fail

pub fn fulfill_order(
    origin: OriginFor<T>,
    order_id: OrderId,
    region_id: RegionId,
) -> DispatchResult { }

The order must not be expired; otherwise, the call will fail. If the region meets all the requirements and is not locked, the caller will receive the tokens accumulated by the order.

The function will send an XCM message to assign the region to the parachain specified by the order. The assignment will be Final.

If the XCM message fails to be sent, the region assignment will be stored in the RegionAssignments storage map. Using the assign extrinsic, anyone can attempt to make the assignment call, ideally after the issue is resolved.

assign

Assign a region to the specific para_id.

Arguments:

  • origin: Signed origin; can be anyone.

  • region_id: The region that the caller intends assign. Must be found in theRegionAssignments mapping.

pub fn assign(origin: OriginFor<T>, region_id: RegionId) -> DispatchResult { }

Extrinsic used to reattempt assigning a region after the initial attempt failed during fulfillment.

Last updated