What is an Automated Market Maker (AMM)? A beginner’s guide

Article image

This article is contributed by TONCO DEX, the first concentrated liquidity DEX on TON Blockchain, built by Algebra Labs. The views expressed are those of the contributor and do not necessarily represent the opinions or endorsements of TON. This content is for informational purposes only and should not be considered financial or investment advice.

Imagine walking into a store where there’s no cashier, no fixed prices, and no checkout line. Instead, prices shift in real time depending on demand. More buyers? Prices climb. Less activity? They drop. That’s exactly how Automated Market Makers (AMMs) work. No centralized order books, no middlemen—just liquidity pools and smart contracts handling everything, ensuring smooth, trustless transactions.

In this guide, we will dive into how AMMs work, their key benefits, and potential risks. We’ll also explore how AMMs have evolved from v2 models, used by DEXs like STON.fi and DeDust, to v3 models, such as TONCO DEX, which introduced concentrated liquidity.

Whether you’re just getting started with decentralized finance (DeFi) or looking to deepen your knowledge, we’ll walk you through the fundamentals and help you understand how to participate in decentralized trading on TON Blockchain.

What is an Automated Market Maker (AMM)?

Automated Market Makers are decentralized trading protocols that use smart contracts to set token prices and facilitate trades. Instead of matching buyers and sellers, AMMs use liquidity pools where users deposit tokens. These pools ensure that trades can always be executed, with prices determined by predefined mathematical formulas.

Key features of AMMs

  • No order book needed: AMMs eliminate the need for buyers and sellers to be online at the same time. Trades happen instantly using liquidity pools.
  • Algorithmic pricing: Token prices in AMMs change dynamically based on supply and demand within the liquidity pool.
  • Anyone can provide liquidity: Users (liquidity providers or LPs) can add tokens to a pool and earn a share of the trading fees in return.

By removing centralized intermediaries and making trading permissionless, AMMs offer a more open and efficient way to swap digital assets.

How do AMMs work?

AMMs rely on liquidity pools, which are smart contracts that hold two tokens. Each pool acts as a market for a specific trading pair—for example, TON/USDT. When a trader swaps tokens, the pool automatically adjusts prices using a mathematical formula.

How liquidity pools work

  • Providing liquidity: Anyone can contribute funds to a liquidity pool and become an LP. This helps maintain liquidity for other users to trade.
  • Setting initial prices: The first LP in a new pool determines the initial price of the tokens. If this price is significantly different from the global market rate, arbitrage traders may quickly correct it, potentially leading to impermanent loss.

LP tokens: your key to rewards

When you deposit tokens into a liquidity pool, you receive LP tokens, which represent your share of the pool. These tokens allow you to earn trading fees from every swap in the pool.

Decentralized exchanges (DEXs) share a portion of trading fees with LPs, providing a steady passive income stream. On TONCO DEX, for example, 90% of fees go directly to liquidity providers.

When you’re ready to withdraw, you simply burn your LP tokens using the DEX interface to reclaim your share of the pool—along with any accumulated rewards.

What is APR?

Annual Percentage Rate (APR) refers to the potential yearly returns LPs can earn from depositing their tokens into a liquidity pool. It factors in trading fees and any additional platform incentives. Higher trading volume often leads to higher APR, making some pools more attractive than others.

By combining liquidity pools, LP tokens, and trading fees, AMMs create a decentralized trading system that operates without intermediaries and provides earning opportunities for users.

AMMs on TON: v2 vs. v3 models

TON Blockchain has integrated AMMs as a fundamental part of its DeFi ecosystem. There are two main types of AMMs in use today:

v2 AMMs: traditional liquidity distribution

v2 AMMs, such as STON.fi and DeDust.io, rely on constant product market maker algorithms. These DEXs ensure that the total value of the two tokens in a liquidity pool remains constant (split 50/50), regardless of trade size.

  • Consistent liquidity availability: v2 AMMs ensure there’s always liquidity available, even for large trades.
  • Capital inefficiency: Liquidity is evenly distributed across all price ranges, meaning a significant portion of it may remain unused, reducing its efficiency.

v3 AMMs: concentrated liquidity

The next stage in AMM evolution introduces concentrated liquidity, a model designed to improve capital efficiency by allowing LPs to allocate liquidity within specific price ranges rather than distributing it evenly.

TONCO DEX is pioneering v3 AMMs on TON.

  • Focused liquidity: LPs choose specific price ranges where they want to provide liquidity, rather than spreading it across the entire price spectrum.
  • Higher earning potential: Because liquidity is concentrated around active trading ranges, LPs earn higher fees on their positions.
  • More active management required: LPs must monitor their positions more closely, as liquidity stops earning fees if the price moves outside their chosen range.

By offering both v2 and v3 AMM models, TON Blockchain gives users the flexibility to choose the model that best suits their needs.

Risks of AMMs: understanding impermanent loss

While AMMs provide significant earning opportunities, they also come with risks. The biggest challenge LPs face is impermanent loss, which occurs when the price ratio of two assets in a liquidity pool changes.

Impermanent loss refers to the reduction in the value of your liquidity pool assets compared to simply holding them outside the pool. To be clear, it’s not about losing money outright but about earning less than you would have if you’d just held the tokens.

If one token’s price rises while the other stays the same (or drops), the LP loses value compared to just holding the tokens. The greater the price difference, the higher the impermanent loss.

For example, let’s say you provided liquidity to a TON/USDT pool when TON is $5. If TON later rises to $10, arbitrage traders will rebalance the pool, leaving you with less TON than you initially deposited. Even though the pool still holds value, you would have made more money by simply holding TON.

How to manage impermanent loss

  • Monitor market trends: Keep an eye on price movements and adjust your liquidity positions if needed.
  • Choose the right pool: Pools with assets that move together (like stTON/TON pair) minimize impermanent loss.
  • Utilize concentrated liquidity: v3 AMM models help LPs focus their liquidity on active price ranges, reducing losses.

The final word

AMMs have transformed the way crypto trading works by making it permissionless, efficient, and accessible to anyone. Whether you’re using a v2 AMM like STON.fi and DeDust.io or taking advantage of v3 concentrated liquidity on TONCO, AMMs offer a variety of opportunities to trade, earn fees, and contribute to the DeFi ecosystem.