TESTNET ONLINE: PECORINO PECORINO

Orders Overview

Signet’s Orders 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}

Source: Exact type definitions from signet-sdk/crates/types/src/signing/order.rs

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

SDK Integration

Working with Orders requires the following SDK packages:

Best Practices

Orders are designed to be safe for users, but market participants should follow these best practices:

For Users

User Guidelines: SignedOrders can be shared publicly. The Signet protocol is designed so your inputs cannot be transferred until the exact outputs you specified are provided.

For Fillers

Important Best Practices:
  • Keep SignedFills Private: Never share SignedFills publicly. They authorize token transfers from your account and should remain confidential until mined.
  • Use Private Transaction Relays: Submit bundles containing SignedFills through trusted, private channels to prevent front-running.
  • Validate Before Signing: Always validate orders and fills before signing to ensure they meet your economic requirements.
  • Atomic Submission: Only submit SignedFills atomically with their corresponding SignedOrders to ensure you receive the inputs.

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