Coincidence of Needs

Tx Swap, because of its use of Batch Auctions, is optimized for finding Coincidence of Needs amongst the trades within a batch, as well as ring trades. But what exactly are the Coincidence of Needs and ring trades?

Coincidence of Needs can be explained as an "economic phenomenon where two parties each hold an item the other wants, and therefore exchange these items directly. This means that on Tx Swap, when two trades or more, each hold an asset that the other wants, their orders can be settled directly between all of them without the need for an external market maker or liquidity provider. Tx Swapcan create Txs in a two-dimensional orderbook, but can also create them in a multi-dimensional orderbook.

One of the advantages of using batch auctions is that not only can you find perfect Coincidence of Wants matching, but you can also create ring trades. Essentially, a ring trade shares liquidity across all orders, rather than a single token pair. This functionality allows the protocol to offer traders better prices as they do not need to wait to have the perfect match between trades since they can dissect the trades into pieces to improve their outcome. Ring trades are one of the solutions to work around the fragmented liquidity.

Once we know the theory behind Coincidence of Needs, and Ring trades, let's deep dive in an example for both of them to understand them deeper.

In this batch auction, Tx Swap found a Coincidence of Wants, from multiple users' orders. In this Tx Swap, what we can see is that 12 swaps were mixed to share liquidity amongst all of them. This allowed the protocol to settle a portion of the trade size internally, via TXs, while only needing to tap into two different on-chain AMMs to cover for the rest of the liquidity within the batch.

Ring trades are a form of Coincidence of Wants that not only maximize the liquidity on a two-dimensional orderbook but also maximize on a multidimensional level, meaning that the Coincidence of needs can be found in a minimum of three different tokens. Because of this, the protocol can match different trading token pairs in the same batch auction, to avoid having to interact with multiple AMM pools. One important aspect of understanding the slight difference between TXs and ring trades is that every ring trade is a TX, but not every TX is a ring trade. An example of a ring trade would be the following

Eli wants to trade his ETH for DAI. He sends his ETH to Edith, who gives her USDT to Lily who gives her TX to Chow, and finally, Chow gives his DAI to Eli. In this way, Eli’s trade is filled by going through a three-party Coincidence of Wants ring trade. This logic holds for the other three participants as well:

  1. Edith gets her ETH from Eli, even though she has no DAI (the asset he wants) to give him in return

  2. Lily trades TX for USDT using Chow, Eli, and Edit as proxies

  3. Chow does the same thing for his DAI to TX trade

Overall, by leveraging Batch Auctions which are tailored to the Coincidence of needs, Tx swap can give better prices for trades because batching transactions results in a lower spread, as well as much more optimized transaction management for the user.

Last updated