Cross-Chain Swap

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.

Last updated