Overview

SecretSwap is an automated market maker (AMM) liquidity protocol. There is no order book, no centralized party, and no central facilitator of trade. Built by Secret Contracts, SecretSwap transactions inputs are encrypted - protecting users from front-running attacks and providing an increased level of privacy compared to traditional AMMs.

Each pool within SecretSwap is defined by a secret contract that includes a few functions to enable swapping tokens, adding liquidity and more. At its core each pool uses the function x*y=k to maintain a curve along which trades can happen.

The pools keep track of reserves (liquidity) and updates those reserves every single time someone trades. Because the reserves are automatically rebalanced, a SecretSwap pool can always be used to buy or sell a token without requiring a counter-party on the other side of your trade.

  • Note: Given the requirement to publicly update pool reserves to determine the price, an observer can see a consolidated view of changes (swaps, provide / remove liquidity) in a given block. As a result, if there’s a single transaction with the pool in a given block, it is not possible to have privacy on that transaction. With more transactions per pool in a given block, SecretSwap provides additional privacy to users.

For a more in depth description, check out how SecretSwap works in this blog post outlining the theory behind an AMM using secret contracts.

In order to use SecretSwap, you will need the Keplr Wallet installed on your browser and at a minimum, some SCRT to begin swapping.