The first generation of exchanges includes centralized exchanges like Binance and Coinbase. The second generation of exchanges comprises of decentralized exchanges (DEX) like Bancor, Kyber, and Uniswap. pDEX is an upgraded DEX. Like decentralized exchanges, it is trustless. It also implements additional features such as privacy via zero-knowledge proofs, high throughput via sharding, and inter-blockchain trading via interoperable bridges.
The Automated Market Making mechanism of pDEX is somewhat different from typical exchanges. This post offers a high-level overview of the mechanism and argues for its major advantages. pDEX borrows heavily from Nick Johnson’s reddit post in 2016, Vitalik Buterin’s reddit post in 2016, Hayden Adam’s Uniswap implementation in 2018.
pDEX does not use an order book. Instead, it implements an Automated Market Making algorithm that enables instant matches, no matter how large the order or how small the liquidity pool is.
Trading on pDEX
The traditional order book is replaced by a bonding curve mechanism known as constant product. On a typical exchange such as Coinbase or Binance, market makers supply liquidity at various price points. pDEX takes everyone’s bids and asks, and pools them into two giant buckets. Market makers no longer specify prices at which they are willing to buy or sell; pDEX automatically creates markets based on an Automated Market Making algorithm.
Here is a simple example of how trading plays out on pDEX. Let’s say there is 100,000 DAI and 10 BTC currently in the pDAI/pBTC pool. The goal is to keep this product equal to 1,000,000 at any trading volume.
DAI pool : 100,000
BTC pool : 10
Constant : 10 * 100,000 = 1,000,000
A buyer sends 10,000 DAI to buy BTC. A fee (in this example, 0.1% or 10 DAI) is taken out for liquidity providers, and the remaining 9,990 is added to the DAI pool. The constant product is divided by the new amount of DAI in the liquidity pool to determine the new BTC pool. The buyer receives the remaining BTC.
Buyer sends : 10,000 DAI
DAI pool : 100,000 + 10,000 = 110,000
BTC pool : 1,000,000 / 110,000 = 9.090909
Buyer gets : 10 – 9.090909 = 0.90909 BTC
The price has now shifted. A buyer who makes a trade in the same direction will get a slightly worse BTC/DAI rate. A buyer who makes a trade in the opposite direction will get a slightly better DAI/BTC rate.
Becoming a liquidity provider
Liquidity providers play an essential role. As the name suggests, they provide liquidity to various pools on pDEX and earn rewards. More info here.
pDEX leverages Incognito’s bridges to other blockchains like Ethereum and Bitcoin to enable inter-blockchain trading. So you can trade BTC and ERC20 tokens on pDEX – with complete privacy.
When the pDEX launched at the end of 2019, the Incognito <> Ethereum Bridge was the only trustless bridge on the Mainnet. With the recent launch of Portal, other bridges are now migrating to a trustless implementation.
|Ethereum <> Incognito||Trustless|
|Bitcoin <> Incognito||Trustless|
|Binance <> Incognito||Trustless|
|Polkadot <> Incognito||(TBD)|
|Cosmos <> Incognito||(TBD)|
All transfers are private by default on the Incognito network. The user can freely trade without disclosing their identity. Read how Incognito achieves privacy.
pDEX leverages Incognito’s sharded architecture to deliver high throughput. The workload is shared among shards and trades are processed in parallel. Incognito’s throughput scales linearly by adding more shards, so it can grow to support large transaction volumes. Read about privacy at scale.
One of the benefits of Automated Market Making is instant matching . If you enter an order, it will match right away. The current block time of Incognito is 40s.
Once the block is produced on a shard, it is sent to the beacon chain, which takes another 40s. A trade will complete within 80s. Incognito plans to reduce the block time to 10s, once transaction size is further optimized.
Along with trustlessness, pDEX combines several advanced technologies like zero-knowledge proofs for privacy, sharding for high throughput, and interoperable bridges for inter-blockchain trading. We hope that pDEX will be a helpful product for the crypto community.