TESTNET ONLINE: PECORINO PECORINO

Orders Overview

Signet’s order system provides a flexible, secure mechanism for conditional cross-chain transactions. It uses the Permit2 standard to enable users to express complex transaction intents that execute only when specific conditions are met.

What are Orders?

Orders are signed messages that express a user’s intent to trade assets across chains. They consist of:

  1. Inputs: The tokens a user is willing to provide (using Permit2 for authorization)
  2. Outputs: The tokens and amounts the user expects to receive in return
  3. Conditions: Requirements that must be met for the order to execute
 1// Signed orders
 2pub struct SignedOrder {
 3    /// The permit batch.
 4    #[serde(flatten)]
 5    pub permit: Permit2Batch,
 6    /// The desired outputs.
 7    pub outputs: Vec<Output>,
 8}
 9
10// Permit2 batches
11pub struct Permit2Batch {
12    pub permit: <PermitBatchTransferFrom as SolType>::RustType,
13    pub owner: Address,
14    pub signature: Bytes,
15}

Key Features

  • Conditional Execution: Orders only execute if the exact specified conditions are met
  • Cross-Chain Compatibility: Seamlessly move assets between Signet and Ethereum
  • User Control: Users maintain full control over their assets until execution
  • Atomic Execution: All parts of an order execute together or none at all
  • No Required Escrow: Users don’t need to lock up assets before transactions

How Orders Work

  1. A user creates and signs an order specifying inputs (assets they provide) and outputs (assets they want)
  2. The order is submitted to the orders cache where it awaits fulfillment
  3. Market participants (searchers and fillers) find and fulfill orders by providing the requested outputs
  4. The order executes atomically, with all conditions verified before completion

Order Lifecycle

Orders progress through several states during their lifetime:

  1. Creation: User specifies inputs/outputs and signs the order
  2. Submission: Order is submitted to the orders cache
  3. Matching: Order waits for a counterparty to fulfill it
  4. Execution: Order is executed when all conditions are met
  5. Completion: Assets are transferred to their respective recipients

Applications

The Orders system enables a wide range of applications, including:

  • Cross-chain Swaps: Exchange assets between Signet and Ethereum
  • Limit Orders: Set specific price points for asset trades
  • Dollar-Cost Averaging: Schedule recurring purchases over time
  • Conditional Transfers: Execute transfers only when specific conditions are met

For more detailed information about Orders, explore the following sections: