Garden-1-Inch

Fusion+ swaps across Monad, Bitcoin, Starknet, Sui & more for seamless multi-chain trading.

Garden-1-Inch

Created At

Unite Defi

Project Description

⚑ Cross-Chain Order Resolution System

πŸš€ Overview

We built a full-stack cross-chain order resolution system that securely executes trades across multiple blockchains using microservices, event-based workflows, and deterministic smart contracts. This system allows seamless coordination between users on different chains using escrow contracts, automated resolvers, and real-time watchers.

Our architecture ensures atomic, trustless executionβ€”backed by deterministic deployments and a stateful backend that tracks every order from intent to fulfillment.


🧠 Architecture Breakdown

πŸ”© Core Components

  1. πŸ“ Resolver Contract – Smart contract that encapsulates order validation and escrow logic
  2. 🚚 Relayer Service – Exposes APIs for submitting and managing user orders
  3. βš™οΈ Resolver Service – Automatically matches and resolves orders between users across chains
  4. πŸ‘οΈ Watcher Service – Listens to on-chain events and updates the off-chain state accordingly
  5. πŸ§ͺ Client – Integration scripts or minimal frontend to test end-to-end flows

🧬 Deployment Strategy

  • CREATE2 Magic: All LOP (Limit Order Protocol) contracts are deployed using CREATE2, resulting in deterministic addresses across chains. This eliminates the need for registries, config mappings, or hardcoded addressesβ€”making the developer and integrator experience significantly smoother.

πŸ”„ Order Lifecycle (High-Level)

UNMATCHED β†’ SRC_FILLED β†’ DEST_FILLED β†’ SRC_SETTLED β†’ DST_SETTLED β†’ FULFILLED

Each state is actively monitored and enforced by our system to ensure secure and atomic cross-chain fulfillment.


πŸ“‹ Cross-Chain Order Flow (Detailed)

Step 1: πŸ“ Order Submission

The user submits an Order Intent to the Relayer Service via a /submit API.


Step 2: πŸ—ƒοΈ Order Registration

The Relayer Service saves order details to the database, making them visible to any available Resolver node.


Step 3: πŸ€– Resolution Initiation

The Resolver Service polls for new unmatched orders and begins execution.


Step 4: πŸ” Source Escrow Deployment

The Resolver deploys a Source Escrow Contract. The LOP contract pulls the maker's funds into this escrow.


Step 5: πŸ‘οΈ Source Chain Monitoring

The Watcher Service listens for the SrcEscrowCreated event and updates the order status and immutable parameters (src_chain_immutables) in the database.


Step 6: 🧬 Dest Chain Immutables Construction

Once the source is confirmed, the watcher builds the DestChainImmutables and sets the order status to SRC_FILLED.


Step 7: πŸ“¦ Destination Escrow Deployment

Using the new status and immutables, the Resolver deploys the Dest Escrow Contract on the destination chain.


Step 8: πŸ‘€ Destination Chain Monitoring

The Watcher Service tracks this event and updates:

  • Order status β†’ DEST_FILLED
  • src_withdraw_immutables and dest_chain_immutables

Step 9: πŸ’Έ Source Chain Withdrawal

The Resolver initiates source escrow withdrawal, allowing the Taker to receive funds on the source chain.


Step 10: βœ… Source Settlement Confirmation

Watcher confirms the withdrawal and updates the status to SRC_SETTLED.


Step 11: πŸ’° Destination Withdrawal

The Resolver then finalizes the destination escrow withdrawal, allowing the Maker to receive funds on the dest chain.


Step 12: πŸŽ‰ Fulfillment

The Watcher confirms the final withdrawal and updates the order status to FULFILLED.


🧰 Tech Stack

| Layer | Tech | | --------------- | --------------------------------- | | Smart Contracts | Solidity + Foundry | | Backend | Rust (Relayer, Resolver, Watcher) | | Client Scripts | TypeScript / JavaScript | | Blockchain | Ethereum, Base, Monad (modular) |


✨ Key Features

  • πŸ” Secure Cross-Chain Transactions: Escrow-based system ensures trustless execution
  • πŸ€– Automated Resolution: Resolvers handle order execution end-to-end
  • πŸ‘οΈ Real-Time Monitoring: Watchers listen to on-chain events and sync off-chain state
  • 🧠 Stateful Processing: Fine-grained status tracking for each order
  • 🌐 Multi-Chain Support: Built to support any EVM-compatible chain
  • 🧩 CREATE2 Deployments: Contracts are deployed deterministically, simplifying integration across chains
  • βš™οΈ Modular Microservices: Each backend service can be deployed, scaled, and debugged independently

πŸ“Ž Example Use Case

Alice on Ethereum wants to swap 1 ETH for 1000 USDC from Bob on Base. Our system escrows both sides, verifies chain events, and resolves the trade atomically. Neither party needs to trust the otherβ€”just the system.

How it's Made

⚑ Cross-Chain Order Resolution System

πŸš€ Overview

We built a full-stack cross-chain order resolution system that securely executes trades across multiple blockchains using microservices, event-based workflows, and deterministic smart contracts. This system allows seamless coordination between users on different chains using escrow contracts, automated resolvers, and real-time watchers.

Our architecture ensures atomic, trustless executionβ€”backed by deterministic deployments and a stateful backend that tracks every order from intent to fulfillment.


🧠 Architecture Breakdown

πŸ”© Core Components

  1. πŸ“ Resolver Contract – Smart contract that encapsulates order validation and escrow logic
  2. 🚚 Relayer Service – Exposes APIs for submitting and managing user orders
  3. βš™οΈ Resolver Service – Automatically matches and resolves orders between users across chains
  4. πŸ‘οΈ Watcher Service – Listens to on-chain events and updates the off-chain state accordingly
  5. πŸ§ͺ Client – Integration scripts or minimal frontend to test end-to-end flows

🧬 Deployment Strategy

  • CREATE2 Magic: All LOP (Limit Order Protocol) contracts are deployed using CREATE2, resulting in deterministic addresses across chains. This eliminates the need for registries, config mappings, or hardcoded addressesβ€”making the developer and integrator experience significantly smoother.

πŸ”„ Order Lifecycle (High-Level)

UNMATCHED β†’ SRC_FILLED β†’ DEST_FILLED β†’ SRC_SETTLED β†’ DST_SETTLED β†’ FULFILLED

Each state is actively monitored and enforced by our system to ensure secure and atomic cross-chain fulfillment.


πŸ“‹ Cross-Chain Order Flow (Detailed)

Step 1: πŸ“ Order Submission

The user submits an Order Intent to the Relayer Service via a /submit API.


Step 2: πŸ—ƒοΈ Order Registration

The Relayer Service saves order details to the database, making them visible to any available Resolver node.


Step 3: πŸ€– Resolution Initiation

The Resolver Service polls for new unmatched orders and begins execution.


Step 4: πŸ” Source Escrow Deployment

The Resolver deploys a Source Escrow Contract. The LOP contract pulls the maker's funds into this escrow.


Step 5: πŸ‘οΈ Source Chain Monitoring

The Watcher Service listens for the SrcEscrowCreated event and updates the order status and immutable parameters (src_chain_immutables) in the database.


Step 6: 🧬 Dest Chain Immutables Construction

Once the source is confirmed, the watcher builds the DestChainImmutables and sets the order status to SRC_FILLED.


Step 7: πŸ“¦ Destination Escrow Deployment

Using the new status and immutables, the Resolver deploys the Dest Escrow Contract on the destination chain.


Step 8: πŸ‘€ Destination Chain Monitoring

The Watcher Service tracks this event and updates:

  • Order status β†’ DEST_FILLED
  • src_withdraw_immutables and dest_chain_immutables

Step 9: πŸ’Έ Source Chain Withdrawal

The Resolver initiates source escrow withdrawal, allowing the Taker to receive funds on the source chain.


Step 10: βœ… Source Settlement Confirmation

Watcher confirms the withdrawal and updates the status to SRC_SETTLED.


Step 11: πŸ’° Destination Withdrawal

The Resolver then finalizes the destination escrow withdrawal, allowing the Maker to receive funds on the dest chain.


Step 12: πŸŽ‰ Fulfillment

The Watcher confirms the final withdrawal and updates the order status to FULFILLED.


🧰 Tech Stack

| Layer | Tech | | --------------- | --------------------------------- | | Smart Contracts | Solidity + Foundry | | Backend | Rust (Relayer, Resolver, Watcher) | | Client Scripts | TypeScript / JavaScript | | Blockchain | Ethereum, Base, Monad (modular) |


✨ Key Features

  • πŸ” Secure Cross-Chain Transactions: Escrow-based system ensures trustless execution
  • πŸ€– Automated Resolution: Resolvers handle order execution end-to-end
  • πŸ‘οΈ Real-Time Monitoring: Watchers listen to on-chain events and sync off-chain state
  • 🧠 Stateful Processing: Fine-grained status tracking for each order
  • 🌐 Multi-Chain Support: Built to support any EVM-compatible chain
  • 🧩 CREATE2 Deployments: Contracts are deployed deterministically, simplifying integration across chains
  • βš™οΈ Modular Microservices: Each backend service can be deployed, scaled, and debugged independently

πŸ“Ž Example Use Case

Alice on Ethereum wants to swap 1 ETH for 1000 USDC from Bob on Base. Our system escrows both sides, verifies chain events, and resolves the trade atomically. Neither party needs to trust the otherβ€”just the system.

background image mobile

Join the mailing list

Get the latest news and updates