πŸ”„Swaps and Pools

Swaps in SwapBlast are different from trades on traditional platforms. SwapBlast does not use an order book to represent liquidity or determine prices. SwapBlast uses an automated market maker mechanism to provide instant feedback on rates and slippage.

The automated market making algorithm used by SwapBlast revolves around the constant product formula x*y=k, where k is the invariant.

Each pair on SwapBlast is actually underpinned by a liquidity pool. Liquidity pools are smart contracts that hold balances of two unique tokens and enforces rules around depositing and withdrawing them.

When either token is withdrawn (purchased), a proportional amount of the other must be deposited (sold), in order to maintain the constant.

Liquidity provider fees

There is a 0.1% fee for swapping tokens. This fee is split by liquidity providers proportional to their contribution to liquidity reserves.

Swapping fees are immediately deposited into liquidity reserves. This increases the value of liquidity tokens, functioning as a payout to all liquidity providers proportional to their share of the pool. Fees are collected by burning liquidity tokens to remove a proportional share of the underlying reserves.

Since fees are added to liquidity pools, the invariant increases at the end of every trade. Within a single transaction, the invariant represents token0_pool / token1_pool at the end of the previous transaction.

Why pools?

SwapBlast is unique in that it doesn’t use an order book to derive the price of an asset or to match buyers and sellers of tokens. Instead, SwapBlast uses what are called Liquidity Pools.

Liquidity is typically represented by discrete orders placed by individuals onto a centrally operated order book. A participant looking to provide liquidity or make markets must actively manage their orders, continuously updating them in response to the activity of others in the marketplace.

A blockchain-native liquidity protocol should take advantage of the trusted code execution environment, the autonomous and perpetually running virtual machine, and an open, permissionless, and inclusive access model that produces an exponentially growing ecosystem of virtual assets.

Just how end-users can interact with the SwapBlast protocol through the Interface (which in turn interacts with the underlying contracts), developers can interact directly with the smart contracts and integrate SwapBlast functionality into their own applications without relying on intermediaries or needing permission.

Last updated