AMM Deep Dive and Timeswap

Viggaz
Timeswap Chronicles
8 min readFeb 27, 2022

In the crypto industry lately, AMM (Automated Market Makers) has laid the foundation for strong development step of DEX. In this article, we will take a deep look at how AMMs work on decentralized exchanges (DEX) through well-known AMM models. In addition, let’s learn about the advantages of new AMM model on Timeswap.

Background

The problem of tokens, coins today is that only 10% of them are traded regularly (Top Tokens), 90% of trading volume is concentrated on them. So what happens to the other tokens?

In economics, this is known as the “long tail” theory. If you look at this chart, you will see that the red columns are always traded regularly with a very large volume, this represents the top tokens, they are always listed on huge centralized exchanges (CEX). Therefore, there is always a large trading volume and abundant liquidity.

As for the black columns, although the trading volume is low, they are A LOT. People still want to use it and have a need to exchange, buy and sell, can see them as essential but cheap things, few people use.

So, it’s not too important for big exchanges like Binance and Coinbase to list on. And especially, listing on those exchanges is too expensive for each project itself.

This leads to the creation of DEX, allowing people to exchange these low-cap tokens.

The idea of ​​​​ DEX is to let everything work automatically, buyers and sellers connect themselves and automatically trade at available prices, without placing buy orders, sell orders, and agreements like on centralized exchange (CEX). Therefore, people call that mechanism as Automated Market Makers (AMM).

DEX’s Liquidity

So what is the meaning of holding tokens for the long-term?

As mentioned above, long-tail tokens are less popular but there are still people who want to trade it, how to liquidate them?

AMM creates a “Pool” full of tokens users need, when they need to buy or sell tokens, just go to that pool to exchange. The special thing is that this pool works by itself and anyone can contribute their assets to the “pool”, they are called “liquidity providers”.

DEX’s Advantages

Moreover, we cannot mention the advantages that make DEX a future alternative to cryptocurrency.

First of all, DEXs give users better control and holdings of assets than CEXs where the user leaves the holdings of assets in the hands of the exchange. At that time, you are essentially just being provided by the exchange access and use that asset to buy and sell transactions through your account. On the other hand, the exchange can lock that access any time they want and you will lose all your assets.

When using the DEX exchange, you completely own the ownership of your assets. All transactions will be done peer-to-peer through smart contracts.

Secondly, user’s anonymity is guaranteed on DEX. When you make transactions, the exchange only knows the number of wallets, but will not know who you are. However, for CEX, they will require users to KYC (verify identity) when making large withdrawals from the exchange. As a result, the user’s identity will be exposed.

One thing that all users are especially concerned about is security. In the crypto market, many CEXs have been hacked, causing serious consequences. Although always carefully secured, large centralized exchanges are always a good prey for hackers to attack and appropriate assets from the exchange.

For DEX, it is almost impossible for hackers to attack and take over user assets. Because assets reside on the blockchain and are secured by the nodes in the network.

Understanding

AMM stands for Automated Market Maker and usually works on decentralized exchanges (DEXs), where everything works automatically without human intervention. Decentralized AMMs are usually based on mathematical formulas to value a token.

Like other normal exchanges, AMM has many different trading pairs but there is no buy or sell orders, and traders don’t need to look for buyers. Instead, a smart contract will act as an executor in a transaction.

Liquidity pool is one of the foundational technology behind operation of AMM. The relative proportion of each token in the pool is what determines the theoretical price of a particular asset. One of exchanges that brought AMM to the top is Uniswap with hidden gems x10; x100. However, Kyber Network (2018) and Bancor (2017) were the first to adopt AMM.

The development of AMMs

Kyber Network (KNC)

Kyber Network (KNC) is a centralized AMM model, so only the team and market makers have control over the pool, no one can contribute to the pool.

Therefore, KNC token is an integral part of Kyber Network, KNC token can be considered as the glue that connects the participants in the Kyber Network ecosystem.

It is used to join Kyber Reserves (those who create liquidity for the network), in which, 3rd parties (reserve KNC token) must have KNC to pay their operating fees on the network. In other words, Kyber Network is paid with KNC tokens from the reserves (Kyber Reserves). This 3rd party (reserve KNC token) can be: Token Holders, Token Team, Decentralized Funds, Market Makers.

KNC token can be used to pay commissions to the parties to expand the network and pay transaction fees in the network. These create an incentive for 3rd parties to participate in expanding Kyber Network and help reduce token inflation.

Uniswap (UNI)

In November 2019, Uniswap officially used the decentralized AMM mechanism (decentralized), allowing anyone to contribute to the pool to increase liquidity. After that, pool contributors (providers) are also entitled to a portion of the transaction fee when a transaction on Uniswap is made.

Some of the main features on Uniswap include:

  • Swap: Users can swap ERC-20 token for another. Uniswap take advantages of AMM to provide instant feedback on rates and slippage
  • Liquidity pool: A liquidity pool consists of 2 assets in a trading pair. The relative proportion of each token in the pool is what determines the theoretical price of a particular asset. When users provide liquidity to the pool, they will get back the Liquidity Token (LT), equivalent to the amount of liquidity they have provided to the pool and represent their contribution to the pool by receiving back transaction fee.

Balancer (BAL)

If on Uniswap, you can only put ETH with 1 other token into 1 pool, then the Balancer has a significant improvement: Allows users to add up to 8 different tokens to make swapping more convenient. In addition, in Balancer, providers can customize the rate of tokens put into the pool in 1 transfer.

For example:

  • On Uniswap, if you want to get TIME but just have USDT, you have to swap 2 times: 1st time swap USDT to ETH, 2nd time swap ETH to TIME, so the total fee will be doubled, this will not happen in Balancer.
  • And when you want to contribute to liquidity pool, in Uniswap, you have to prepare tokens and ETH at a ratio of 1:1 to contribute, in Balancer, any ratio of tokens is fine.

Curve Finance (CRV)

The Liquidity Pool in Curve only allows stable coin contributions, which reduces slippage in transactions. Although it is a DEX, Curve Finance is not permissionless (no permission required) like Uniswap. This means users are not free to create liquidity pools like Uniswap, Curve liquidity pools are only created if the proposal on Governance receives everyone’s support.

New generation AMM — Timeswap

As Defi grows and becomes more popular, old generation of AMMs reveal weaknesses that need to be overcome. Most of them are attacks on protocol oracle. Therefore, the birth of new generation AMM model — Timeswap with better performance is essential to help users reduce relating risks.

In their own words,

“Timeswap is the world’s first fully decentralized AMM-based money market protocol which is self-sufficient, non-custodial, gas efficient and works without the need of oracles or liquidators. Timeswap’s proprietary 3 variable AMM is motivated by the constant product AMM used by Uniswap. It provides flexibility to the end-user by allowing the user to decide their risk profile and accordingly set the interest rates & collateral for each lending or borrowing transaction. It is brutally minimalistic, gas-efficient, and permission-less allowing anybody to create a money market for any ERC-20 tokens.”

Ok, let’s find out…

“…works without the need of oracles or liquidators”

This means, Timeswap is an independent protocol, works without the support of intermediaries. This makes the protocol more proactive in protecting and managing user assets.

To adapt, Timeswap deployed a “proprietary 3 variable AMM is motivated by the constant product AMM used by Uniswap” with existing formula:

With the operation of the above formula, when users (lenders and borrowers) interact with pools, they will change the variables such that the constant product is always maintained. Therefore, the TVL in Interest & Collateral will be decreased if users lend more assets into the asset pool, whereas, it will be increased if users borrow more assets from the asset pool.

“…permission-less allowing anybody to create a money market for any ERC-20 tokens”

This helps to solve problems related to long-tail assets, as they also contribute its significance to Defi market growth and satisfy the needs of many users.

Personal review

When asked about the new AMM model of the protocol, Timeswap team revealed that they had conducted market research and discovered their model to be one of the pioneers in the field. Currently, there are not many similar model ownership and development protocol on the market.

Therefore, Timeswap team plays an important role in spreading and educating community. And in response to this, Timeswap team takes this seriously. Every week, the team will organize community activities in various forms (AMA, quizzes, games) and have well-deserved rewards for attenders.

In addition, team also organizes contests for the community regularly (writing, gamified testnet contests) to increase the vibrant atmosphere in the community.

The mainnet is expected to launch in Q1 2022 and with a careful preparation, Timeswap shows its readiness for the next steps.

In conclusion, as a wise man said,

“$TIME never lets anything go unrewarded and $TIME is Money”

Really looking forward to a bright future ahead.

Disclaimer: This article is for informational purposes only and should not be considered investment advice.

--

--