{
  "id": "c1140080-e753-510f-8a31-7797bd28ede6",
  "slug": "smart-contract",
  "term": "Smart Contract",
  "aliases": [],
  "category": "Crypto & Digital Assets",
  "category_slug": "crypto-digital-assets",
  "difficulty": "intermediate",
  "definition": "A smart contract is a self-executing program stored on a blockchain that automatically enforces and executes the terms of an agreement when predefined conditions are met, eliminating the need for intermediaries such as banks, brokers, or escrow agents. Smart contracts are the foundational technology underlying decentralized finance (DeFi), NFTs, decentralized exchanges, and a wide range of blockchain-based financial applications.",
  "key_takeaways": [
    "Smart contracts are immutable once deployed — their code cannot be changed, which provides security and trustlessness but also means bugs and vulnerabilities are permanent unless the contract is replaced by a new version.",
    "Ethereum's Solidity language is the dominant smart contract programming language, though competing smart contract platforms (Solana, Avalanche, BNB Chain) use alternative languages.",
    "Smart contracts execute deterministically — the same input always produces the same output — which is essential for trustless financial transactions but limits flexibility and adaptability.",
    "Gas fees — transaction costs on Ethereum paid in ETH — are the economic friction of smart contract execution; complex contracts with many operations cost more gas, limiting the viability of high-frequency applications.",
    "The $600+ million Poly Network hack (2021) and the $320 million Wormhole exploit (2022) illustrate that smart contract vulnerabilities can lead to catastrophic fund losses, underscoring the importance of security audits."
  ],
  "detailed_explanation": "Smart contracts were conceptualized by computer scientist Nick Szabo in 1994 as 'computerized transaction protocols that execute terms of a contract,' though they became practically implementable only with Ethereum's launch in 2015. Unlike Bitcoin's limited scripting capability, Ethereum introduced a Turing-complete programming environment allowing developers to deploy arbitrarily complex logic — effectively a world computer where any financial agreement that can be algorithmically specified can be implemented without trusted intermediaries.\n\nAt a technical level, a smart contract is bytecode deployed at a specific address on the blockchain. When users send a transaction to that address (along with any required inputs and ETH gas fees), the Ethereum Virtual Machine (EVM) executes the contract's code across all validating nodes simultaneously. The execution is deterministic and transparent: any observer can verify the logic and trace every historical call. Once deployed, the contract's logic is immutable — it will execute exactly as written, for better or worse, until the network itself ends.\n\nThe financial applications of smart contracts are vast and rapidly evolving. Decentralized exchanges (DEXs) like Uniswap use smart contracts to implement automated market maker (AMM) algorithms — liquidity pools where prices are determined by a constant-product formula (x × y = k) rather than an order book. Lending protocols like Aave and Compound use smart contracts to manage overcollateralized loans, automatically liquidating borrowers if collateral value falls below a threshold. Stablecoin protocols like MakerDAO use smart contracts to issue DAI, a dollar-pegged stablecoin backed by volatile crypto collateral, managing the peg through algorithmic interest rate adjustments.\n\nFor institutional investors and hedge funds operating in crypto markets, smart contracts introduce a distinct risk taxonomy. Code risk (bugs and exploits) is the most severe — attackers actively probe deployed contracts for vulnerabilities, and successful exploits can drain protocol liquidity pools entirely within a single transaction. Oracle risk emerges because smart contracts cannot natively access off-chain data (prices, exchange rates, real-world events) — they rely on oracle networks (Chainlink, Pyth) to feed in data, and manipulation of oracle prices has been used in numerous flash loan attacks. Governance risk reflects the fact that many DeFi protocols give tokenholders voting power over parameter changes, creating potential for collusion or 51% attacks.\n\nThe concept of 'composability' — the ability of smart contracts to call other smart contracts — is simultaneously a key strength and source of systemic risk in DeFi. Complex DeFi transactions can chain together calls to multiple protocols in a single atomic transaction (a 'flash loan'), enabling sophisticated arbitrage but also creating complex interdependencies that can propagate failures across the ecosystem.",
  "example": "A DeFi trader wants to exploit a price discrepancy between the price of ETH in USDC on Uniswap ($1,850) and on Curve ($1,862). Using a Uniswap smart contract and a flash loan from Aave, they: (1) borrow 1,000 ETH from Aave with no collateral (flash loan — must be repaid in the same transaction); (2) sell 1,000 ETH on Curve for $1,862,000 USDC; (3) buy 1,000 ETH on Uniswap for $1,850,000 USDC; (4) repay the flash loan plus fee (0.09% = $1,665); (5) net profit of $10,335. The entire sequence executes atomically in a single Ethereum transaction — either all steps succeed or none do, eliminating settlement risk. Gas costs of approximately $50 for a complex multi-step smart contract interaction reduce net profit to roughly $10,285.",
  "formula": null,
  "formula_latex": null,
  "interactive_type": "model",
  "calculator_id": null,
  "related_terms": [
    "arbitrage",
    "automated-market-maker",
    "bitcoin",
    "blockchain",
    "cross-chain-bridge",
    "decentralized-exchange",
    "ethereum",
    "exchange",
    "flash-loan",
    "interest-rate",
    "liquidity",
    "market-maker",
    "order-book",
    "perpetual-swap",
    "proof-of-stake"
  ],
  "backlinks": [
    "cross-chain-bridge",
    "defi-decentralized-finance",
    "flash-loan",
    "liquidity-pool",
    "nft-non-fungible-token",
    "proof-of-stake",
    "stablecoin",
    "staking"
  ],
  "cross_references": [
    "arbitrage",
    "automated-market-maker",
    "bitcoin",
    "blockchain",
    "ethereum",
    "exchange",
    "flash-loan",
    "interest-rate",
    "liquidity",
    "market-maker",
    "order-book",
    "settlement",
    "settlement-risk",
    "stablecoin",
    "systemic-risk"
  ],
  "tags": [
    "level:intermediate",
    "cat:crypto-digital-assets"
  ],
  "asset_classes": [
    "crypto"
  ],
  "regulators": [],
  "see_also": [],
  "sources": [],
  "wordcount": 767,
  "checksum": "edece437bcf847e8",
  "version": "2026.05.03",
  "license": "CC-BY-4.0",
  "updated_at": "2026-09-07T02:15:24+00:00",
  "_links": {
    "self": "https://hedgefund.wiki/api/v1/terms/smart-contract",
    "jsonld": "https://hedgefund.wiki/api/v1/terms/smart-contract?format=jsonld",
    "markdown": "https://hedgefund.wiki/api/v1/terms/smart-contract?format=md",
    "graph": "https://hedgefund.wiki/api/v1/graph/smart-contract",
    "category": "https://hedgefund.wiki/api/v1/categories/crypto-digital-assets",
    "schema": "https://hedgefund.wiki/schema/term.schema.json",
    "html": "https://hedgefund.wiki/#/terms/smart-contract"
  }
}