هذه الصفحة هي لأغراض إعلامية فقط. قد لا تتوفر بعض الخدمات والميزات في منطقتك.

What is DeFi?

Decentralized finance (DeFi) is a class of application that provides financial functions such as asset swapping and lending mainly through blockchains and smart contracts. A smart contract is a program deployed on a blockchain that handles operations according to preset code. Users usually send transactions from their own wallet, and contracts check the conditions and update onchain records, instead of handing every step to the internal database of a single service provider.

DeFi is not one particular project, blockchain or product, and it does not mean "no part of it has an administrator". A DeFi application may let contracts manage funds while still depending on a development team, administrator keys, a web page, a price data service or a specific blockchain. To judge how it works, you have to look separately at who users hand assets to, what rules a contract applies, where external data comes from, and who can upgrade or pause the system.

DeFi writes financial rules into callable programs

Traditional online financial services also use software, but account records, business rules and final execution are usually controlled by the service provider. DeFi instead places some rules and asset records on a blockchain, letting users, wallets and other applications call the same set of smart contracts through public interfaces.

A DeFi service usually includes:

  • a blockchain network: keeps transactions and contract state, with nodes verifying updates under shared rules;
  • digital assets: tokens transferred, swapped, deposited or used as collateral within the network;
  • smart contracts: check transaction conditions, compute amounts and update balances or debt;
  • a wallet: lets users review a request and sign with their own account;
  • an application interface: presents contract functions as web or mobile operations;
  • offchain data and services: may supply prices, search, trade routing or notifications.

What users see is one application page, but the actual result is produced by these components together. Ethereum.org's DeFi overview likewise separates blockchain, assets, protocols and application interfaces into distinct layers. That layering approach can equally be used to examine other networks supporting smart contracts, rather than confining DeFi to Ethereum.

What stages a DeFi operation goes through

A user first reads pool balances, quotes, borrowing rates or their own position through the application interface — that is, the state of a particular borrowing along with its collateral, debt and so on. This information may come from blockchain nodes, or may pass through an offchain indexing service; such a service organizes onchain data into results that are easier to query. A value displayed on a web page is therefore not necessarily the value a next transaction will finally use.

When the user initiates a swap, deposit or borrowing, the interface generates a transaction request. The wallet shows the user the target network, the contract being called, asset amounts, approvals and an estimated network fee. After the user signs, the transaction is sent to the blockchain network; nodes execute the contract and check balances, approvals, collateral requirements and other rules.

A transaction changes contract state only after it executes successfully onchain. Submitting a request does not mean it will certainly succeed, and the estimated result shown by an interface may also differ because of price changes during the waiting period, changes in the amount of assets available to trade or lend out — that is, liquidity — or changes in network state. A contract executing successfully only shows that the operation complied with the code and onchain conditions at the time; it cannot prove that the user understood the risks or that the web page information was not misleading.

An asset swap depends on how much is in the pool

In a swap context, liquidity takes the concrete form of the amount of assets available for swapping in a pool. Asset swaps in DeFi can use onchain orders, and can also use an automated market maker. An automated market maker (AMM) is a class of mechanism that produces a swap result using a smart contract and a calculation rule. Rather than waiting for some designated counterparty to take the other side, a user interacts with a pool managed by a contract.

A pool consists of one or several assets. Participants supplying assets are usually called liquidity providers; a swapper takes one asset out and puts another in, and the contract determines how much can be received based on pool balances, a calculation formula and fees.

A trade changes the ratio of assets in the pool, so the estimated price and the final execution result may differ. The larger a trade is relative to available liquidity, the more noticeably the execution price usually departs from the pre-operation quote; this difference is commonly called price impact. After submission, a transaction may also encounter other transactions executing first, and the final result is affected by ordering within the block.

A pool does not have only one calculation approach. The Uniswap v2 technical description shows one implementation maintaining an onchain pool with two token reserves and a calculation formula; other DeFi protocols can equally adopt different formulas, order books or hybrid designs.

Lending connects supplying funds, collateral and liquidation

DeFi lending often gathers assets supplied by several users into a pool and then allows other users to borrow under the rules. After a supplier hands assets to a contract, they usually receive an onchain record representing their deposited share or redeemable claim; part of the borrowing interest may be distributed to suppliers under the protocol's rules.

Many DeFi borrowings do not rely on traditional credit assessment, and instead require the borrower to lock collateral first. Collateral is an asset the borrower places under a contract's constraint, used to repay the borrowing when the debt can no longer meet requirements. A common arrangement requires collateral worth more than the borrowed asset, but the specific ratio, acceptable assets and valuation method vary by protocol.

A contract compares debt against collateral value. If the collateral price falls, the debt asset's price rises, or accruing interest pushes a position past a specified threshold, the position may enter liquidation. Liquidation means other participants repay part or all of the debt under the protocol's rules and obtain the corresponding collateral; the process serves to reduce debt the protocol cannot recover, but a borrower may lose collateral and pay liquidation fees.

Lending parameters are not uniform. Aave's lending documentation provides one implementation case of pools, over-collateralization, rates that change with the utilization of funds, and liquidation, but you cannot infer from it that all DeFi lending uses the same parameters, nor that the return on supplied assets is fixed or that principal will not be impaired.

Rates and fees come from specific rules

A DeFi page often displays a supply rate, a borrowing rate, a swap fee and a network fee at the same time; they are not the same concept.

  • the borrowing rate is the cost a borrower incurs for using funds, and may change with a pool's utilization;
  • the supply return may come from interest paid by borrowers, trading fees or additional token distribution;
  • protocol fees are charged under contract rules from swaps, lending or other operations;
  • network fees are paid to the network participants that process blockchain transactions, and are not necessarily determined by the DeFi protocol.

An annualized figure shown on a page is usually converted from current conditions or those of a past period, and is not a guaranteed result. Utilization of funds, fee distribution, token prices, governance parameters and extra rewards can all change. Even when a token amount increases, the value measured in another asset or in fiat currency may fall.

An onchain contract uses an oracle when it needs an external price

A blockchain can check transactions written onchain, but it does not automatically know asset prices in offchain markets. When a collateral ratio, liquidation condition or derivative settlement has to be computed from a price, a protocol usually reads data supplied by an oracle.

An oracle is a system that collects information outside a blockchain and then publishes data in a way contracts can read. It can aggregate prices from several markets and data providers, and can also adopt other update rules. The Chainlink Data Feeds documentation shows a class of service publishing data such as asset prices and interest rates to multiple blockchains.

Using an oracle does not make data inherently correct. Whether source markets are reliable, whether updates are timely, how outliers are handled and what fallback rules apply during a network outage all affect the protocols that depend on it. An incorrect or stale price may trigger inappropriate borrowing, swap or liquidation results.

DeFi protocols can be composed with one another

Smart contracts deployed on the same network, or in environments able to communicate with one another, can call other contracts within one or several transactions. For example, an application can first obtain an asset through some swap protocol and then deposit that asset into a lending protocol; an aggregating interface can also compare several trade paths and then request the corresponding contracts to execute.

This ability to combine is often called composability. It lets developers reuse existing functions instead of building every service layer from scratch. But dependencies also pass along the call relationship: when an underlying asset, an oracle, a cross-chain bridge or another protocol fails, a strategy above it may be affected too.

In the common case where a contract does not catch a failed call and carry on executing, the state updates of one transaction are written together when the top-level transaction succeeds, or undone together on revert. But this only handles the execution result of that transaction; it does not remove the risks of price changes across blocks, governance modifications, external data errors or several protocols coming under stress at once.

The degree of decentralization has to be judged layer by layer

Contracts being deployed on a blockchain does not mean every part of an application is already decentralized. You can check item by item:

  • whether user transactions enter public contracts directly, or are first approved by a service provider;
  • whether contracts can be upgraded, paused or have key parameters replaced, and who holds those permissions;
  • whether funds are controlled by fixed rules, or whether an administrator exists who can unilaterally move assets;
  • which providers prices, cross-chain messages and other external data depend on;
  • whether only one web page, domain, node interface or indexing service is available;
  • what governance voting can decide, and whether execution permissions are genuinely connected to voting outcomes;
  • who takes part in validation, ordering and final confirmation on the underlying blockchain.

Different layers can adopt different control arrangements. Some protocols retain emergency pause or upgrade permissions to handle vulnerabilities, but that also means a particular role can affect user operations. Non-custodial usually means a service provider cannot act for a user unilaterally from its own account; like "permissionless" and "community governed", it describes only one aspect and is still not enough to summarize the whole permission structure.

How DeFi differs from centralized services, and the scope of fintech

Centralized financial services and DeFi can be compared on who controls records, custody and execution. Fintech, meanwhile, is a broad term covering digital services such as payments, lending and investing, and can include both centralized services and DeFi applications that use blockchains.

A centralized financial service usually has the operator keep account records, match or execute operations, and decide whether a user may have access. The balance a user sees is a record in the operator's system, and whether assets can be withdrawn depends on the terms of service and the operating situation.

Fintech is therefore not a third class of system entirely exclusive of the first two. It can be built on traditional institutions and central databases, and can also use blockchains or smart contracts; whether something counts as DeFi still depends on how assets and rules are recorded and executed.

DeFi instead hands some assets and rules to contracts on a blockchain, which users can call directly through a wallet. But "calling a contract directly" does not mean there are no intermediate dependencies: entry points, data, administrator permissions and the underlying network still have to be checked separately.

The main risks of DeFi

DeFi risks can come from a combination of code, assets, markets and infrastructure:

  • a smart contract has defects, or actual permissions do not match the interface's description;
  • administrator keys, governance or an upgrade process are abused;
  • asset prices change quickly, triggering liquidation or causing pool losses;
  • liquidity is insufficient, so a swap price departs noticeably from expectations or a position cannot be exited in the intended amount;
  • oracle data is incorrect, delayed or manipulated;
  • a stablecoin departs from its reference price, affecting collateral and settlement;
  • a cross-chain bridge or another protocol being composed into a call fails;
  • a web page, wallet or signing request is tampered with, inducing a user to approve the wrong asset or permission;
  • blockchain congestion, transaction ordering or a network failure delays operations or makes them fail.

Public code, audit reports and historical uptime can all provide information, but cannot prove that no vulnerability or loss will occur in future. Users also have to separate execution success at the contract level from economic outcome: code can run according to the rules and still produce an unfavourable swap, liquidation or asset value result.

FAQ

Does DeFi have to run on Ethereum?

No. Ethereum is one common environment for running DeFi, and other blockchains supporting assets and programmable contracts can also host DeFi. Accounts, fees, security and the way final confirmation works may differ between networks.

Do assets stay in the wallet the whole time when using DeFi?

Not necessarily. A user usually approves operations through a wallet, but assets may be moved into a pool, a collateral contract or another smart contract. A wallet still being able to display a related token or position does not mean the original asset has not come under contract control.

Does non-custodial mean there is no risk of losing assets?

No. Non-custodial usually means a particular service provider cannot act for a user unilaterally from its own account, but contract vulnerabilities, dangerous approvals, liquidation, price changes and failures in a protocol being depended on can still cause losses.

Are rates in DeFi fixed?

Not necessarily. Many protocols adjust rates according to utilization of funds and governance parameters; fixed-term or fixed-rate products may also adopt other rules. A value shown on a page should be understood together with the calculation method and the period it applies to.

Is a smart contract definitely safe if it is open source?

Not necessarily. Open source gives outside parties a chance to examine the code, but cannot guarantee that every defect has been found, nor prove that the deployed version, administrator permissions and external dependencies are free of problems.

Continue with smart contract, DApp, decentralization, stablecoin and crypto token, or return to the Crypto Glossary.

Sources

إخلاء المسؤولية
يتم توفير هذا المحتوى لأغراض إعلامية فقط وقد يغطي منتجات غير متوفرة في منطقتك. وليس المقصود منه تقديم (1) نصيحة أو توصية استثمارية، (2) أو عرض أو التماس لشراء العملات الرقمية أو الأصول الرقمية أو بيعها أو الاحتفاظ بها، أو (3) استشارة مالية أو محاسبية أو قانونية أو ضريبية. تنطوي عمليات الاحتفاظ بالعملات الرقمية/الأصول الرقمية، بما فيها العملات المستقرة، على درجة عالية من المخاطرة، ويُمكِن أن تشهد تقلّبًا كبيرًا في قيمتها. لذا، ينبغي لك التفكير جيدًا فيما إذا كان تداول العملات الرقمية أو الأصول الرقمية أو الاحتفاظ بها مناسبًا لك حسب وضعك المالي. يُرجى استشارة خبير الشؤون القانونية أو الضرائب أو الاستثمار لديك بخصوص أي أسئلة مُتعلِّقة بظروفك الخاصة. المعلومات (بما في ذلك بيانات السوق والمعلومات الإحصائية، إن وُجدت) الموجودة في هذا المنشور هي معروضة لتكون معلومات عامة فقط. وعلى الرغم من كل العناية المعقولة التي تم إيلاؤها لإعداد هذه البيانات والرسوم البيانية، فنحن لا نتحمَّل أي مسؤولية أو التزام عن أي أخطاء في الحقائق أو سهو فيها.

© 2025 OKX. تجوز إعادة إنتاج هذه المقالة أو توزيعها كاملةً، أو استخدام مقتطفات منها بما لا يتجاوز 100 كلمة، شريطة ألا يكون هذا الاستخدام لغرض تجاري. ويجب أيضًا في أي إعادة إنتاج أو توزيع للمقالة بكاملها أن يُذكر ما يلي بوضوح: "هذه المقالة تعود ملكيتها لصالح © 2025 OKX وتم الحصول على إذن لاستخدامها." ويجب أن تُشِير المقتطفات المسموح بها إلى اسم المقالة وتتضمَّن الإسناد المرجعي، على سبيل المثال: "اسم المقالة، [اسم المؤلف، إن وُجد]، © 2025 OKX." قد يتم إنشاء بعض المحتوى أو مساعدته بواسطة أدوات الذكاء الاصطناعي (AI). لا يجوز إنتاج أي أعمال مشتقة من هذه المقالة أو استخدامها بطريقة أخرى.

المقالات ذات الصلة

عرض المزيد
what-is-blockchain

What is a blockchain?

A blockchain is a digital record book maintained by multiple participants. New records are organized into blocks, and the blocks are connected in order. Computers participating in the blockchain netwo
‏29 أكتوبر 2026
crypto-glossary-cover-v5.contentful

Crypto Glossary A–Z

Explore key crypto, blockchain, and trading terms through concise definitions, organized alphabetically for quick reference. [A](#a) · [B](#b) · [C](#c) · [D](#d) · [E](#e) · [F](#f) · [G](#g) · [H](#
‏29 أكتوبر 2026
decentralized-exchange-dex

What is a DEX?

A decentralized exchange (DEX) is a class of trading system that lets users swap digital assets through blockchain protocols or smart contracts. A smart contract is a program deployed on a blockchain
‏29 أكتوبر 2026
thumbnail:dao

What is a DAO?

A decentralized autonomous organization (DAO) is a way of organizing in which several people make decisions, manage funds or maintain a project together under rules agreed in advance. It often records
‏29 أكتوبر 2026
DApps generic thumb

What is a DApp?

A decentralized application (DApp) is an application that hands some of its core rules or state — balances, ownership and approval records, for example — to a decentralized network such as a blockchai
‏29 أكتوبر 2026
crypto-token

What is a crypto token?

A crypto token is a digital unit defined by a blockchain protocol or an onchain program, which can be recorded and transferred through a blockchain. A blockchain can record token ownership in data uni
‏29 أكتوبر 2026
عرض المزيد