Skip to main content

Welcome to Lunarys eDEX

Lunarys is the world's first fully encrypted decentralized exchange (eDEX) built with Fully Homomorphic Encryption (FHE) technology. It enables completely private token swaps and liquidity provision where all sensitive data remains encrypted on-chain.

What is Lunarys?

Lunarys is a privacy-first eDEX that maintains complete confidentiality through Fully Homomorphic Encryption (FHE):

  • Confidential AMM: Automated market maker with encrypted reserves
  • Private Swaps: Trade amounts never revealed in plaintext
  • Encrypted Liquidity: LP positions and pool depth completely private
  • FHE Technology: All computations done on encrypted data without decryption

The Privacy Problem in DeFi

Traditional DEXes (Uniswap, SushiSwap, etc.):

  • Public pool reserves - MEV bots exploit this
  • Public trade amounts - Front-running, sandwich attacks
  • Public LP positions - Whale tracking, competitive disadvantage

Lunarys eDEX:

  • Encrypted pool reserves - MEV resistance
  • Encrypted trade amounts - No front-running possible
  • Obfuscated public state - ~3x magnitude uncertainty on reserves
  • Encrypted LP positions - Complete privacy

Key Features

1. Confidential Liquidity Pools (EPOOL)

  • Pool reserves stored as encrypted euint64 values
  • Constant product formula (x * y = k) computed on encrypted data via 4-term Taylor approximation
  • Obfuscated reserves publicly visible with random factor (1M-3M range) for price discovery
  • LP shares tracked as encrypted CERC20 tokens

2. Atomic Private Trading

  • Single-transaction swap execution (no oracle settlement phase)
  • User provides pre-decrypted obfuscated reserves with FHE proof
  • Input and output amounts both encrypted
  • Slippage protection via encrypted minimum output amount
  • Front-running economically impossible due to reserve obfuscation

3. Uniswap V2-Style Fee Model

  • Swap fee deducted from input amount (configurable per pool, e.g. 0.3%)
  • Fees stay implicitly in reserves (no fee accumulator)
  • LPs realize gains when removing liquidity
  • 0.05% withdrawal fee prevents JIT liquidity attacks

4. Decentralized & Trustless

  • No central custodians
  • FHE threshold decryption network
  • Open source smart contracts
  • Mathematically proven FHE security

How It Works

Confidential AMM with Obfuscated Reserves

Lunarys implements the constant product formula on encrypted values, with publicly visible obfuscated reserves for price discovery:

True reserves:       euint64(reserveA), euint64(reserveB)  (encrypted, private)
Obfuscated reserves: reserveA * factor, reserveB * factor (publicly decryptable)

The obfuscation factor (1M-3M range) is the same for both reserves, so the price ratio is preserved while the actual magnitude is hidden with ~3x uncertainty.

Atomic swap process:

  1. User fetches obfuscated reserves from pool and decrypts them via the FHE gateway
  2. User encrypts their swap amount client-side
  3. User calls atomicSwapAForB with encrypted input, obfuscated reserves, and FHE proof
  4. Pool validates proof against current obfuscated state
  5. Pool computes output via 4-term Taylor approximation on encrypted values
  6. Pool checks slippage (encrypted minAmountOut)
  7. If checks pass: transfer output to user. If not: refund input.
  8. Pool rotates obfuscation factor (fresh randomness every operation)

Core Components

EPOOL System

EPOOL Contract (Encrypted Pool)

  • Main AMM logic with encrypted reserves
  • Atomic swap execution (atomicSwapAForB, atomicSwapBForA)
  • Bootstrap and contribute liquidity functions
  • Per-operation obfuscation factor rotation
  • CERC20 LP token (encrypted shares)

EPoolFactory Contract

  • Deploys new EPOOL instances
  • Manages pool registry with deterministic keys
  • Canonical token ordering (lower address = token0)
  • Encrypted obfuscation parameters

UniversalRouter Contract

  • Pool discovery and route validation (NOT execution)
  • Path validation for multi-hop routes
  • Users call pools directly for encrypted operations

Technology Stack

FHE Technology

  • Fully Homomorphic Encryption: Compute on encrypted data without decryption
  • Threshold Decryption Network: Decentralized decryption service
  • EVM Compatible: Standard Solidity smart contracts
  • Provable Security: Mathematically proven encryption

CERC20 / ERC7984 Standard

  • Confidential ERC20 token standard
  • Encrypted balances: euint64
  • All tokens use 6 decimals
  • Operator approvals for DeFi integrations (setOperator)

Getting Started

For Users

  1. Connect Wallet - MetaMask or compatible Web3 wallet on Sepolia testnet
  2. Claim Test Tokens - Use the Airdrop contract to claim 100 tokens of each type (eBTC, eETH, eUSD, LUN, eUSDT, eBNB)
  3. Set Operator - Approve the pool to spend your tokens via setOperator
  4. Trade Privately - Swap tokens with complete confidentiality via atomic swaps

For Developers

  1. Frontend Integration - Complete TypeScript guide with FHE SDK setup
  2. Deployed Addresses - Current contract addresses and pool details

Live Deployment (Sepolia Testnet)

February 2026 Deployment

Complete 6-token deployment with all contracts verified. See Deployed Addresses for full details.

Infrastructure (Ethereum Sepolia)

  • EPoolFactory: 0xa830205E7b5e1b75a6e6EED34207C7FEc7aBEEAE
  • UniversalRouter: 0x6ef96225151e207cA92cF923C4edD0aC3235842c
  • Airdrop: 0x5509c8b9995EfEB21A9B6a25995040fF75b960b9

Active Liquidity Pools (Ethereum Sepolia)

PoolAddressFee
eBTC/eUSD0xf0aB79A82F2D1d5b0230815d26fB0278a237bA3c0.30%
eETH/eUSD0x288ddB6c9912f849cDF49D995e4AcC0f3902186B0.30%
eBNB/eUSD0x00689E12aE9a2020a2EcdE27e84C4A67A0eCce490.30%
LUN/eUSD0xE71c606EeEfe8452357fFA03C4B327480C8D361a0.30%
eUSDT/eUSD0xdE4ea0e51E06AF239a0CF46446a9c3833efAde770.10%
eBTC/eETH0x5E47755F2D86fDb418b6C7f47a808788a11164E60.30%
Network Details

Chain ID: 11155111 (Sepolia) | Explorer: sepolia.etherscan.io