Shielded Swaps
Shielded Swaps let you swap tokens through an AMM without revealing your identity. The ShieldedSwapRouter contract wraps Ekubo's AMM using the ILocker interface — Ekubo only sees the router contract as the swapper, never your address.
How It Works
The swap happens in a single atomic transaction through Ekubo's ILocker callback:
Ekubo uses an ILocker interface where the swap executor "locks" the pool, performs operations, and settles deltas. The ShieldedSwapRouter implements this interface, making it the on-chain actor for the swap while your address stays completely hidden.
Privacy Model
| Property | Visible? |
|---|---|
| Your identity | Hidden — router is the on-chain actor |
| Swap amounts | Visible to Ekubo (required for constant-product math) |
| Source of funds | Hidden — withdrawn from privacy pool with ZK proof |
| Destination of funds | Hidden — deposited into privacy pool as new commitment |
Swap amounts are visible to the Ekubo AMM because constant-product math requires plaintext values. However, your identity is completely hidden — the AMM cannot link the swap to your address.
Fee Structure
- Protocol fee: 30bps (0.30%) deducted from the output amount before re-deposit
- Ekubo AMM fee: Standard Ekubo pool fees apply (varies by pool)
- Total cost: Protocol fee + AMM fee
Fees accumulate per output token in the ShieldedSwapRouter contract.
SDK Usage
const result = await obelysk.swap.execute({
tokenIn: 'eth',
tokenOut: 'usdc',
amountIn: '0.5',
slippageBps: 50, // 0.5% slippage tolerance
});
console.log('Received:', result.amountOut, 'USDC');
console.log('Tx:', result.transactionHash);
Contract Details
- Address:
0x05a7f8a6ab74ee6ab41169118ca2ea21070dc6594bae5a39f5bb9ac50629725b - Integration: Ekubo
ILockerinterface - Fee: 30bps (max 500bps = 5%, configurable)
- Upgrade timelock: 48 hours
Next Steps
- Privacy Pools — the Merkle trees powering shielded deposits
- Dark Pool Trading — commit-reveal auctions for zero-MEV trading
- SDK Trading — full SDK reference for swaps, orders, staking