PrivaDex

Privacy-first decentralized exchange on Aleo — fully shielded.

About

## Wave 4 submission

Live Demo: https://priva-dex.vercel.app/

This is our first submission. PrivaDEX is a privacy-first decentralized exchange built entirely on Aleo. Unlike traditional DEXs where every trade is publicly visible, PrivaDEX uses zero-knowledge proofs to keep trade size, price, and wallet identity fully shielded. The protocol consists of 10 Leo smart contracts deployed on Aleo testnet covering three execution venues: a constant-product AMM (6 pool pairs), an epoch-based dark pool, and a shielded limit order book.

What's built and working

Token Swap across 6 pools (ALEO, USDCx, BTCx, ETHx) with blind routing that auto-selects the best venue. All swaps execute as shielded transitions with reserve snapshot verification. Liquidity Pools with add/remove liquidity, real on-chain LP position tracking, and auto-ratio calculation. Dark Pool (ALEO/USDCx) for anonymous epoch-based trading with batch settlement. Order Book (ALEO/USDCx) for private limit orders. Faucet for testnet token minting + bidirectional public/private balance conversion. Wallet Panel showing private vs public balance breakdown per token. Analytics Dashboard with live TVL, spot prices from reserves, and dark pool epoch state. Privacy Shield toggle to hide/reveal sensitive values across the UI.

What's not yet complete

Dark pool and order book only support ALEO/USDCx — other pairs require additional contracts. Atomic multi-hop router is written but cannot deploy due to a snarkOS cross-program simulation bug. No backend indexer — 24h volume relies on client-side reserve delta detection. LP fee distribution is not yet implemented. Only Shield Wallet is supported; no Leo Wallet or other adapters.

## Wave 5 submission

Live demo: https://privadex.vercel.app

This wave addressed both jury recommendations and hardened the protocol from 10 to 16 deployed Leo contracts with full frontend integration.

LP Fee Distribution (Jury Recommendation #1) Built a fee tracking pipeline across contracts and frontend. When a user adds liquidity, the on-chain add_liquidity transition verifies reserve_a_snapshot, reserve_b_snapshot, and total_shares_snapshot against live state in the finalize block before minting LPPosition records. The frontend records the USD deposit value at execution time. On subsequent visits, earned fees are computed as currentPositionValue - totalDeposited using live reserves from fetchPoolReserves(). Displayed per-position in Pool and Portfolio pages. The 0.3% swap fee stays in pool reserves under x*y=k constant-product math, so LP shares appreciate with every trade.

Dark Pool Expansion to 4 Pairs (Jury Recommendation #2) Wrote and deployed 3 new dark pool contracts in Leo 4.0 syntax (fn + inline final {} blocks): privadex_darkpool_btcx_v1 (BTCx/USDCx), privadex_darkpool_ethx_v1 (ETHx/USDCx), privadex_darkpool_btcx_ethx_v1 (BTCx/ETHx). Each contract escrows tokens via token_registry.aleo::transfer_private_to_public, batches orders into 120-block epochs, and settles at AMM mid-price. Added assert_pool_snapshot() public function to all 5 non-ALEO AMM contracts so dark pools can verify oracle prices via cross-program snapshot verification. Frontend blind router now evaluates the dark pool venue for all 4 pairs with a dynamic pair selector UI.

AMM Contract Upgrades (Leo 4.0 Migration) Migrated 5 AMM contracts from Leo 3.5 to Leo 4.0 syntax: async transition → fn, async function → inline final {} blocks, .await() → .run(), Future → Final, token.aleo/Type → token.aleo::Type. Deployed via leo deploy --yes with consensus version V14 compatibility. All 6 AMM pools now include cumulative_volume_a/b, cumulative_fee_a/b, and last_swap_block on-chain mappings for real-time analytics.

Remove Liquidity Wired the Remove button to the removeLiquidity hook calling remove_liquidity(lp_in, reserve_a_snapshot, reserve_b_snapshot, total_shares_snapshot, min_amount_a, min_amount_b) with 2% slippage protection. New modal with percent slider (25/50/75/100%), real-time output preview, and auto-refetch after success.

Production Hardening Stripped console.log/debug/info from production bundle via esbuild pure to prevent leaking record plaintexts and merkle proofs. Removed all mock data fallbacks — UI shows explicit empty states. Network env-configurable (VITE_NETWORK=testnet|mainnet). Build runs full TypeScript typecheck before deploy.

16 deployed programs: 6 AMM pools + 4 dark pools + orderbook + token wrapper + 2 shared infrastructure (token_registry, USDCx stablecoin).

Prizes

  • Wave 4 grant · 900 USDT
  • Wave 5 grant · 2,243 USDT

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

No public repo linked, so we can't tell.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.