project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

StellaFi+

Trustless Ethereum–Stellar swaps using HTLCs, escrow factories, and Dutch auction orders.

StellaFi+

Created At

Unite Defi

Project Description

This project implements a Cross-Chain Atomic Swap system between Stellar and Ethereum, using a CrossChain Resolver contract that coordinates with the Limit Order Protocol (LOP) and Hash Time Lock Contract (HTLC) escrow contracts.

It enables two parties on Stellar and Ethereum to trustlessly exchange tokens without intermediaries. The resolver contract:

Creates and manages cross-chain swaps

Uses Dutch auction–based price discovery for fair order matching

Ensures atomic settlement—either both parties receive their tokens or neither does

A backend event listener monitors Stellar events, updates Dutch auction prices, and broadcasts swap details to Ethereum. Users can create, fund, match, and claim swaps directly through a browser-based UI, with every step verifiable on-chain.

How it's Made

This project is built as a cross-chain atomic swap system connecting Ethereum and Stellar using Hashed Timelock Contracts (HTLCs).

  • Smart Contracts

    • Ethereum (Solidity) – EscrowFactory and Resolver contracts manage USDC locking and cross-chain coordination.
    • Stellar (Soroban) – Escrow, EscrowFactory, LOP (Limit Order Protocol), and Dutch Auction contracts handle XLM transfers and order execution.
  • Factories

    • Both Ethereum and Stellar use deterministic factories to deploy escrow and LOP contracts with predictable addresses, making cross-chain coordination easier.
  • Cross-Chain Resolver

    • A Node.js/TypeScript integration layer orchestrates swaps by generating secrets, locking assets, and revealing secrets across chains.
    • The same hashlock is used on both chains to ensure atomicity—either both swaps succeed or both are refunded.
  • Testing & Tooling

    • Foundry for Solidity development and testing on a forked Ethereum network.
    • Stellar CLI for real contract interaction on Soroban testnet.
    • pnpm + Jest for TypeScript-based end-to-end tests simulating real swap scenarios.
  • Hacky but Useful Parts

    • We used deterministic contract deployments to precompute escrow addresses on Stellar and Ethereum, so both sides can prepare before deployment.
    • The tests spin up a local Ethereum fork with Anvil, fund accounts with USDC, and then use shell scripts to interact with real Soroban contracts—so it feels like a real-world swap without needing two full live networks.
  • Partner Tech Benefits

    • Soroban’s CLI + deterministic addresses made it possible to deploy and interact with contracts in a predictable way.
background image mobile

Join the mailing list

Get the latest news and updates