marchowardbegins / crypto-arbitrage-bot

A bot for detecting the most profitable arbitrage opportunities across hundreds of cryptocurrency exchanges and executing instant trades.
11 stars 5 forks source link

Determine arbitrage frequency #2

Open pegahcarter opened 5 years ago

pegahcarter commented 5 years ago

There's two strategies that come to mind:

  1. Strategy that waits 'X' seconds between validating next arbitrage pair

  2. Strategy that completes all arbitrage pairs for an exchange every 'X' units of time

marchowardbegins commented 5 years ago

If I understand Strategy #2 correctly it seems to have the advantage of polling all pairs vs. the linear method of Strategy #1. The time to validate pairs would eventually have to factor in the execution time since it wouldn't make sense to validate every second when it takes a minute to execute a trade. So we could start the validation period for an arbitrary period (60 secs. to begin with?) to at least have a working signaling bot. After which the work on the trade execution could be phased-in.

pegahcarter commented 5 years ago

Exactly. The appeal with Strategy #1 is that we can definitely say, "each ticker has their prices checked every 'X' seconds".

With Strategy #2, the tickers we query would have to depend on the tickers from a single exchange, so the downside is that we'd be querying the most common arbitrage pairs. From Strategy #2 we can say, "we check a different exchange every 'X' seconds".

Another appeal of Strategy #2 is that our rate of price checking for an exchange is constant, even if the exchange adds/removes trading pairs. With Strategy #1 we could still set a time frame where all pairs are queried in a certain amount of time, however we run the risk in the future that there will be too many arbitrage pairs to complete a full round of querying in the time frame. Technically we run that risk with Strategy #2, but since it's one exchange at a time we're not querying every single pair, so the risk associated with it is a lot lower.