0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

What Is an Automated Market Maker in Crypto Trading: Pool Pricing

0
Posted at

An automated market maker (AMM) is a smart-contract system that quotes trades using tokens held in a liquidity pool. The pool’s deposited assets supply what a swap exchanges, so a trade can happen without a seller placing a matching order at that moment.

An order book matches buyers’ and sellers’ submitted orders; an AMM calculates a swap against the pool’s available tokens. That distinction is useful when comparing an order-book exchange with a pool-based exchange such as SyncSwap: syncswap review is relevant to the latter, where trades use pooled liquidity instead of waiting for a matching seller.

On syncswap.co, SyncSwap is described as a decentralized exchange for trading tokens and accessing liquidity pools on supported networks. The AMM is the pricing mechanism a trader encounters when a swap is quoted against one of those pools.

How Pool Pricing Works

A constant-product AMM uses the relationship x × y = k to keep the product of the two token reserves roughly constant through a swap. Here, x and y are the amounts of each token in the pool, and k is their product. The pool’s reserve ratio helps set the price: with 10 ETH and 20,000 USDC, the starting ratio is 2,000 USDC per ETH.

Take a trader who adds 1 ETH to that pool and receives USDC, ignoring fees and rounding. The ETH reserve rises from 10 to 11. To keep the product at 200,000, the USDC reserve after the swap is about 200,000 ÷ 11, or 18,181.82 USDC. The trader therefore receives about 20,000 − 200,000/11 = 1,818.18 USDC.

The marginal pool price and the average price paid across this trade are different. Before the swap, the reserve ratio implies a marginal price of 2,000 USDC per ETH; after it, the ratio is about 1,652.89. The trader’s average execution price is about 1,818.18 USDC per ETH, based on the 1 ETH traded. A displayed marginal price describes the next small trade at that point; the average describes the whole swap. Confusing them can make a quote look better than the amount the trader actually receives.

Each swap changes the reserves, so the next quote changes too. SyncSwap’s Classic Pool illustrates reserve-based swap calculations: its contract source uses the pool’s reserves to calculate swaps. A larger trade relative to pool depth moves the reserve ratio further, changing the price more across that trade.

A pool price can also drift from prices on other markets. Arbitrage traders may buy the cheaper asset from the pool or sell the more expensive one into it, shifting its reserves toward external prices. That activity helps align prices, while the changing reserves affect the amounts available to later traders.

A liquidity provider deposits tokens into a pool and earns a share of trading fees, while taking on smart-contract risk and the possibility of underperforming a simple hold of those tokens. When market prices move, the AMM’s trades can leave the provider with a different token mix than they deposited. The pool’s fee income may offset some of that difference, but the outcome depends on trading and price movements.

Related Questions

What is arbitrage in an AMM?

Arbitrage in an AMM is trading against a pool when its price differs from an external market price. Those trades change the pool’s reserves and move its price toward the market price.

What are LP tokens?

LP tokens are tokens that represent a claim on assets in a tokenized liquidity position. They record a provider’s share of pooled assets; the AMM itself is the pricing mechanism that calculates swaps against those assets.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?