---
description: >-
  SundaeSwap is the first decentralised exchange (DEX) built on the Cardano
  blockchain. SundaeSwap cryptocurrency exchange is a decentralized exchange
---

# SundaeSwap

<img src="https://640771207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxNJEhBAc3Fd4pc9mjnPZ%2Fuploads%2FsjqhFd9YoeXt65v2oEBl%2Ffile.excalidraw.svg?alt=media&#x26;token=bfbfe24d-9106-4b49-951b-c032180fd782" alt="" class="gitbook-drawing">

SundaeSwap is the first decentralised exchange (DEX) built on the Cardano blockchain. If you are familiar with UniSwap or other DEXs then it is quite similar. If not, I recommend taking a few minutes to read my other article [here](https://medium.com/@gavin.stein1/blockchains-decentralisation-of-financial-services-decentralised-exchanges-3c6f2bb81c11). That article will discuss DEXs in general; why they exist and how they work. In this article, I will discuss SundaeSwap’s implementation and how it is planning to distribute its token; $SUNDAE.

> \
> Implementation
>
> SundaeSwap aims to be the UniSwap of the Cardano Network¹ and will implement the same constant product pool AMM algorithm²: _x \* y = k_
>
> \
>

While the end product and user experience will be very similar, the implementation of this new DEX is quite different. This is because of Cardano’s different accounting model. Unlike Ethereum’s accounting model, Cardano uses eUTXO; an extended implementation of the “unspent transaction output” model from Bitcoin’s network. In this model, custody of assets on the blockchain are tracked as unspent outputs of transactions. These unspent outputs are consumed as inputs into new transactions, which produce more unspent outputs³.

Because of Cardano’s accounting model, implementation of the constant product pool model involves a few modifications from UniSwap’s Ethereum implementation. SundaeSwap has four types of tokens:

**$SUNDAE Token**

* This is the governance token for the protocol.

**Global Pool Factory Token**

* A unique token that will allow the creation of the Asset Pair LP Token and liquidity pools.

**Asset Pair LP Tokens**

* These tokens are locked in a script with the liquidity for that pool.

**Tracking Tokens**

* These tokens are given to liquidity providers to track the portion of the liquidity pool they are entitled to.

Within the protocol, there are four types of transactions that can be executed:

1. Create a liquidity pool
2. Swap tokens
3. Deposit liquidity
4. Withdraw liquidity

I will now briefly discuss each of these transactions and how they are implemented in the eUTXO model.

### Create liquidity pool <a href="#id-5ef0" id="id-5ef0"></a>

This transaction takes four inputs:

1. SundaeSwap factory token
2. Partner Oracle for initial price
3. Asset A
4. Asset B

And has four outputs:

1. SundaeSwap factory token
2. Partner Oracle for initial price
3. Asset A, Asset B, Pair token
4. One tracking token

\
\
