translate (and paraphrase if needed) this paper from English to Persian (Farsi). do it this way: first write a paragraph in English and then write its translation in Farsi under it. try to write the translation in a simple and understandable way.

SoK: Decentralized Finance (DeFi) 
ABSTRACT
Decentralized Finance (DeFi), a blockchain powered peer-to-peer financial system, is mushrooming. Two years ago the total value locked in DeFi systems was approximately 700m USD, now, as of April 2022, it stands at around 150bn USD. The frenetic evolution of the ecosystem has created challenges in understanding the basic principles of these systems and their security risks. In this Systematization of Knowledge (SoK) we delineate the DeFi ecosystem along the following axes: its primitives, its operational protocol types and its security. We provide a distinction between technical security, which has a healthy literature, and economic security, which is largely unexplored, connecting the latter with new models and thereby synthesizing insights from computer science, economics and finance. Finally, we outline the open research challenges in the ecosystem across these security types. 
KEYWORDS 
Decentralized Finance, DeFi, Ethereum, Blockchain
1 DEFI: FINANCE 2.0? 
Consider two views on the promise of Decentralized Finance (DeFi). For the DeFi Optimist, DeFi amounts to a breakthrough technological advance, offering a new financial architecture that is noncustodial, permissionless, openly auditable, (pseudo)anonymous, and with potentially new capital efficiencies. According to this view, DeFi generalizes the promise at the heart of the original Bitcoin whitepaper [109], extending the innovation of non-custodial transactions to complex financial operations. In contrast, the DeFi Pessimist is concerned that, inter alia, the unregulated, hack-prone DeFi ecosystem serves to facilitate unfettered and novel forms of financial crime. The pseudo-anonymous nature of DeFi permits cryptocurrency attackers, scammers, and money launderers to move, clean, and earn interest on capital. A critical part of the debate between the DeFi Optimist and the DeFi Pessimist, but outside of the scope of this paper, is moral in nature. This SoK leaves this important facet aside, focusing instead on synthesizing and evaluating the technical innovations of DeFi, seeking to allow newcomers to the field to discover the essential features and problems of the DeFi terrain. DeFi, in its ideal form, exhibits four properties. 
DeFi is: (1) Non-custodial: participants have full control over their funds at any point in time (2) Permissionless: anyone can interact with financial services without being censored or blocked by a third party (3) Openly auditable: anyone can audit the state of the system, e.g., to verify that it is healthy (4) Composable: its financial services can be arbitrarily composed such that new financial products and services can be created (similar to how one is able to conceive new Lego models based on a few basic building blocks) DeFi has grown rapidly, going from around 700m USD in total value locked (TVL, or analogously “assets under management”) at the start of 2020 to over 150bn USD as of April 2022. Ethereum alone accounts for 75bn USD in TVL, with the most capitalized use cases being collateralized lending, constituting c.54%, of the TVL, and decentralized exchange (DEXs), constituting c.31% of the TVL as of April 2022 [48]. In turn, this rise led to the 24 hour volume on a decentralized cryptoasset exchange [156], overtaking that of a major centralized cryptoasset exchange [34] for the first time [69]. Yet, as with any nascent technology, DeFi is not without its risks. The decentralized nature of DeFi necessarily allows any actor to write unaudited and even malicious smart contracts, where user funds can be lost through programming error or stolen. Moreover, the audit process itself is no guarantee of safety, with many audited protocols (e.g., [10, 75, 101, 138, 166]) suffering serious exploits. This paper. For DeFi to fulfill the vision of the DeFi Optimist, it must first be secure. The central contribution of this SoK is to cleanly and exhaustively delineate the DeFi security challenge into technical security and economic security. The delineation centers on atomicity: whether the attack is near-instantaneous and can costlessly fail (and therefore risk-free), or has a non-instantaneous duration and where failure comes with a cost. This categorization has the benefit of cleanly mapping different types of models to each type of security and clarifying previously vague terms of “economic risk” that have been commonly misapplied to exploits that are better understood as technical in nature (e.g., DEX sandwich attacks). Prior to this paper, economic security risks were largely unexplored, in part because they require synthesizing insights from across computer science, economics, and finance. This SoK is structured as follows. We outline DeFi primitives in Sec. 2 and systematize existing DeFi protocols by six types of operations in Sec. 3. We provide a definition of DeFi exploits in Section 4. We then define a novel functional categorization of technical and economic security risks in DeFi and classify different attacks for each security type in Sections 5 and 6, respectively. We then propose a set of six primary open research challenges for DeFi going forward that build on these security types in Sec. 7. Related work. Several surveys and other SoKs exist on specific DeFi protocol types.1 We direct the reader, when appropriate, to such SoKs for further material (e.g., [15, 41]). One well-structured survey on DeFi has been published after our pre-print [144], which 1Most have been pre-printed since our paper was originally released. arXiv:2101.08778v6 [cs.CR] 15 Sep 2022 categorizes DeFi protocols but focuses on high level risk and regulatory challenges. None of these works delineate the new types of security challenges across DeFi, which is the main focus of our SoK. 
2 DEFI PRIMITIVES 
DeFi protocols require an underlying distributed ledger such as a blockchain, a peer-to-peer distributed append-only record of transactions. We take the underlying distributed ledger layer solely as an input into DeFi and refer the reader to existing work (notably [14, 25, 71, 171]) for a fuller exposition of the blockchain layer itself. We assume that the ledger has the basic security properties of consistency, integrity and availability [175]. Without these security properties, DeFi protocols built on top of such a ledger would themselves become inherently insecure. In this section, we draw attention to features of the underlying blockchain layer that are most pertinent to DeFi. 
2.1 Smart Contracts and Transactions 
Smart Contracts. The most important provision is that the underlying ledger offers the ability to use smart contracts, which are program objects that live on the blockchain. These are able to communicate with one-another, via message-calls, within the same execution context and support atomicity, i.e., a transaction either succeeds fully (state update) or fails entirely (state remains unaltered), such that no execution can result in an invalid state. In some cases, bundles of transactions, in which transactions are grouped together in a given sequence, can also be executed atomically (e.g., [61]). Smart contracts rely on blockchains that are transaction-based state machines, whereby an agent can interact with smart contracts via transactions. Once a transaction is confirmed, the contract code is run by all nodes in the network and the state is updated. The underlying cost to state updates comes in the form of transaction fees charged to the sender. For instance, the Ethereum Virtual Machine (EVM) [165] on the Ethereum [27] blockchain is a stack machine which uses a specific set of instructions for task execution. The EVM maintains a fixed mapping of how much gas, an Ethereumspecific unit that denominates computational cost, is consumed per instruction. The total amount of gas consumed by a transaction is then paid for by the sender [121, 162]. In order for DeFi protocols to function on top of them, smart contracts must: • be expressive enough to encode protocol rules • allow conditional execution and bounded iteration • be able to communicate with one-another, via message-calls, within the same execution context (typically a transaction) • support atomicity, i.e., a transaction either succeeds fully (state update) or fails entirely (state remains unaltered), such that no execution can result in an invalid state These properties provide composability, where smart contracts can be snapped together like Lego bricks (“Money Lego" [47]), with the possibility of building complex financial architectures. This is similar to as was envisaged in [82]. While promising, the sideeffects of smart contracts interactions and the space of all possible interactions is vast. In a setting focused on financial applications, such complexity brings with it a great burden to understand the emergent security properties of composed smart contracts. We discuss this in more detail in Sections 5 and 6. One particularly common use of smart contracts is to implement tokens, on-chain assets. Transaction Execution. When a blockchain network participant wishes to make a transaction, the details of the unconfirmed transaction are first broadcast to a network of peers, validated, and then stored in a waiting area (the mempool of a node). This mempool is then propagated among the network nodes. Participants of the underlying ledger responsible for ensuring consensus, miners, then choose which transactions to include in a given block, based in part on the transaction fee attached to each transaction. Transactions in a block are executed sequentially in the order in which the miner of the respective block included them. For a detailed treatment of how this process works, we refer the reader to [109, 110, 123, 165]. Miners have the ability to control the sequence in which transactions are executed. Hence, miners can order transactions in ways that will earn them revenues and even insert their own transactions to extract further revenues. Miners can even be bribed to undertake such transaction re-ordering [107, 164]. The value that miners can extract is known as Miner Extractable Value (MEV) [46]. We consider these issues in detail in Sec. 6.2. 
2.2 Keepers 
Protocols may rely on their on-chain state being continually updated for their security. In transaction-based systems, updating the on-chain state requires transactions that are triggered externally. Since smart contracts are not able to create transactions programmatically, protocols must rely on external entities to trigger state updates. These entities, keepers, are generally financially incentivized to trigger such state updates. For instance, if for whatever reason a protocol requires a user’s collateral to be automatically liquidated under certain conditions, the protocol will incentivize keepers to initiate transactions to trigger such liquidation. 
2.3 Oracles 
An oracle is a mechanism for importing off-chain data into the blockchain virtual machine so that it is readable by smart contracts. This includes off-chain asset prices, such as ETH/USD, as well as offchain information needed to verify outcomes of prediction markets. Oracles are relied upon by various DeFi protocols (e.g. [2, 97, 104, 125, 146]). Oracle mechanisms differ by design and their risks, as discussed in [90, 100]. A centralized oracle requires trust in the data provider and bears the risk that the provider behaves dishonestly should the reward from supplying manipulated data be more profitable than from behaving honestly. Decentralized oracles offer an alternative. As the correctness of off-chain data is not verifiable on-chain, decentralized oracles tend to rely on incentives for accurate and honest reporting of off-chain data. However, they come with their own shortcomings. We provide a detailed overview of oracle manipulation risks and on the shortcomings of on and off-chain oracles in Sections 5.2 and 6.4. 2 
2.4 Governance
Governance refers to the process through which a system is able to effect change to the parameters which establish the terms on which interactions between participants within the system take place [90]. Such changes can be performed either algorithmically or by agents. While there is existing work on governance in relation to blockchains more broadly (e.g. [16, 94, 130]), there is still a limited understanding of the properties of different mechanisms that can be used both for blockchains and DeFi. Presently, a common design pattern for governance schemes is for a DeFi protocol to be instantiated with a benevolent dictator —sometimes distributing power over a small council or “multisig”— who has control over governance parameters, with a promise made by the protocol to eventually decentralize its governance process. Such decentralization of the governance process is most commonly pursued through the issuance of a governance token (e.g. [13, 36, 44, 105]), an ERC-20 token which entitles token holders to participate in protocol governance via voting on and possibly proposing protocol updates. This token represents ownership in a decentralized autonomous organization (DAO) that is taksed with stewardship of the protocol. Protocol upgrades in the DAO setting come through proposals in the form of executable code, on which governance token holders vote. In order to propose protocol updates, the proposer has to hold or have been delegated a threshold number of governance tokens. For a protocol upgrade to be executed, a minimum number of votes is required, which is commonly called a “quorum” in this setting.