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

Price vs. Reality #5

Open pegahcarter opened 5 years ago

pegahcarter commented 5 years ago
0xmythril commented 5 years ago

My 2cents:

You can't guarantee it, what you're discussing here is the concept of slippage. Manual execution traders would try to minimize this (and their performance would be judged based on how close they can get). Best you can do is use bid/ask data to construct your execution prices so that you already factor in the spread differential (instead of simply using the last price). But this makes it more complicated from a programming perspective.

On your second point, my suggestion is you could add in a trading cost parameter that you call "slippage" and that by default it would be 0% and then users can choose to opt to discount their execution price to charge this slippage e.g. 0.05%. Since either way you are just making assumptions and the value of slippage cost varies depending on many factors such as volatility in the market, liquidity at the specific exchange etc.

pegahcarter commented 5 years ago

@sushiparlour thanks for the feedback! I agree with you on both points. I think factoring in exchange liquidity would be out of the current project scope so I'll keep that idea on the sidelines for now. Do you have experience calculating slippage? I could probably translate the math to work with Python.