What Is an Automated Market Maker?

This page explains the inner workings of an Automated Market Maker (AMM).

brc20-swap implements the functionality of an automated market maker (AMM). This is the underlying technology that powers most decentralized exchanges (DEXs). You don’t need to have a counterparty (another trader) on the other side to make a trade. Instead, you interact with a liquidity pool by exchanging for a price calculated by a math formula.

brc20-swap specifically implements the x * y = k formula, where x is the amount of one token in the liquidity pool, and y is the amount of the other. In this formula, k is a fixed constant, meaning the pool’s total liquidity always has to remain the same.

Slippage


Slippage occurs when the actual price you get for a trade is different from the expected or quoted price. It often happens in situations of high market volatility or low liquidity. If you want to buy or sell an asset at a specific price, but the market conditions change before your trade is executed, you might end up with a slightly different price than you anticipated. Slippage can result in a higher or lower cost for your trade than you initially planned.

Impermanent loss


Impermanent loss is a term used in liquidity provision. When you provide liquidity to a pool by depositing two different assets, the value of your assets can change over time due to price fluctuations. Impermanent loss occurs when the value of your assets in the pool is less than if you had simply held those assets without providing liquidity. It's "impermanent" because the loss can decrease or disappear as the prices of the assets change.

Price impact


Price impact refers to the effect a large trade has on the price of an asset in a market. When someone buys or sells a significant amount of an asset, it can cause the price to move in the direction of the trade due to the imbalance in supply and demand. The larger the trade relative to the overall liquidity in the market, the greater the price impact. Price impact can lead to higher or lower prices depending on whether it's a buy or sell order.

Service fee


Each swap incurs a 0.3% transaction fee, of which 1/6 goes to the platform as fees, and the remaining portion is received by LPs.

LP fees are accrued inside the pool. They don't need to be claimed.

LP tokens represent your share of assets in the pool. As fees accumulate in the pool, the amount of brc-20 assets backing your LP tokens will grow automatically. Just keep in mind, impermanent loss can affect your profitability.

Rollup fee


brc20-swap is able to reduce bitcoin network fees significantly. The brc20-swap sequencer bundles transactions and submits them to the Bitcoin network. brc20-swap charges a fee in SATS (brc-20) to cover Bitcoin network fees.

Last updated