Exchange Rate Arbiterage Detection
Here’s a little brainteaser to think about while commuting to work on the Greyhound bus! (that’s another story maybe for another post).
If you go to x-rates.com or Yahoo Currency Converter you can obtain a table of exchange rates for world’s major currencies. Here’s a sample:
| USD | U.K. £ | CAD | Euro | AU $ | |
| USD | 1.00000 | 2.05639 | 1.01142 | 1.48250 | 0.87440 |
| U.K. £ | 0.48629 | 1.00000 | 0.49184 | 0.72092 | 0.42521 |
| CAD | 0.98870 | 2.03316 | 1.00000 | 1.46574 | 0.86452 |
| Euro | 0.67454 | 1.38711 | 0.68225 | 1.00000 | 0.58981 |
| AU $ | 1.14364 | 2.35177 | 1.15671 | 1.69544 | 1.00000 |
* (USD to CAD element was changed from 0.98870 to 1.0 in the example below)
The data is essentially a matrix as follows (with a bit of rearranging and reducing the number of currencies):

C for Canadian Dollar
U for US Dollar
E for Euro
CU: price of 1 Canadian dollar in US dollars as reported in the table
UC: price of 1 US dollar in Canadian dollars as reported in the table

This matrix, in an efficient, arbitrage-free market, should simplify to:

Therefore, the test is to form the Foreign Exchange Matrix, and then calculate the following expression in Matlab, Excel, etc:
, where n is the number of rows in the FX table. (3 in the above example)
If the resulting matrix has non-zero elements, it is theoretically possible that arbitrage can happen. Note that “non-zero” is relative as it is unlikely that you get all zeros because of round off errors. But, dividing (the absolute value of) the biggest element by n gives you a good idea about the potential amount of arbitrage. For example, applying the formula to the sample data at the beginning of the text shows that the inconsistency in the table of rates is, more or less, about 0.678%. (Again, the sample table was tampered with for the sake of the example. Using the original data, the arbitrage potential was 0.00068%.)
I recommend that this formula be used for a quick test as opposed to a full diagnostic review of your FX table. There are definitely better and more elaborate ways of arbitrage detection and pinpointing what algorithm can make you the most amount of money. This post is only meant to show how a little bit of Linear Algebra can be used as a quick test of online data.
Also, the chances of making money this way is very low. That is because markets are quite efficient these days. Also, all FX trading accounts have a trading spread which is basically charging you a small premium every time you do a trade. This small amount is large enough to cover the arbitrage opportunity as detected above. If you know of a trading account that isn’t like that, I would love to know about them
Let me know what you thought of this post. Do I have what it takes to be a Quant!? If you’re interested in the spreadsheet that does the calculations, let me know.