Trading Bot on Bybit Exchange: Greedy Recursive Arbitrage

Strategy: Rebalance investment allocation between tokens through complex arbitrage directions. What is an arbitrage direction? Complex arbitrage occurs within a circle of tokens. By the nature of a circle, money can return to the initial token after a sequence of transactions, where the starting token can be any token in the circle. There are two directions to return to the initial token: forward and backward. If one direction is profitable, then the other is definitely not profitable. Let's define an arbitrage circle as a sequence of vectors, where each vector has its profitable direction. Technically, a vector is a trading pair with a direction/side and circle ROI%. A set of profitable circles can be broken down into profitable vectors. Some vectors repeat across different profitable circles. Let's find the best vectors! What does "best" mean? It is a combination of the frequency of appearing in different profitable circles and the ROI% of the circle to which it belongs. I found that a weighted-mean metric is effective for measuring both criteria: - Risk - Profit Executing only the best vector trades provides guarantees based on complex arbitrage analysis. There are different strategies for using the best profitable vectors in the market. My bot executes vectors on pairs where I have money allocated. An interesting aspect is that money allocation is managed by executing vectors from the first token I deposit to the exchange. Money splitting and joining happen automatically according to market price differences. This strategy is also good for holding investments. There were some days when I didn't find profitable vectors from ETH. I made 0 trades, and it was the right approach because, due to market conditions, the best approach was to hold ETH.

1 comments

This is interesting! Is this on Github or, if not, care to share the implementation or even pseudocode?