LogoLogo
  • Learn About Signet
    • Simplifying the Rollup
    • No Proofs or State Roots
    • Simple sequencing
    • Cross-chain transfers on Signet
  • Build on Signet
    • Smart Contracts
      • Passage
      • Transactor
      • Orders
        • Order Processing
        • Working with Orders
        • Market Participants
        • Bundles and Orders
        • Application Use Cases
      • Zenith
      • Permit2
    • EVM Behavior
    • Signet SDK
      • signet-zenith
      • signet-types
      • signet-extract
      • signet-evm
      • signet-bundle
      • signet-rpc
  • More info
  • FAQ
  • Glossary
  • Twitter
  • Github
Powered by GitBook
On this page
  • Conditional transactions via Signed Orders
  • Technical Order Structure
  • Permit2 Batches
  • For Users: Working with Orders
  • Related Pages
  1. Build on Signet
  2. Smart Contracts
  3. Orders

Working with Orders

Practical guide to creating and using Signed Orders. Covers structure, creation process, status monitoring, and best practices with code examples for seamless integration.

Conditional transactions via Signed Orders

Signet orders use the Permit2 standard, allowing users to authorize token transfers with a single signature. This intent mechanism powers Signet's swaps, allowing users to express intents like:

"I want to swap 5 Signet ETH for 1000 USDC on Ethereum"

Nothing happens if the exact conditions you specify are not met.

Technical Order Structure

// Wrapper with order ID
pub struct Order {
    /// The order id. This is the signature of the order.
    pub id: String,
    /// The order.
    pub order: SignedOrder,
}

// Core signed order structure
pub struct SignedOrder {
    /// The permit batch.
    #[serde(flatten)]
    pub permit: Permit2Batch,
    /// The desired outputs.
    pub outputs: Vec<Output>,
}

// Output definition
pub struct Output {
    pub token: Address,
    pub amount: Uint<256, 4>,
    pub recipient: Address,
    pub chainId: u32,
}

Permit2 Batches

// Permit2 batches
pub struct Permit2Batch {
    pub permit: PermitBatchTransferFrom,
    pub owner: Address,
    pub signature: Bytes,
}

Permit2 batches contain individually signed transactions, allowing multiple inputs (what the user provides) to map to desired outputs (what the user receives).

For Users: Working with Orders

Users interact with Signet's order system primarily when moving assets from Signet to Ethereum.

Creating a Signed Order

To create a Signed Order, follow these steps:

  1. Decide which assets you're willing to provide (inputs) and what you want to receive (outputs)

  2. Authorize the Permit2 contract to manage your tokens

  3. Sign the order with your wallet

  4. Submit the order to the orders cache

{
  // Inputs (what you're providing)
  "inputs": [
    {
      "token": "0x...", // Address of token on Signet
      "amount": "1000000000000000000" // 1 ETH in wei
    }
  ],
  // Outputs (what you want to receive)
  "outputs": [
    {
      "token": "0x...", // Address of USDC on Ethereum
      "amount": "1000000000", // 1000 USDC with 6 decimals
      "recipient": "0x...", // Your Ethereum address
      "chainId": 1 // Ethereum mainnet
    }
  ]
}

Order Status

You can check the status of your orders:

  • Pending: Order is in the cache waiting to be filled

  • Filled: Order has been successfully executed

  • Expired: Order has passed its deadline without being filled

User Best Practices

  • Set reasonable price expectations for cross-chain swaps

  • Monitor orders that remain unfilled for extended periods

  • Consider setting a deadline to ensure stale orders don't execute at unfavorable rates

Related Pages

PreviousOrder ProcessingNextMarket Participants

Last updated 19 days ago

Working with Orders
Market Participants
Order Processing
Permit2