Skip to content

Commit 776692a

Browse files
committed
feat: add initial documentation for SwapMateDEX including vision, core features, and tech stack
1 parent 8961558 commit 776692a

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

SwapMateDEX.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# 📜 SwapMateDEX — A Privacy-First DEX Powered by Zama FHE
2+
3+
> 💡 *Trade freely. Stay privately.*
4+
5+
SwapMateDEX is a next-generation **decentralized exchange (DEX)** built on Ethereum-compatible chains, integrating **Fully Homomorphic Encryption (FHE)** from [Zama Protocol](https://zama.ai) to enable private trading, liquidity provision, and yield farming — without sacrificing DeFi composability or security.
6+
7+
---
8+
9+
## 🎯 Vision
10+
11+
Empower users to participate in DeFi while keeping sensitive financial data — such as balances, rewards, and positions — **encrypted at rest and in use**. Only the user (or authorized systems) can decrypt their data, preserving transparency where needed and privacy where desired.
12+
13+
---
14+
15+
## 🧩 Core Features
16+
17+
### 🔄 AMM Swap Engine
18+
- Constant Product AMM (`x * y = k`)
19+
- Supports **ERC20 ↔ ERC20** and **ERC20 ↔ Native** (ETH, MATIC, etc.) via `address(0)`
20+
- Dual-fee model:
21+
- `0.3%` → LP providers
22+
- `0.1%` → Protocol treasury (configurable)
23+
- Slippage protection (`minAmountOut`, `deadline`)
24+
- Price impact estimator for UIs
25+
26+
### 🏊‍♂️ Liquidity Pools
27+
- Create or join pools for any token pair
28+
- LP tokens minted proportionally to deposit size
29+
- Withdraw anytime with proportional asset return
30+
- Built-in minimal ERC20 LP token (transferable, approvable)
31+
32+
### 🏭 LP Farming & Staking
33+
- Stake LP tokens to earn **$KANARI** rewards
34+
- Linear reward accrual based on time and stake size
35+
- Admin-controlled reward funding with duration
36+
- Encrypted reward tracking via FHE (`euint64`)
37+
38+
### 🏗️ Automated Pool Factory
39+
- Permissionless pool creation via `createPool(tokenA, tokenB)`
40+
- Auto-deploys and configures AMM contracts
41+
- Tracks all pools + bidirectional lookup
42+
- Encrypted pool metadata for private analytics or governance flags
43+
44+
### 🔐 Zama FHE Integration
45+
- **Encrypted Balances**: Store token balances as `euint64` — decryptable only by owner/user.
46+
- **Encrypted Stakes & Rewards**: Farming positions and earnings remain private.
47+
- **Encrypted Pool Metadata**: Attach private analytics, scores, or flags to pools.
48+
- All encrypted values are set via owner/minter with cryptographic proof.
49+
50+
> ⚠️ *Encrypted values cannot be used in on-chain conditionals — unless using Zama’s FHE precompiles for ciphertext arithmetic.*
51+
52+
---
53+
54+
## 🌐 Benefits
55+
56+
-**Privacy by Default** — Sensitive data never exposed in plaintext on-chain.
57+
-**Security Audited Design** — Uses OpenZeppelin, ReentrancyGuard, SafeERC20.
58+
-**Institutional Friendly** — Hide capital allocation while remaining trustless.
59+
-**Future-Proof** — Ready for encrypted governance, cross-chain farming, ZK+FHE hybrids.
60+
61+
---
62+
63+
## 📈 Use Cases
64+
65+
| User Profile | Use Case |
66+
|--------------|----------|
67+
| Retail Trader | Swap tokens without revealing wallet size or strategy |
68+
| Yield Farmer | Stake LP tokens and earn rewards — privately |
69+
| Institutional LP | Provide deep liquidity without exposing position |
70+
| DAO / Analytics | Aggregate encrypted metrics for system health without exposing individual data |
71+
72+
---
73+
74+
## 🛠️ Tech Stack
75+
76+
- **Solidity**: `^0.8.30`
77+
- **Libraries**:
78+
- OpenZeppelin Contracts
79+
- Zama FHE Lib (`FHE.sol`, `SepoliaConfig.sol`)
80+
- **Testnet**: Ethereum Sepolia (FHE-enabled)
81+
- **Frontend**: React + ethers.js + [Zama Client SDK](https://github.com/zama-ai/fhevm-client-sdk-js)
82+
83+
---
84+

0 commit comments

Comments
 (0)