confswap

Confidential AMM reference implementation using FHE (fully homomorphic encryption) on Zama fhEVM. Encrypted reserves & swap inputs, plaintext baseline for gas/latency comparison. TypeScript + Hardhat + React.

16
26
69% credibility
Found May 22, 2026 at 16 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

ConfSwap is an educational demonstration project that shows how confidential (encrypted) trading works on blockchain. It includes two types of automated trading pools: one where all amounts are kept secret using encryption, and another where everything is public. The project provides a dashboard that compares how much faster and cheaper regular trading is compared to private trading. It's designed to help people understand the tradeoffs of privacy-preserving technology in decentralized finance, but it's explicitly marked as a research prototype, not a production-ready product.

How It Works

1
🔍 You hear about private trading

You've heard about blockchain projects that keep trading amounts secret, and you want to see how it actually works.

2
📚 You explore the project

You find ConfSwap, an educational project that shows both private encrypted swaps and regular public swaps side by side.

3
⚙️ You set up the project

You install the tools and run a simple command to get everything ready on your computer.

4
🔐 You run a private swap demo

You watch as a swap happens with hidden amounts - the numbers are encrypted so nobody can see them, but the trade still executes correctly.

5
You compare the two approaches
🔒
Encrypted path

Private swaps where amounts stay hidden, but require more computational effort

👁️
Regular path

Public swaps where everyone can see the amounts, but it's faster and cheaper

6
📈 You see the benchmark results

The dashboard shows you a table comparing gas costs and wait times between the two approaches across different scenarios.

You understand the tradeoffs

You now see why private trading is more expensive computationally, and you learned about the current limitations of encrypted smart contracts.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 16 to 16 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is confswap-fhe-amm?

ConfSwap is a confidential automated market maker built on Zama's fhEVM. It runs AMM swaps where pool reserves and swap amounts stay encrypted on-chain, letting users trade without revealing their positions. The project ships two contracts: one handling encrypted state with FHE operations, and a plaintext version using the same formula for fair gas and latency comparison. You get a TypeScript stack with Hardhat for contracts, React/Vite for the frontend dashboard, and scripts to run local demos and benchmark FHE versus plaintext performance.

Why is it gaining traction?

The FHE approach to on-chain privacy is still emerging, and ConfSwap gives developers a concrete reference instead of abstract docs. The benchmark UI is the hook: run `npm run benchmark` and see gas ratios across multiple swap scenarios in a table. The project openly documents the FHEVM API constraint around plaintext divisors rather than hiding it, which builds credibility for an educational codebase. Bidirectional swaps, fee-adjusted math, and slippage guards make it feel like a real AMM, not a toy.

Who should use this?

Smart contract developers evaluating FHE for DeFi privacy should start here to understand gas costs and API limits. Protocol teams exploring confidential trading can use the plaintext baseline to set realistic performance expectations. Researchers and students learning fhEVM will find the security model writeup and divisor verification pattern more useful than reading Zama docs alone.

Verdict

This is a solid educational reference with honest limitations, but the 16 stars and 0.7% credibility score reflect its maturity. Use it to learn and prototype, not to ship production contracts. The benchmark tooling alone justifies cloning it if you're seriously considering FHE for an AMM design.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.