For the complete documentation index, see llms.txt. This page is also available as Markdown.

What is a liquidity pool and how does it work

What a liquidity pool is, how DEX pricing works, what LP tokens and fees are, the main risks, and how liquidity pools relate to My Wallet.

A liquidity pool is a pair of tokens locked in a smart contract that a decentralized exchange (DEX) uses for trades. Instead of matching buyers with sellers, the DEX lets you swap directly against the tokens in the pool.

💧 How Does a Liquidity Pool Work?

Each pool holds two tokens, for example GRAM and USDT. When you swap, you add one token to the pool and take the other one out. The smart contract handles the trade, with no middleman holding the funds.

⚖️ How Is the Price Set?

Most pools use an automated market maker (AMM): a formula that sets the price based on how much of each token is in the pool.

  • When people buy a token from the pool, there is less of it left, so its price goes up.

  • When people sell a token into the pool, there is more of it, so its price goes down.

The bigger the pool, the less a single trade moves the price. This price shift is called slippage.

🙋 Who Are Liquidity Providers?

The tokens in a pool come from users called liquidity providers (LPs). An LP deposits both tokens of the pair into the pool, usually in equal value, and lets traders use them.

🧾 What Are LP Tokens?

In return for a deposit, the pool issues LP tokens. They work like a receipt: they show your share of the pool. When you withdraw, you return the LP tokens and get back your share of both tokens, which may be in different amounts than you deposited.

💸 Where Do the Fees Come From?

Every swap in the pool pays a small trading fee. The fees are added to the pool and shared among liquidity providers in proportion to their share. How much a provider earns depends on trading volume and on how many other providers share the pool, so earnings change over time.

⚠️ What Are the Risks?

  • Impermanent loss If the price of one token changes a lot against the other, the pool rebalances. When you withdraw, your share can be worth less than if you had simply held both tokens in your wallet.

  • Smart-contract risk A bug or vulnerability in the pool's contract can lead to a loss of funds.

  • Scam pools and rug pulls Anyone can create a pool. Scammers launch a token, add a little liquidity, and then pull it out or block selling. Learn how to spot this in Honeypot Tokens.

💙 Liquidity Pools in My Wallet

  • LP token tracking My Wallet shows the value of your LP tokens alongside your other assets. Learn more in Check Balances and Actions History.

  • Swaps When you swap in My Wallet, the swap aggregator compares rates across DEXes and picks a route, so your trade uses the liquidity of their pools. See Swap Aggregator and Smart Routes.

  • Dapps You can connect DEXes and other dapps to your wallet. Any deposit into a pool happens inside that dapp, under its own rules. See How to connect a dapp?

❓ FAQ

Can I lose money in a liquidity pool? Yes. Impermanent loss, price swings, contract bugs, and scam pools can all reduce the value of your deposit.

Why did I get back different amounts than I deposited? The pool rebalances as people trade, so your share contains different amounts of each token over time.

Does My Wallet control the pools? No. Pools are run by smart contracts of independent DEXes.


Last updated