Bitcoin Arbitrage Exercise (extension)
This is an extension of my solution to the Bitcoin Arbitrage excercise. For each currency pair, two prices are given (one for each currency as a base) and their inverses are given to be different. In the first solution, we assumed that both quotations could be both bought and sold, leading to a duality arbitrage (different tradable prices for the same pair) and solved for triangular arbitrage in excess of the duality arbitrages.
In this solution we assume that the two prices implicitly form a bid/offer for each currency pair. For a given base currency the offer is determined to be the higher of (A) price against another currency and (B) the inverse of the reverse price, with bid being the lower price. In this case there is no duality arbitrage and any triangular arbitrage must be higher than the bid-offer cost of the transaction.
Triangular Arbitrage
A currency has no absolute value, only relative value against other assets/currencies. Triangular arbitrage occurs when the relative value of a currency towards two different assets does not match the relative value between those assets. Here we are assuming bid/offer spreads and each triangle is checked against both sides.
Bid/Offers calculated from inputs
(c) 2013 Ziggy Jonsson - Licence MIT - (source)