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:
- Inputs: The tokens a user is willing to provide (using Permit2 for authorization)
- Outputs: The tokens and amounts the user expects to receive in return
- 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
- A user creates and signs an order specifying inputs (assets they provide) and outputs (assets they want)
- The order is submitted to the orders cache where it awaits fulfillment
- Market participants (searchers and fillers) find and fulfill orders by providing the requested outputs
- The order executes atomically, with all conditions verified before completion
Order Lifecycle
Orders progress through several states during their lifetime:
- Creation: User specifies inputs/outputs and signs the order
- Submission: Order is submitted to the orders cache
- Matching: Order waits for a counterparty to fulfill it
- Execution: Order is executed when all conditions are met
- 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:
- Order Processing: Learn how orders are processed and executed
- Working with Orders: Practical guide to creating and managing orders
- Market Participants: Understand the roles involved in the order ecosystem
- Bundles and Orders: How orders are grouped for execution
- Application Use Cases: Real-world examples and patterns