Education
November 10, 2026

DeFi: How Decentralized Finance Works

Swapping tokens without a traditional exchange, borrowing against crypto collateral or depositing assets into a pool that lets others trade. All of this is offered by decentralized finance, or DeFi. Activities that financial institutions handle elsewhere are partly carried out here by programs on a blockchain. The questions, however, remain the same: where does the yield come from, who decides the rules and what happens when something fails.


An application may seem simple: we connect a wallet and confirm a transaction. To understand the service, however, we need to follow the actual movement of funds. What are we sending, what claim do we receive in return and when can we get back to our assets? Using swaps, loans and liquidity provision, we will explain how DeFi works and where risk arises.


What DeFi means


DeFi is short for decentralized finance. It is an umbrella term for financial protocols and applications that use public blockchains. We can think of a protocol as a set of rules according to which a service accepts deposits, executes swaps or works with collateral. It is not a single company, nor a single way of operating.


What changes compared with a bank or a centralized exchange


With a bank or a centralized exchange, a specific operator keeps the accounts, settles transactions and applies the terms. In DeFi, some of these tasks can be performed by a smart contract that the user interacts with through their own wallet. This does not, however, remove all trust: someone wrote the code, sets the parameters, runs the interface or provides the price data. "Decentralized" therefore does not automatically mean "without intermediaries" or "without risk".


The rules are executed by so-called smart contracts. These are programs stored on a blockchain. Through a wallet, the user signs a transaction that triggers a specific operation. If the conditions of the program are met, the network executes it. The term "smart contract" does not mean that the program understands the user's situation or can judge whether the outcome is fair. It executes the rules as written.


Holding tokens in your own wallet is not the same as having them deposited in a protocol. After a deposit into a lending service, the wallet may receive a token confirming a claim to the deposited assets or a share of them. The original funds are meanwhile managed by a smart contract. Withdrawal depends, among other things, on the available liquidity and on whether the deposit serves as collateral for a debt. Holding private keys therefore does not by itself guarantee that we can immediately withdraw funds from the protocol.


defi_token_swaps

How a swap works without a traditional order book


On some decentralized exchanges, we do not trade directly with another person. Instead, we swap tokens through a so-called liquidity pool: a shared reserve of two or more tokens. It is created by people who have deposited their tokens into the pool. A trader puts in one token and, according to the pool's rules, receives another. This principle is called an automated market maker (AMM). Not all decentralized exchanges work the same way, however.


Let us imagine the pool as a shared reserve of ETH and USDC. When people buy ETH from it, its reserve in the pool decreases and the ratio of the two tokens changes. This also changes the price of the next swap. The larger the trade relative to the available funds, the more we can move the price ourselves. This effect of the size of our trade on the price is called price impact.


Price impact needs to be distinguished from slippage. Slippage means that the actual result of a swap differs from the result displayed before it was confirmed, for example because market conditions changed in the meantime. In the application, we can usually set the largest acceptable deterioration of the result. This setting is not a fee and does not guarantee that the swap will always be executed.


Example: the application offers a total of 0.500 ETH for 1,000 USDC. With a slippage tolerance of 1%, the minimum acceptable output will be 0.495 ETH. If the swap cannot be executed under these conditions, the transaction fails or does not take place. The figures are illustrative; we pay the network fee separately and the actual result also depends on the fee of the specific service.


On some public blockchains, the order in which transactions are executed also matters. Another participant may spot a pending trade, buy before it and sell right after it, thereby worsening the price for the original trader. This is called a sandwich attack. An appropriate slippage setting can limit the risk but does not eliminate it on its own.


On Ethereum, a transaction consumes computational work referred to as gas. If a transaction that has already been included fails during execution and its changes are reverted, we may still lose the fee paid for the gas consumed. We therefore need a balance for network fees even when we are only swapping other tokens.


Lending and interest paid by the borrower


In a lending protocol, one group of users supplies assets and another borrows them. A supplier, for example, deposits USDC into a shared pool. Borrowers draw loans from it and pay interest. From this interest, the protocol derives the suppliers' yield according to its rules; part of it may go to the protocol's reserves. The basic source of this yield is therefore the price that users pay for the borrowed assets.


The interest rate can respond to the utilization of the pool. When a large part of the available tokens is borrowed, the cost of further loans usually rises. When demand weakens, the rate may fall. The currently displayed annual yield is therefore not a promise of the same result for the whole year. High utilization can also limit immediate withdrawals: the protocol needs to have enough unborrowed tokens to fulfill the request.


Simply supplying tokens to a lending pool needs to be distinguished from using them as collateral for one's own loan. If the user is also carrying debt, part of their deposit must remain available as collateral. A withdrawal must not breach the rules of their position. The specific conditions always depend on the protocol, the market and the asset used.


defi_crypto_lending

Why a loan needs collateral


With common collateralized DeFi loans, the borrower first deposits assets whose value exceeds the borrowed amount. The protocol thus limits its reliance on the borrower's identity and future willingness to repay. If the collateral loses too much value, the protocol allows part of it to be used to repay the debt through liquidation.


An ETH holder can thus obtain, for example, stablecoins without selling their ETH right away. They still bear the risk of its price, however, and also take on a debt with interest. Once it is repaid, the collateral can be released, provided it is no longer needed for another loan. If they use the borrowed tokens to buy more ETH, they increase their exposure to its price movements even further.


Let us look at a simplified position. A user deposits 2 ETH at an illustrative price of 2,000 USD each. The collateral is worth 4,000 USD, and against it they borrow 2,000 USDC. Let us assume that USDC still equals one dollar and that the liquidation threshold is 80% of the collateral value. These are not the current parameters of any specific market.


To let the user see how close their loan is to liquidation, some protocols use a position health indicator (health factor). The higher the number above 1, the larger the safety margin. If it falls below 1, the loan may be liquidated. In our example, we calculate it by multiplying the collateral value by the 80% liquidation threshold and dividing the result by the debt. For simplicity, we do not include continuously accruing interest.


Price of one ETH: 2,000 USD

Collateral value: 4,000 USD
Health factor: 1.60


Price of one ETH: 1,500 USD

Collateral value: 3,000 USD
Health factor: 1.20


Price of one ETH: 1,200 USD

Collateral value: 2,400 USD
Health factor: 0.96


The table shows that as the price of ETH falls, the safety margin of the loan also shrinks. At a price of 1,200 USD per ETH, the health factor is 0.96, so the position may be liquidated. The pledged ETH is still worth 2,400 USD, which is more than the 2,000 USD debt. However, it no longer covers the margin required by the protocol. A so-called liquidator can then repay part of the debt and in return receive part of the pledged ETH, including a set bonus.


Moreover, the liquidation threshold is not the same as the maximum permitted loan-to-collateral-value ratio when the loan is taken out. The protocol may leave a buffer between the two limits. The position is also affected by the debt growing with interest or by a change in the price of the borrowed asset. The borrower therefore needs to monitor the whole position, not just the number of pledged tokens.


Providing liquidity and the cost of fee income


Let us return to swaps. For a pool to offer tokens to traders, someone has to supply them. In return, the liquidity provider can receive a share of the fees paid by traders. At the same time, however, the composition of their share changes with swaps. They do not keep holding the same amount of both originally deposited tokens.


Let us imagine a simple ETH and USDC pool, such as the one used by Uniswap v2. A user deposits 1 ETH and 2,000 USDC into it. At an illustrative ETH price of 2,000 USD, their deposit is worth 4,000 USD. We assume that the price of USDC stays at one dollar, no fees are charged and no one else deposits or withdraws funds in the meantime. In this type of pool, the amounts of both tokens are recalculated during trades according to a mathematical rule called the constant product.


If ETH rises to 4,000 USD, the share in such a model corresponds to approximately 0.7071 ETH and 2,828 USDC. We can compare the result with holding the original tokens without depositing them into the pool.


Holding the original tokens

Final composition: 1 ETH and 2,000 USDC
Value with ETH at 4,000 USD: 6,000 USD


Deposit into the model pool

Final composition: Approximately 0.7071 ETH and 2,828 USDC
Value with ETH at 4,000 USD: Approximately 5,657 USD


The value of the deposit in the pool rose from 4,000 USD to approximately 5,657 USD. However, had the user simply held the original 1 ETH and 2,000 USDC, they would have 6,000 USD. The difference is about 343 USD, or 5.72%. Although the investor did not lose money on the pool overall, they earned less than by simply holding. This difference is called impermanent loss (often described as a "temporary loss"). It arises because the ratio of tokens in the pool changes continuously during trading.


The name suggests the loss is temporary, but a return to the original price ratio is not guaranteed. Fee income may offset the difference, or it may not. With concentrated liquidity pools, the chosen price range also matters. A position outside it may stop earning fees. The result of our simple example therefore cannot be applied to all types of pools.


Where the offered yields come from


A similar percentage in an application may hide different sources of income. To assess a service, what matters is which activity generates the yield and in which token the user receives it. The following overview summarizes the basic differences.


Supplying assets to a lending pool

Source of reward: Interest paid by borrowers
What needs to be distinguished: Variable rate and availability of funds


Providing liquidity for swaps

Source of reward: Traders' fees
What needs to be distinguished: Fee income and change in the value of the position


Staking in a proof of stake network

Source of reward: Rewards under the network's rules for participating in its security
What needs to be distinguished: Validator activity and the risks of the chosen staking method


Protocol incentive program

Source of reward: Distributed reward tokens
What needs to be distinguished: Income from the service and temporary subsidy of participation


Incentive tokens can increase the displayed yield, but their market price may fall and the program may end. A high percentage therefore does not necessarily reflect equally high demand for the service itself. When comparing, it makes sense to separate income from borrowers or traders from additionally distributed tokens.


The term staking also deserves attention. Actual staking relates to securing the network and the work of validators. Lending tokens to other users has a different source of yield and a different risk, even though the interface may present both options in a similar way. We explain the details in a separate article on staking.


Another layer is formed by yield vaults. The user deposits assets into a contract that deploys them into other services according to a certain strategy. Automation can simplify management, but it does not create yield by itself. It is necessary to find out where the funds go, who manages the strategy, what fees they charge and what withdrawal depends on.


Who sets the rules of the service


Someone designs the protocol's rules and someone decides on any changes to them. With some services, users participate through a DAO (decentralized autonomous organization): proposals are voted on by people holding the relevant voting tokens or delegated votes. Part of Aave's governance works this way, for example. It does not follow, however, that every user automatically has one equally weighted vote. Whoever holds or represents more voting rights may have greater influence on decisions.


Besides voting, there may be special permissions for administrators or emergency interventions. Aave's documentation, for example, describes roles that allow selected parameters to be changed or a market to be paused. Such an option can help protect funds during an incident, but it also means trusting the holder of that permission. The scope of powers varies between protocols.


It is also important to distinguish between the contracts themselves and the application through which we access them. A website is only one layer of the service. The rules of the contracts, decisions about their governance and the terms of the interface operator should therefore be assessed separately. The degree of decentralization cannot be judged merely by the fact that a crypto wallet connects to the website.


DeFi and European regulation: the actual operation of the service is decisive


In the European Union, the legal status of the specific provider is also important. The MiCA regulation may also apply to crypto services where part of the activities takes place in a decentralized manner. According to the regulation, services provided in a fully decentralized manner without an intermediary should fall outside its scope. What is decisive is therefore not the "DeFi" label on a website, but the actual way the service is operated, control over the service and the role of the persons involved. The use of DeFi does not in itself prove the existence of a license, supervision or a right to compensation.


defi_risks_and_security

Who bears the risk when there is a problem


The risk depends on the user's activity. A borrower may lose collateral in a liquidation. A liquidity provider bears the impact of price changes and of changes in the composition of their share. A supplier to a lending pool is exposed to its functioning, the availability of liquidity and potential losses if the collateral is not enough to cover unpaid debts.


A common risk is a bug in a contract or an attack on it. An audit means a review of the code within a certain scope, not a certainty that no bug can ever surface. Protocols may also use price sources referred to as oracles. These supply data needed, for example, to value collateral. An incorrect or delayed price can affect the safety of loans as well as liquidations.


Wallet permissions: what we are actually confirming


Connecting a wallet, signing a message, transferring tokens and granting a permission to a smart contract are different actions. With a token permission (approval), we give a designated contract the ability to transfer specific tokens from our wallet up to a set limit. An unlimited limit does not necessarily indicate fraud on its own, but it increases the damage that can occur if the permission is misused or the contract is compromised.


Let us imagine a page promising a reward of 20 USDC. Instead of paying out the reward, it asks for the ability to handle all the USDC we already have in our wallet. The mismatch between the promised action and the requested consent is a reason to reject the operation and verify it. Simply disconnecting the page does not revoke a granted permission. If it has already been granted, it needs to be reviewed and, if necessary, revoked using a trustworthy tool.


The assets themselves bring further dependencies. A stablecoin is meant to maintain a peg, for example to the dollar; this goal, however, is not in itself a guarantee of the market price. For tokens backed by reserves, the issuer and the quality of the backing also matter. The issuer of USDC, Circle, also describes the possibility of blocking certain addresses and freezing funds under specified circumstances. Using such a token in DeFi does not remove this dependency.


When moving between blockchains, bridges may be added. These have their own mechanisms and security assumptions. A strategy using multiple protocols then combines several dependencies: a problem with a bridge, a price source or an underlying asset can spread to another application as well. Interconnection enables new services, but at the same time it can spread losses.


Any compensation for damage depends on the specific product, its terms and the available protection mechanisms. From the DeFi label alone, a successful audit or the existence of a DAO, it cannot be inferred that someone will automatically return a lost deposit. It is therefore essential for users to also know the scenario in which protection is not enough.


What to compare before use


The interest rate alone is not enough. When comparing a service, we need to include network fees, swap costs, any manager fees and the route back to the asset in which we want to measure the result. With a smaller amount or a short period, these costs can consume a substantial part of the rewards.


It is useful to be able to answer a few questions in your own words:

  • – What exactly am I depositing and what claim do I receive in return?
  • – Who pays my yield and in which token will I receive it?
  • – Under what conditions can I withdraw funds or lose collateral?
  • – Who may change the rules, manage the strategy or pause operations?
  • – Which assets, price sources and other protocols does the service depend on?
  • – What permission am I granting from my wallet and how would I revoke it if needed?


The answers should be traceable in verified documentation and relate to the specific network and product version. It is useful to verify the exact address of the application and the contract, not just a familiar logo. If we cannot describe where the yield comes from, what we are actually confirming or how a withdrawal will work, the displayed percentage alone is not enough for an informed decision.


Conclusion


DeFi makes it possible to carry out financial operations through programmable rules on a blockchain. A swap uses available liquidity, a loan works with collateral and yield has a specific source: interest, fees, network rewards or incentives. Each of these mechanisms comes with different conditions and a different possible way of losing money.


To understand a service, it is therefore useful to follow the entire chain: where the funds go, what claim remains in the wallet, who may intervene in the rules and how the return to the original assets works. Using a wallet directly gives the user greater responsibility for decisions, not automatic certainty of safety.


A clear product should make it possible to explain not only the favorable yield scenario, but also the situation in which the price drops sharply, liquidity runs out, a permission is misused or some part of the infrastructure fails. It is precisely understanding these connections that makes it possible to assess DeFi objectively, without assuming that automation guarantees safety.


Sources and further reading


[1] Chainalysis. What Is DeFi
[2] Ethereum.org. Introduction to smart contracts
[3] Aave. Liquidity Pool
[4] Hayden Adams, Noah Zinsmeister and Dan Robinson. Uniswap v2 Core
[5] Uniswap Labs. What is price impact
[6] Uniswap Labs. How to change slippage on the Uniswap Web app
[7] Ethereum.org. Gas and fees
[8] Aave. Aave V3 Overview
[9] Aave. Health Factor and Liquidations
[10] Aave. Reserve
[11] Uniswap. Understanding Returns
[12] Uniswap Labs. What is Impermanent Loss
[13] Uniswap Labs. What are the risks when providing liquidity
[14] Ethereum.org. Ethereum staking
[15] Aave. Vaults
[16] Aave. Governance
[17] Aave. Access Control Manager
[18] Ethereum.org. Decentralized finance
[19] Aave. Risks
[20] Ethereum.org. Stablecoins
[21] Circle. USDC Terms
[22] Ethereum.org. Blockchain bridges
[23] European Parliament and Council of the EU. Regulation (EU) 2023/1114 (MiCA), recital 22.
[24] Ethereum.org. How to revoke smart contract access to your crypto funds.
[25] Uniswap Labs. What is a sandwich attack?
[26] MetaMask Help Center. How to revoke smart contract allowances/token approvals.


This text is for educational purposes only and does not constitute investment or legal advice. Protocol parameters and their governance rules may change; the current documentation should be verified before use. Status of expert and regulatory review: November 18, 2026.

Show all articles

Author

Tomáš Bára

Tomáš Bára
Education
November 3, 2026 18 minutes reading

What Determines Cryptocurrency Prices?

Why does one cryptocurrency cost a few cents and another thousands of euros? Find out how the price is formed through trading, what role supply, demand and liquidity play, what market capitalisation actually expresses and why price swings can be so sharp.

Read more
Education
October 27, 2026 18 minutes reading

Bitcoin-Backed Mortgages: The Evolution of Financing or the Beginning of a Revolution?

Can you buy a property without selling your Bitcoin? In the US, Bitcoin-backed mortgages and loans already exist. Find out how these models work, what LTV means, who controls the collateral during repayment and why using them in the Czech Republic is still complicated.

Read more
This article is for informational purposes only and does not constitute investment, financial, legal, or tax advice. The information provided in the article is not a recommendation to buy, sell, exchange, or hold cryptocurrencies or other digital assets. The value of cryptocurrencies can fluctuate significantly, and investing in them involves the risk of losing part or all of the invested amount. Before making any decision, we recommend considering your own financial situation and, where appropriate, consulting a professional.