Finding Optimal Arbitrage Opportunities with QPath
Have you ever wondered if it is possible to make money by exchanging currencies? Believe it or not, the answer is yes! This is possible because exchange rates are fixed by currency pairs and sometimes when considering more than two currencies, we can find a sequence of exchanges that allows us to make money by returning to the initial currency. This is what is known as currency arbitrage. To illustrate these ideas, let us consider the example in Fig. 1.
So, for example, if our starting point is 1 gold coin, we can exchange it for 138.23611 copper coins, which we can in turn exchange for 54.66685 silver coins, and when we return to gold coins, we will have... 1.035390! In other words, we will have earned money solely by exchanging currencies.
Although from a theoretical point of view it is a very simple way to make money, in practice, currency arbitrage poses some difficulties: you must be able to identify such a situation and also consider the commission of the exchange house, in addition, the arbitrage must last long enough to be able to complete the cycle and a large enough amount of money must be invested to obtain significant returns from, usually, very small profit percentages.
Regarding the question of finding an arbitrage situation, famous traditional algorithms, such as the Bellmann-Ford or the Floyd-Warshall algorithm, are there to help. However, both of them conclude when they find an arbitrage situation, even if it is not the best possible one. Finding the best arbitrage, if any, among all possible currency exchanges is the task of combinatorial optimisation. And this is computationally very expensive for traditional computers; however, quantum computing and, in particular, quantum annealing, offer new and potentially more efficient tools to accomplish this task.
To exemplify this, let’s have a look at the results of the optimisation of arbitrage, in a situation with 5 currencies[1], using quantum annealing simulated through the tool offered by the Spanish initiative QuantumPath. The great contribution of this tool is that it allows us to implement the optimisation problem in a computer or quantum simulator solely on the basis of the mathematical expression to be optimised (see Fig. 2). Of course, this mathematical expression will have to take into account, among other things, the rate of change.
In this case, we used the "DWave Ocean Local Simulator" and after 1,438 minutes of compilation we obtained the results shown in Fig. 3.
We can see in this image that the change path that corresponds to the best existing arbitration is 1-5-3-4-1. Below is an image of the resolution of the problem in Fig. 4.
In this case, it turns out that if we start with the currency above, after completing the arbitrage we will have 1.00074, which is a profit of 0.074%.
Quantum annealing offers novel answers to problems of great relevance in economics. And this is a concrete example in the world of finance. The possibility of finding the optimal arbitrage or, alternatively, one that is very close, even considering a large number of currencies, is a very interesting potential application of this quantum computing scheme. Will quantum annealing make us rich? We are yet to see that.
[1] Rosenberg, G. (2016). Finding optimal arbitrage opportunities using a quantum annealer. 1QB Information Technologies Write Paper, 1-7.