top of page

If the video doesn’t play, please refresh the page.

What is a Liquidity Pool in Crypto?

A liquidity pool in crypto and DeFi is a collection of digital assets locked into a smart contract, designed to facilitate seamless trading, lending, and other decentralized financial activities without the need for traditional intermediaries. These pools are fundamental to the functioning of automated market makers (AMMs) — a type of decentralized exchange protocol — which allows users to trade cryptocurrencies directly against a pool of assets, rather than relying on the traditional order book system used in centralized exchanges.

Liquidity pools work by enabling traders to swap certain coins and tokens back and forth using a predefined algorithm that automatically determines the current pricing based on the relative supply of each asset in the pool. One of the most popular formulas used is the constant product formula, made famous by platforms like Uniswap.

Users, known as liquidity providers (LPs), contribute pairs of assets (e.g., ETH and USDT) into the pool and, in return, earn a portion of the trading fees generated by activity within the pool. Liquidity pools not only improve market efficiency but also offer users opportunities to earn passive income through yield farming or liquidity mining. They play a critical role in powering decentralized exchanges (DEXs) and various other DeFi protocols, enabling decentralized and permissionless finance for all.

📌 Definition:

A liquidity pool is a collection of crypto funds locked in a smart contract. It’s used to enable trading on decentralized exchanges (DEXs), without needing buyers and sellers to match like in traditional exchanges.

Instead of order books (used in centralized exchanges), liquidity pools use automated algorithms to swap tokens instantly.



💱 Why Are Liquidity Pools Important?

They are the backbone of DeFi (Decentralized Finance). Without them, DEXs like Uniswap, SushiSwap, or Raydium couldn’t operate.



🛠️ How Do Liquidity Pools Work?
1. Users (Liquidity Providers or LPs) deposit a pair of tokens (e.g., ETH + USDC) into a pool.
2. These tokens are then used by traders to swap between those assets.
3. In return, LPs earn fees every time someone trades using the pool.
4. Smart contracts automatically handle everything — no middleman needed.



👥 Who Are Liquidity Providers (LPs)?

They are users who deposit tokens into the pool and receive LP tokens in return. These represent their share of the pool and let them earn passive income.



📊 Example: ETH/USDC Liquidity Pool on Uniswap
• You add 1 ETH + 3,000 USDC into the pool.
• Traders swap ETH ⇄ USDC.
• Every time they trade, a small 0.3% fee is taken and split among LPs.
• You can withdraw your share (plus earnings) at any time.

bottom of page
/** * Wix Custom Code — paste into Settings → Custom Code → Body end (All pages) * on https://www.idxsolana.io/ * * Requires a hidden Wix Subscribe form on the site (same page or any page * loaded by the docs iframe bridge). Pair with docs.idxsolana.io footer. */ (function () { var ALLOWED = [ "https://docs.idxsolana.io", "http://localhost:3000", "http://localhost:3010", ]; function isAllowedOrigin(origin) { if (!origin) return false; if (ALLOWED.indexOf(origin) !== -1) return true; if (/^https:\/\/docs\.idxsolana\.io$/.test(origin)) return true; if (/^http:\/\/localhost:\d+$/.test(origin)) return true; if (origin === window.location.origin) return true; return false; } function reply(event, payload) { if (!event.source) return; try { event.source.postMessage(payload, event.origin || "*"); } catch (e) {} } function findSubscribeForm() { var candidates = document.querySelectorAll("form"); for (var i = 0; i < candidates.length; i++) { var form = candidates[i]; if (form.querySelector('input[type="email"]')) return form; } return null; } function findSubmitControl(form) { return ( form.querySelector('[data-hook="submit-button"]') || form.querySelector('button[type="submit"]') || form.querySelector('input[type="submit"]') || form.querySelector("button") ); } function watchSubmitResult(form, event) { var root = form.closest('[data-hook="form-root"]') || form.parentElement || document.body; var settled = false; function finish(ok, message) { if (settled) return; settled = true; observer.disconnect(); clearTimeout(timer); reply(event, ok ? { type: "idx-footer-newsletter-ok" } : { type: "idx-footer-newsletter-error", message: message || "Could not subscribe. Try again." }); } var observer = new MutationObserver(function () { var success = root.querySelector('[data-hook="success-message"], [data-testid="successMessage"]'); if (success) finish(true); var error = root.querySelector('[data-hook="error-message"], [data-testid="errorMessage"]'); if (error && error.textContent && error.textContent.trim()) { finish(false, error.textContent.trim()); } }); observer.observe(root, { childList: true, subtree: true, characterData: true }); var timer = setTimeout(function () { finish(true); }, 4000); } function submitEmail(email, event) { var form = findSubscribeForm(); if (!form) { reply(event, { type: "idx-footer-newsletter-error", message: "Subscribe form not found. Add a hidden Wix Subscribe form to this site.", }); return; } var input = form.querySelector('input[type="email"]'); if (!input) { reply(event, { type: "idx-footer-newsletter-error", message: "Email field not found." }); return; } var submit = findSubmitControl(form); if (!submit) { reply(event, { type: "idx-footer-newsletter-error", message: "Submit button not found." }); return; } input.focus(); input.value = email; input.dispatchEvent(new Event("input", { bubbles: true })); input.dispatchEvent(new Event("change", { bubbles: true })); watchSubmitResult(form, event); try { if (typeof form.requestSubmit === "function") { form.requestSubmit(submit); } else { submit.click(); } } catch (e) { reply(event, { type: "idx-footer-newsletter-error", message: "Could not submit form." }); } } window.addEventListener("message", function (event) { if (!isAllowedOrigin(event.origin)) return; var data = event.data; if (!data || data.type !== "idx-footer-newsletter") return; var email = String(data.email || "").trim(); if (!email) { reply(event, { type: "idx-footer-newsletter-error", message: "Email is required." }); return; } submitEmail(email, event); }); })(); /** * Wix Velo — paste into Backend → http-functions.js on https://www.idxsolana.io/ * Publish the site after saving. * * Endpoint: POST https://www.idxsolana.io/_functions/newsletter_subscribe * * Only enable browser fetch after this is deployed AND working: * NEXT_PUBLIC_WIX_NEWSLETTER_USE_HTTP=true * * Until then, docs uses postMessage bridge (wix-footer-form-bridge.js) — no CORS. */ import { ok, badRequest, response } from "wix-http-functions"; import { contacts } from "wix-crm-backend"; const ALLOWED_ORIGINS = [ "https://docs.idxsolana.io", "http://localhost:3000", "http://localhost:3010", ]; function resolveOrigin(origin) { if (!origin) return null; if (ALLOWED_ORIGINS.indexOf(origin) !== -1) return origin; if (/^http:\/\/localhost:\d+$/.test(origin)) return origin; return null; } function corsHeaders(origin) { const headers = { "Access-Control-Allow-Methods": "POST, OPTIONS", "Access-Control-Allow-Headers": "Content-Type", "Content-Type": "application/json", }; if (origin) { headers["Access-Control-Allow-Origin"] = origin; } return headers; } export function options_newsletter_subscribe(request) { const origin = resolveOrigin(request.headers.origin); return response({ status: 204, headers: corsHeaders(origin), }); } export function post_newsletter_subscribe(request) { const origin = resolveOrigin(request.headers.origin); const headers = corsHeaders(origin); if (!origin) { return response({ status: 403, headers: { "Content-Type": "application/json" }, body: { error: "Forbidden" }, }); } return request.body .text() .then(function (text) { var body = {}; try { body = JSON.parse(text || "{}"); } catch (e) { return badRequest({ body: { error: "Invalid JSON body." }, headers: headers }); } var email = String(body.email || "").trim(); if (!email) { return badRequest({ body: { error: "Email is required." }, headers: headers }); } return contacts .findOrCreateLabel("Subscriber") .then(function (label) { return contacts.appendOrCreateContact({ emails: [{ email: email, tag: "MAIN", primary: true }], labelKeys: [label.key], }); }) .then(function () { return ok({ body: { success: true }, headers: headers }); }); }) .catch(function (error) { return badRequest({ body: { error: error.message || "Could not subscribe." }, headers: headers, }); }); } /** * Wix Custom Code — paste into Settings → Custom Code → Body end (All pages) * on https://www.idxsolana.io/ * * Requires a hidden Wix Subscribe form on the site (same page or any page * loaded by the docs iframe bridge). Pair with docs.idxsolana.io footer. */ (function () { var ALLOWED = [ "https://docs.idxsolana.io", "http://localhost:3000", "http://localhost:3010", ]; function isAllowedOrigin(origin) { if (!origin) return false; if (ALLOWED.indexOf(origin) !== -1) return true; if (/^https:\/\/docs\.idxsolana\.io$/.test(origin)) return true; if (/^https:\/\/[a-z0-9-]+\.idxsolana\.io$/.test(origin)) return true; if (/^http:\/\/localhost:\d+$/.test(origin)) return true; if (origin === window.location.origin) return true; return false; } function reply(event, payload) { if (!event.source) return; try { event.source.postMessage(payload, event.origin || "*"); } catch (e) {} } function findSubscribeForm() { var candidates = document.querySelectorAll("form"); for (var i = 0; i < candidates.length; i++) { var form = candidates[i]; if (form.querySelector('input[type="email"]')) return form; } return null; } function findSubmitControl(form) { return ( form.querySelector('[data-hook="submit-button"]') || form.querySelector('button[type="submit"]') || form.querySelector('input[type="submit"]') || form.querySelector("button") ); } function watchSubmitResult(form, event) { var root = form.closest('[data-hook="form-root"]') || form.parentElement || document.body; var settled = false; function finish(ok, message) { if (settled) return; settled = true; observer.disconnect(); clearTimeout(timer); reply(event, ok ? { type: "idx-footer-newsletter-ok" } : { type: "idx-footer-newsletter-error", message: message || "Could not subscribe. Try again." }); } var observer = new MutationObserver(function () { var success = root.querySelector('[data-hook="success-message"], [data-testid="successMessage"]'); if (success) finish(true); var error = root.querySelector('[data-hook="error-message"], [data-testid="errorMessage"]'); if (error && error.textContent && error.textContent.trim()) { finish(false, error.textContent.trim()); } }); observer.observe(root, { childList: true, subtree: true, characterData: true }); var timer = setTimeout(function () { finish(true); }, 4000); } function submitEmail(email, event) { var form = findSubscribeForm(); if (!form) { reply(event, { type: "idx-footer-newsletter-error", message: "Subscribe form not found. Add a hidden Wix Subscribe form to this site.", }); return; } var input = form.querySelector('input[type="email"]'); if (!input) { reply(event, { type: "idx-footer-newsletter-error", message: "Email field not found." }); return; } var submit = findSubmitControl(form); if (!submit) { reply(event, { type: "idx-footer-newsletter-error", message: "Submit button not found." }); return; } input.focus(); input.value = email; input.dispatchEvent(new Event("input", { bubbles: true })); input.dispatchEvent(new Event("change", { bubbles: true })); watchSubmitResult(form, event); try { if (typeof form.requestSubmit === "function") { form.requestSubmit(submit); } else { submit.click(); } } catch (e) { reply(event, { type: "idx-footer-newsletter-error", message: "Could not submit form." }); } } window.addEventListener("message", function (event) { if (!isAllowedOrigin(event.origin)) return; var data = event.data; if (!data || data.type !== "idx-footer-newsletter") return; var email = String(data.email || "").trim(); if (!email) { reply(event, { type: "idx-footer-newsletter-error", message: "Email is required." }); return; } submitEmail(email, event); }); })();