Mach 2
  • Getting Started
    • What is Mach?
    • Mach 2
      • Optimistic Settlement
      • Intents
      • Order Matching
      • Stables & RWAs
    • Trade Lifecycle
  • Navigation
    • Users
      • FAQ
    • Market Makers
  • Protocol
    • Overview
      • Cross-Chain Swap
      • Challenge Process
    • CCTP
    • LayerZero
    • API
      • Integration
    • Staging
    • Deployed Contracts
    • Supported Assets
    • Security
  • Whitepaper
  • Audits
  • Github
Powered by GitBook
On this page
  • Step 1: User Signs the Trade
  • Step 2: Market Maker Matches the Trade
  • Step 3: Market Maker Proposes and Executes the Match
  • Step 4: Market Maker Finalized Trade - Funds are Settled
  1. Protocol
  2. Overview

Cross-Chain Swap

PreviousOverviewNextChallenge Process

Last updated 12 months ago

Step 1: User Signs the Trade

The user calls the placetrade function which signs permission for the user's limit order on the source chain.

Step 2: Market Maker Matches the Trade

The market maker calls placetrade with inverse inputs, to match the user's limit order with an equal and opposite order.

Step 3: Market Maker Proposes and Executes the Match

The market maker calls proposematch and executematch on both chains. These functions link the user's order with the market maker's inverse order, preparing both sides for finalization.

Step 4: Market Maker Finalized Trade - Funds are Settled

The market maker calls finalizetrade only on the source chain. This completes the trade, transferring the tokens between the user and the market maker parties and settles the transactions.