← Back to home

Near-FusionSwap

Cross-chain atomic swaps between Polygon & NEAR using HTLC contarcts and 1inch Fusion+ protocol

Problem Statement

Near-FusionSwap Seamless Cross-Chain Swaps Between NEAR Protocol and PolygonProject Identity Near-FusionSwap represents the fusion of two blockchain ecosystems - NEAR Protocol's developer-friendly infrastructure with Polygon's EVM compatibility. The name emphasizes:"Near": Primary integration with NEAR Protocol blockchain"Fusion": The seamless merging of different blockchain networks"Swap": Core token exchange functionalityUsing 1inch fusion+ and htlc contarcts we have enabled the cross chain swap between EVM and NEAR ecosystem

Solution

Architecture Overview Near-FusionSwap is a sophisticated cross-chain DEX that bridges NEAR Protocol and Polygon networks using a novel Hash Time-Locked Contract (HTLC) approach combined with 1inch's Fusion+ protocol. Here's the technical breakdown:Core Technologies & IntegrationRust for Near HTLC contractsNext.js 14 with App Router for SSR/SSGWagmi v2 + RainbowKit for multi-wallet supportEthers.js v6 for blockchain interactionsTypeScript for type safety across the entire stackReal-time Price Feeds: Built a custom useTokenPrices hook that fetches from 1inch API with caching and error handling Cross-Chain Detection: Implemented intelligent swap type detection that automatically switches UI modesBackend Orchestration (NestJS)NestJS framework for scalable TypeScript backendModular service architecture (PolygonService, NearService, OrderService)RESTful APIs for cross-chain coordinationService Separation: Each blockchain has its dedicated service layer for clean separation of concerns Order Management: Custom DTO (Data Transfer Objects) for type-safe API communication

Hackathon

ETHGlobal Unite

2025

Prizes

  • 🏆

    Extend Fusion+ to Near3rd place

    1inch

Contributors