In a typical Bitcoin exchange, they have multiple cryptocurrencies listed, such as Bitcoin, Ripple, Litecoin etc. It is possible to exchange one instrument to another, for example, $9000 USD = 1 Bitcoin, or 1 Litecoin = 0.017 Bitcoin...etc. For a particular exchange, Bitfinex, I want to get all the cycles possible to transfer funds throughout the exchange. For example, you always start at USD --> Bitcoin --> Litecoin --> USD.
Some possible cycles are:
USD --> BTC --> USD (buy bitcoin and sell it back for USD again)
USD --> LItecoin --> Bitcoin --> Ripple --> USD (Buy litecoin, exchange it for bitcoin, exchange bitcoin for Ripple, and exchange Ripple back to USD).
Once all these cycles are found, I want the most profitable route, that will generate the most profit.
This route needs to account for two things:
1) The trading fee on each trade (0.2%)
2) When you sell an instrument, you sell to the buyer that is willing to purchase at the the highest price (best bid in order book). When you buy an instrument, you buy it from the cheapest seller (best ask in order book).
The APIs for the orderbook in the exchange is publicly available. You don't need experience in Bitcoin trading, but if you do, it's a plus.
I've written the code for a different exchange ([login to view URL]), but I don't have the time to code it for Bitfinex.