On triangular arbitrage

hi there, fellows

i’ve been working on modelling triangular arbitrage, so that one can

  1. determine the set of coins he would accept to trade (given the inventory risk)
  2. estimate the max profit (assuming the whole initial capital is traded through) on all tradable combinations of accepted coins (from item 1)
  3. how to trade the above, in an algorithm.
    it includes pseudo code to express the profit conditions.

in case you decide to implement it, it’ll be my pleasure clarify its aspects to ease you burden and speed up your dev time.

i believe triangular arbitrage allows the trader to profit from more popular coins that trade with a spread too tight for market making, still on a quasi market neutral trade.

the article is available for download in the link bellow.

best & thanks.
fernando a. bender

1 Like

Thanks, this is a good overview of triangular arbitrage! We’re pretty familiar with that strategy, and I think it would pretty straightforward to add it to Hummingbot since we already have the regular arbitrage strategy.

I believe we would just have add a config question like “Do you want to run the bot across 2 or 3 trading pairs?” and prompt for the 3rd trading pair if users pick the latter. Afterwards, I think the logic of the arbitrage strategy mostly still applies.

We have a lot of other work in progress right now, but if there’s significant interest we could probably add this to the backlog. Are others interested in running a triangular arbitrage bot?

1 Like

hi there, feng. thanks for the reply.

the point a develop in the article is precisely more than 3 pairs.
i agree with you that it is straightforward 3 pairs.
but that limits the possibilities.
i’m sure you agree that there is much more money to be made other than what, say, ETH, BTC, LTC could yield.
this is why i suggest to specify the set of coins that one would like to consider for triangular arb.
then, the algo would split this combinations in tradable pairs and respective triples.
then, it’ll check for profits in each, in both senses (direct and reverse)
then it’ll rank them and trade the most profitable at that time.
i believe this maximizes the profitability of the operation by ensuring that, amongst the set of coins a trader would agree to arbitrage between their pairs, to be doing so with the most profitable ones.

thanks and best.
fernando a. bender

I see - yup, I agree that you could create this kind of strategy. I agree that this is more powerful than a normal triangular arb strategy and it makes sense for folks who want to maximize arbitrage opportunities.

As Hummingbot, our philosophy is to focus on “basic” strategies and show users how to customize the codebase to build logic like this. That’s why we will probably add triangular arb in the future, but we will focus more on adding exchange connectors and improving architecture and documentation to allow for greater customization.

In principle yes. The main problems for tri-arbitrage were that it was profitable for a short period about two years back, and then as more people moved into the space, and exchanges became better at smoothing market inefficiencies, the profit levels have steadily decreased, and few people are profitably running this strategy at the moment. The addition of futures as a way of hedging has further contributed to a decrease in profitability. There are a couple of bots available on the retail market for this, but apart from a very few people, these generally are not that profitable compared to other ways of using the same assets. The relatively low volumes and liquidity on many exchanges is also contributing to the problem. It would certainly be interesting to try this strategy with Hummingbot, particularly if it could be integrated with a smart way of adaptively basing position sizes based on the shape and depth of order books – there is nothing more demoralising for the tri-arber than seeing their pile of whatever base currency get slowly and inexorably converted into a multitude of very small piles of low-sat coins that become difficult to sell, particularly while the alt market remains in a state of overall decline. But, and just maybe, running this strategy in Hummingbot could bring this as a strategy back to some level of profitability. One area that I did look at a couple of years back was higher level arbitrage, and in the fee-free GDAX/Coinbase Pro days, it was certainly the case that quad-arb was profitable. I wonder whether an arbitrary dimensional (quad, quin) intra-exchanger arbitrage tool might be possible with fee rebate exchanges, as quad and quin do not (contrary to what may be the general expectation) arbitrage do >not< always require the same speed of execution as tri-arb, and could benefit from maker fees? Now that would really be something unique for Hummingbot. But like all good things, I suspect that it is way too difficult to create a general purpose tool like this … or ???

That’s really helpful info - thanks. My intuition is that we’re better off making it easier for developers to use Hummingbot to design whatever strategies they want, rather than creating for more complex strategies.

It’s a bit tricky navigating this tradeoff between ease of use and performance/configurability, and we’re open to suggestions on how to make Hummingbot easy to use for the masses, but also powerful for the advanced algo traders and developers.