Reidmcc / rockfish

Rockfish is an arbitrage bot for the Stellar Decentralized Exchange (SDEX)
MIT License
71 stars 23 forks source link

Make pathFinder mode able to use n-length paths #9

Open Reidmcc opened 5 years ago

Reidmcc commented 5 years ago

Describe the solution you'd like

I want to have pathFinder check n-length paths, instead of hard-coded three-asset paths as it does now.

Right now it does this path structure:

XLM :arrow_right: USD :arrow_right: EUR :arrow_right: XLM

With this feature it could also do, for example:

XLM :arrow_right: USD :arrow_right: EUR :arrow_right: CNY :arrow_right: XLM

Describe alternatives you've considered This would be an adaptation of the n-path code that pathRequester already has; pathRequester itself was the alternative to pathFinder's current behavior but the rest of pathRequester didn't perform well.

Requirements

ilyacherevkov commented 5 years ago

When I worked on my own triangular arbitrage bots, I implemented recursive algorithm to build any N-length sequence.

But then... I realised, it doesn't have any sense. All you need is 2 and 3 length sequences, because >=3 is just derivatives of 3

ilyacherevkov commented 5 years ago

But since Lumen allows N-length payment transactions, this could make sense to insta-capture additional margin...

My bots on waves dex were exposed to a great risk in 4+ steps transactions, because most of the time I ended up stuck in some low-liqudity coin, this may not be the case with Lumen.

Reidmcc commented 5 years ago

@ilyacherevkov yeah, it's the instant path-payment method that makes >3 step paths worth considering; risk stays at zero regardless of path length.