← Back to home

Garden-1-Inch

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

Problem Statement

⚡ Cross-Chain Order Resolution System🚀 OverviewWe built a full-stackcross-chain order resolution systemthat 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📝 Resolver Contract– Smart contract that encapsulates order validation and escrow logic🚚 Relayer Service– Exposes APIs for submitting and managing user orders⚙️ Resolver Service– Automatically matches and resolves orders between users across chains👁️ Watcher Service– Listens to on-chain events and updates the off-chain state accordingly🧪 Client– Integration scripts or minimal frontend to test end-to-end flows🧬 Deployment StrategyCREATE2 Magic: All LOP (Limit Order Protocol) contracts are deployed usingCREATE2, resulting indeterministic 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 → FULFILLEDEach 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 SubmissionThe user submits anOrder Intentto theRelayer Servicevia a/submitAPI.Step 2: 🗃️ Order RegistrationTheRelayer Servicesaves order details to the database, making them visible to any availableResolvernode.Step 3: 🤖 Resolution InitiationTheResolver Servicepolls for new unmatched orders and begins execution.Step 4: 🔐 Source Escrow DeploymentTheResolverdeploys aSource Escrow Contract. The LOP contract pulls themaker's fundsinto this escrow.Step 5: 👁️ Source Chain MonitoringTheWatcher Servicelistens for theSrcEscrowCreatedevent and updates the order status and immutable parameters (src_chain_immutables) in the database.Step 6: 🧬 Dest Chain Immutables ConstructionOnce the source is confirmed, the watcher builds theDestChainImmutablesand sets the order status toSRC_FILLED.Step 7: 📦 Destination Escrow DeploymentUsing the new status and immutables, theResolverdeploys theDest Escrow Contracton the destination chain.Step 8: 👀 Destination Chain MonitoringTheWatcher Servicetracks this event and updates:Order status →DEST_FILLEDsrc_withdraw_immutablesanddest_chain_immutablesStep 9: 💸 Source Chain WithdrawalTheResolverinitiatessource escrow withdrawal, allowing theTakerto receive funds on thesource chain.Step 10: ✅ Source Settlement ConfirmationWatcher confirms the withdrawal and updates the status toSRC_SETTLED.Step 11: 💰 Destination WithdrawalTheResolverthen finalizes thedestination escrow withdrawal, allowing theMakerto receive funds on thedest chain.Step 12: 🎉 FulfillmentTheWatcherconfirms the final withdrawal and updates the order status toFULFILLED.🧰 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 CaseAlice 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.

Solution

⚡ Cross-Chain Order Resolution System🚀 OverviewWe built a full-stackcross-chain order resolution systemthat 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📝 Resolver Contract– Smart contract that encapsulates order validation and escrow logic🚚 Relayer Service– Exposes APIs for submitting and managing user orders⚙️ Resolver Service– Automatically matches and resolves orders between users across chains👁️ Watcher Service– Listens to on-chain events and updates the off-chain state accordingly🧪 Client– Integration scripts or minimal frontend to test end-to-end flows🧬 Deployment StrategyCREATE2 Magic: All LOP (Limit Order Protocol) contracts are deployed usingCREATE2, resulting indeterministic 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 → FULFILLEDEach 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 SubmissionThe user submits anOrder Intentto theRelayer Servicevia a/submitAPI.Step 2: 🗃️ Order RegistrationTheRelayer Servicesaves order details to the database, making them visible to any availableResolvernode.Step 3: 🤖 Resolution InitiationTheResolver Servicepolls for new unmatched orders and begins execution.Step 4: 🔐 Source Escrow DeploymentTheResolverdeploys aSource Escrow Contract. The LOP contract pulls themaker's fundsinto this escrow.Step 5: 👁️ Source Chain MonitoringTheWatcher Servicelistens for theSrcEscrowCreatedevent and updates the order status and immutable parameters (src_chain_immutables) in the database.Step 6: 🧬 Dest Chain Immutables ConstructionOnce the source is confirmed, the watcher builds theDestChainImmutablesand sets the order status toSRC_FILLED.Step 7: 📦 Destination Escrow DeploymentUsing the new status and immutables, theResolverdeploys theDest Escrow Contracton the destination chain.Step 8: 👀 Destination Chain MonitoringTheWatcher Servicetracks this event and updates:Order status →DEST_FILLEDsrc_withdraw_immutablesanddest_chain_immutablesStep 9: 💸 Source Chain WithdrawalTheResolverinitiatessource escrow withdrawal, allowing theTakerto receive funds on thesource chain.Step 10: ✅ Source Settlement ConfirmationWatcher confirms the withdrawal and updates the status toSRC_SETTLED.Step 11: 💰 Destination WithdrawalTheResolverthen finalizes thedestination escrow withdrawal, allowing theMakerto receive funds on thedest chain.Step 12: 🎉 FulfillmentTheWatcherconfirms the final withdrawal and updates the order status toFULFILLED.🧰 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 CaseAlice 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.

Hackathon

ETHGlobal Unite

2025

Contributors