Fugazi is the first fully on-chain dark pool built on Fhenix.
Fugazi is AMM-based dark pool. It leverages following three arms to hide order info (size and direction):
Unlike many other implementations of dark pool, Fugazi does not require any oracle or centralized operators and every action related to trading (pool creation, LPing, swap) is completely permissionless.
Except that users have to wait for a while after each submisson of order (due to the batching and heavy computational load), the UX Fugazi offers is almost as same as that of AMMs like Uniswap, Curve, Balancer, etc etc.
For the contract side:
To hide the order info, just slapping encryption is not enough, since attacker can notice the trader's intent by sandwiching it. So common practice is batching trades. Another way of hiding order information is proposed last year; that is, protocol-owned account submits randomized orders along the trader's order together so that the attacker can only know about the aggregated order (trader + random). The protocol takes an additional fee (separate from the swap fee) for providing privacy.
We decided to implement both of them. The final output is AMM-based dex, like uniswap, curve, and balancer, while each order is batched together with randomized order submitted by protocol-owned account. As we mentioned, now everything (user balance, pool reserves, order info, etc etc) is encrypted via fully homomorphic encryption. We believe it is still okay to encrypt pool reserves and hide the information about spot price: arbitrageurs will anyway get (maybe noisy) info about pool price and will set the price close to EBBO (Ethereum Best Bid & Offer).
Moreover, our exchange does not rely on any single centralized external players or resources, resulting in supporting permissionless pool creation.
For the frontend side we used following: