Video thumbnail

SoloPatty

TEE-based private order book DEX, preventing MEV and executing trades privately.

SoloPatty

Created At

ETHGlobal Trifecta - Trusted Execution Environments

Winner of

Marlin - Best use of Marlin TEEs

ETHGlobal - Trifecta TEE Track Finalist

Project Description

SoloPatty – A Private & MEV-Resistant Decentralized Exchange

SoloPatty is a trust-minimized, intent-based DEX that eliminates MEV attacks, frontrunning, and sandwich attacks using Trusted Execution Environments (TEE).

Most DeFi trading platforms suffer from transaction manipulation, where bots exploit pending orders. SoloPatty prevents this by keeping all trade intents private and executing them securely.

Key Features

  • No MEV Bots πŸ›‘οΈ – Private order flow prevents frontrunning and sandwich attacks.
  • Fair Order Execution βš–οΈ – Orders are batch-matched in a secure environment.
  • Lower Gas Fees β›½ – Efficient off-chain balance updates minimize on-chain costs.
  • Scalable & Secure πŸ”’ – Uses cryptographic attestations for verifiable trade execution.

How it's Made

How SoloPatty Is Built

SoloPatty integrates secure computing, encrypted trading, and blockchain smart contracts to create a decentralized trading experience without MEV risks.

Tech Stack

Secure Execution & Order Matching

πŸ”Ή Marlin TEE + NestJS – The backend runs inside a Trusted Execution Environment (TEE) using NestJS, ensuring private and tamper-proof order matching.

Smart Contracts

πŸ”Ή Solidity on Ethereum/Aptos – Smart contracts manage:

  • Token deposits & withdrawals
  • Balance verification
  • Attestation signature verification

πŸ”Ή OpenZeppelin Libraries – Used ERC20, ECDSA, and MessageHashUtils for secure token interactions and cryptographic verification.

Frontend & User Interaction

πŸ”Ή Next.js + Wagmi + Viem + ShadCN + TailwindCSS – A modern frontend stack for fast and seamless Web3 interactions.

How SoloPatty Works

1️⃣ Users deposit tokens β†’ Smart contract locks funds and emits a deposit event.
2️⃣ TEE listens for deposit events and updates the off-chain balance state.
3️⃣ Users submit encrypted trade intents (signed & encrypted with the TEE’s public key).
4️⃣ Every minute, the TEE:

  • Decrypts intents
  • Runs a Coincidence of Wants (CoW) matching algorithm
  • Updates the off-chain balance state

5️⃣ Users withdraw tokens β†’ TEE generates an attestation signature, which the smart contract verifies before executing the transfer.

Preventing MEV & Frontrunning

πŸš€ Encrypted Trade Intents – No mempool exposure; bots cannot see pending orders.
πŸš€ Batch Matching in a TEE – Ensures fair execution without sandwich attacks.
πŸš€ Attested Execution – The TEE provides a cryptographic proof that orders were matched correctly.

Hacky & Cool Innovations

βœ… Merkle Tree for Balance Compression – Efficient off-chain balance management reduces gas fees.
βœ… TEE-Based Order Matching – Ensures privacy & tamper-proof execution without trust assumptions.
βœ… Optimized Smart Contract Design – Reduces unnecessary on-chain transactions, improving scalability.

With SoloPatty, decentralized trading is finally fair, private, and efficientβ€”no more MEV, no more frontrunning. πŸš€

Marlin configurations:

The Job ID 0x0000000000000000000000000000000000000000000000000000000000000baa

IP address: 43.204.7.164

background image mobile

Join the mailing list

Get the latest news and updates