Self-executing code deployed on a blockchain that automatically enforces agreement terms when predefined conditions are met, without human intermediaries.
Smart contracts were popularised by Ethereum, which expanded blockchain functionality from simple value transfer to programmable logic. A smart contract is deployed once to the blockchain and then runs exactly as written, with no possibility of modification once live - a property called immutability that provides strong execution guarantees but also makes bugs permanent until a contract upgrade mechanism (if built in) is used.
Every DeFi protocol, NFT collection, and decentralised exchange is built on smart contracts. When a user swaps tokens on Uniswap, a smart contract calculates the exchange rate, moves tokens between wallets, and sends LP fees to liquidity providers - all atomically in a single transaction. If any step fails, the entire transaction reverts and no funds move.
For traders, smart contracts are significant in three ways. First, they underpin every DeFi protocol's mechanics - understanding the contract logic explains how liquidations, fee structures, and slippage work. Second, smart contract audits (by firms like Trail of Bits, OpenZeppelin, or Certik) are a primary signal of protocol security. Unaudited contracts carry substantially higher exploit risk. Third, cross-chain bridges - which lock assets on one chain and mint representations on another - are themselves smart contracts and have been the targets of the largest DeFi hacks.
Worked Example
A borrower deposits 1,500 USDC as collateral into Aave. The smart contract monitors the collateral ratio continuously. When USDC falls in value and the ratio drops below the 115% liquidation threshold, the contract automatically sells the collateral to repay the loan, applying a 5% liquidation penalty - no human intervention, no delay, no appeal. The entire sequence executes in a single transaction on-chain.