DeFi Smart Contract

In DeFi, a smart contract replaces the financial institution in the transaction. A smart contract is a type of Ethereum account that can hold funds and can send/refund them based on certain conditions. No one can alter that smart contract when it's live – it will always run as programmed.
Many cryptocurrencies and decentralized applications (DApps) function using smart contract code to facilitate the exchange of goods, services, data, funds and so on. While users of centralized financial institutions, such as a bank or credit unions, are able to rely on intermediaries to manage a transaction, DApps must use smart contracts to ensure that each transaction is legitimate, transparent and trustless — and that goods or services are, in fact, being transferred in line with the predetermined provisions of the agreement.

DeFi Smart Contract

Decentralized finance uses the blockchain technology that cryptocurrencies use. A blockchain is a distributed and secured database or ledger. Applications called dApps are used to handle transactions and run the blockchain.
In the blockchain, transactions are recorded in blocks and then verified by other users. If these verifiers agree on a transaction, the block is closed and encrypted; another block is created that has information about the previous block within it.
The blocks are "chained" together through the information in each proceeding block, giving it the name blockchain. Information in previous blocks cannot be changed without affecting the following blocks, so there is no way to alter a blockchain. This concept, along with other security protocols, provides the secure nature of a blockchain. National Institute of Standards and Technology. "Blockchain."