# The Blockchain Oracle Problem in Decentralized Finance--A Multivocal Approach
## 5 Risks and Attack Vectors
### Front Running (S)  
Front-running attacks are due to the natural condition in which the oracle is the first to be aware of critical data uploaded to the blockchain to run a smart contract. Arguably, the early awareness of data gives an important advantage to the oracle data provider [66]. Knowing that an asset price will be sent to a specific platform at a precise time may enable fraudulent operations. Furthermore, block-time, congestions, the exploitation of bots, and automated procedures make front-running attacks more and more feasible [85]. In legacy finance, the front-running attack is quite known, but it can be performed only by a restricted number of people (insiders) aware of pieces of knowledge that are not of the public domain [102]. In decentralized finance, as information is transparent, anyone that realizes the potential of information to be exploited for a front-running attack may be a potential attacker. A known example of a front-running attack is the one exploited on Terra Money. Terra is a stable coin whose potential is to be available on multiple blockchains such as Ethereum and Solana [103].  
In 2019, Terra witnessed a front-running attack on its oracle, specifically designed to be secure and reliable. The Terra oracle price feed registers the price of external assets in three phases. The first is the pre-vote phase (N-2), in which the price of an external asset is proposed as a feed. The second is the voting phase (N-1), in which, in case of insufficient votes, the proposal can be rejected. The third is the confirmation phase (N), in which the proposal is finally registered in the blockchain. Every step of this system lasts for 12 blocks so that from the pre-voting phase to the confirmation phase, there is a 24 blocks distance. This means that at time N, the price accepted is that of time N-2. What helped the hack was also that, by the time of the attack, to incentivize trades on the platform, the swap between Terra coins was offered without fees. It happened then in August 2019 (Figure 7) an attacker spotted a little discrepancy (2%) between the spot price and the oracle price. Exploiting the zero fees policy was then able to trade assets at a discounted rate. From that point, Terra Money was then obliged to introduce two fees: fixed and proportional. A little discrepancy of 1 to 2% of the price was then completely absorbed by the fees, making front-running attacks inconvenient [104].  
The front-running attack can also be performed by exploiting the blockchain fee mechanism, which prioritizes transactions with higher fees. Since blockchain is publicly auditable, it is also possible to have a look at pending transactions that have still to be confirmed. If, for example, in the transaction pool, we observe a swap of thousands of DAI for another asset, this will surely impact prices. If we then perform a transaction and pay a higher fee so that our transaction is mined before the swap, then we can benefit from that prioritized action. This is known as \"Miners Extractable Value (MEV) Problem\", but although it involves oracles, it cannot be considered an oracle manipulation [105].