Over the last decade, the financial sector has changed drastically due to blockchain technology. Blockchain, including Terra, wish to create digital money which would present an alternative payment method for everyday transactions for millions of users across the world. An increasing number of cryptocurrencies and crypto users has led to a rising number of cryptocurrency exchanges which enable trading with cryptocurrencies. Among them, the price of coins and tokens differs which gives the users an opportunity to profit in the form of arbitrage. The process of arbitrage begins with buying one cryptocurrency on the first exchange and then selling it on the second exchange. The difference in buying and selling price is the profit earned by the user. In this diploma thesis, a bot for arbitrage on the Terra blockchain was created. It uses smart contracts to execute decentralized arbitrage assisted with flash loans. Implementation has been tested on the public testing network (Testnet) and the main network (Mainnet). During the testing period, the bot discovered and executed eight arbitrage opportunities on the same cryptocurrency pair which resulted in a total net profit of over 1,000 \euro{}. Despite the larger number of cryptocurrency pairs on the Mainnet only a single arbitrage opportunity was discovered and executed. It ultimately resulted in negative net profit due to high operating fees. Arbitrage success is mainly dependent on the daily transaction volume of cryptocurrency exchanges since higher transaction volumes result in higher price fluctuations. This conclusion is confirmed by the analysis of cryptocurrency exchange on the Ethereum blockchain, where significantly more arbitrage opportunities were present than on the Terra blockchain. While testing on the Testnet we also discovered the possibility of manipulating token price on exchanges with lower liquidity in order to achieve successful arbitrage. The inclusion of arbitrage transaction fees in the process of arbitrage execution is proposed in order to improve the current implementation.
|