- dex
- Decentralized Finance
tanX: a ZK-rollup DEX on Starknet with cross-chain swaps
Built a decentralized exchange on Starknet — ZK-rollup batching that settles trades on Ethereum, cross-chain swaps, and gas paid in the token you trade.
- Blockchain Engineering
- Smart Contracts
- ZK-Proof Systems
At a glance
- Sector
- Decentralized Finance
- Type
- dex
- Services
- Blockchain Engineering · Smart Contracts · ZK-Proof Systems
The problem
What it had to solve
Retail traders were being priced out of DeFi: on Ethereum Layer-1, the gas for a small swap could cost more than the trade itself. Existing DEXs added a second problem — slow block times meant a price could move against the trader between submitting a swap and having it execute. tanX needed settlement in seconds at a fraction of the cost, without asking anyone to give up custody of their funds.
Liquidity in DeFi is scattered across chains, so a new exchange starts empty unless it can reach the assets already sitting elsewhere. For tanX to work as a trading hub it needed more than local speed on Starknet — it needed a bridge that could pull liquidity from Ethereum, Arbitrum and Polygon into one order flow.
What we built
How it works
We built the exchange on Cairo smart contracts running on Starknet. Trades are batched into a single ZK-STARK validity proof (Zero-Knowledge Scalable Transparent Argument of Knowledge) settled on Ethereum Mainnet, so the security rests on Ethereum while the execution, and its cost, moves to Layer-2.
Cost on Starknet tracks the number of computational steps a transaction takes, so we rewrote the AMM (Automated Market Maker) logic specifically for the Cairo VM to cut the steps each swap needs — which is what brings the price down for the trader. Cross-chain swap APIs sit on top, so a user can move an asset in from another chain in a single flow.
Calls we would still defend
Recursive Proof Aggregation — Implemented recursive ZK-proving to further lower the cost of L1 settlement per transaction as volume scales.
Account Abstraction (native to Starknet) — Enabled 'Paymaster' features where users can pay gas fees in the token they are swapping (e.g., USDT) rather than requiring ETH.
Custom Oracle Integration — Built a low-latency price feed connector to prevent front-running and MEV (Maximal Extractable Value) exploitation.
Built with
Starknet / Cairo
The core Layer-2 engine: its validity proofs let execution move off Ethereum while the settlement guarantees stay on it.
Solidity
Required for the L1 settlement contracts and liquidity bridges connecting to Ethereum Mainnet.
ZK-Proofs (STARKs)
Selected for post-quantum security and the ability to scale without requiring a 'trusted setup' phase.
Ethers.js / Starknet.js
The libraries wiring the frontend to both chains — wallet connections and reading on-chain state as the user trades.
Where it landed
What the build changed
ZK-STARK
Settlement
trades batched into one validity proof settled on Ethereum
Any
Gas token
account-abstraction Paymaster lets fees be paid in the token being swapped
3 chains
Cross-chain
assets pulled from Ethereum, Arbitrum and Polygon into one swap flow
FAQ
The questions this build raises
What was actually built, the constraints it had to meet, and how it holds up in use.
tanX uses ZK-Rollups to bundle thousands of trades into a single proof. The cost of verifying that proof on the Ethereum Mainnet is shared across all those thousands of trades, bringing the individual cost down to pennies.
Yes. Unlike 'sidechains,' ZK-Rollups use mathematical validity proofs. This means that even if the Starknet sequencer goes offline, your funds are mathematically guaranteed by the Ethereum Layer-1 settlement layer.
Yes. Through the integrated cross-chain liquidity APIs, tanX supports swaps between major EVM-compatible chains and the Starknet ecosystem in a single transaction flow, so you are not bridging in a separate step first.

