Pages:
Author

Topic: I've built software for crypto arbitrage, and I'd love your feedback (Read 756 times)

jr. member
Activity: 88
Merit: 9
Hey everyone, I've got another update for anyone interested in crypto arbitrage solutions!

Coygo Terminal (the app mentioned above) now supports a fully automated bot strategy for intra-exchange triangular arbitrage. The bots establish real-time websocket connections directly between your machine and each exchange for the lowest possible latency, and all orders are submitted right from your machine, our servers never have access to your accounts. We support most major exchanges right now so there's plenty of combinations of markets to try, and we're always looking to support more. I'd really love to hear what everyone thinks about the new triangular arbitrage bot. You can also try it for free if you'd like by starting a free trial.

If you wanna read more in-depth info on our new triangular arbitrage crypto bot strategy, I've put together a blog post for you: Master Crypto Triangular Arbitrage With Coygo's New Trading Bot (https://www.coygo.app/blog/posts/crypto-trading-bots-with-coygo-terminal-simple-secure-and-fast/)
jr. member
Activity: 88
Merit: 9
Great, good to know that. I think that major factor in this (considering constant computing power) is orderbook depth that bot is subscribing to (i guess that bot is doing calculations every orderbook change? ). Am I right? Are you planning to support adjustable depth?

Not all exchanges allow subscribing to a specific order book depth and for the most part the approach I've taken is to use the solution that can be applied in a generic way to all supported exchanges, so that it's easier to support all exchanges with new features and strategies.

So to answer your question, the bot will subscribe to the entire order book (or everything the exchange will share, sometimes they limit the subscription to like 500 levels). Then instead of running on every order book change (which can be hard because some exchanges batch them together in subscriptions, some don't), you can instead choose how often the bot will re-run its calculations by specifying a "Calculation interval" in milliseconds in the bot configuration. So for example with a 25ms "Calculation interval" configuration, the bot will calculate spreads every 25ms and submit orders if it finds a scenario matching your configured criteria.
legendary
Activity: 2156
Merit: 1622
An arbitrage bot doesn't need OHLCV, that was just an example for the sake of discussing how a bot would handle avoiding API rate limits.

Got it.

The platform has been built with plans to support a number of different types of bots (spatial arbitrage, triangular arbitrage, four point arbitrage, scalping, etc) so it supports a number of real-time data feeds for bots to use.

For every strategy that you bring OHLCV is not needed. Maybe except scalping but as long as it is completely different strategy for completely different clients i doubt that it will even be in use of this bot but... considering current PCs computing power i also doubt that it is a problem that it was implemented.

On a standard desktop I'd estimate you may be able to run a bot against a max of maybe 10-20 or so trading pairs, depending on a number of factors.

Great, good to know that. I think that major factor in this (considering constant computing power) is orderbook depth that bot is subscribing to (i guess that bot is doing calculations every orderbook change? ). Am I right? Are you planning to support adjustable depth?
jr. member
Activity: 88
Merit: 9

Why you need OHLCV for? Isn't it useless for arbitrage bot?


An arbitrage bot doesn't need OHLCV, that was just an example for the sake of discussing how a bot would handle avoiding API rate limits. The platform has been built with plans to support a number of different types of bots (spatial arbitrage, triangular arbitrage, four point arbitrage, scalping, etc) so it supports a number of real-time data feeds for bots to use.



Will such bot perform well if you want to arbitrage on many trading pairs (like 50)?


As for performance, one unique thing about this platform is that your machine establishes a real-time connection to each exchange, and a full replica of each order book is maintained right on your machine. This allows us to provide the lowest possible latency since there is no middle man, and it allows us to run bots while your API keys never leave your machine and never touch our servers, but it also means that your machine's resources (CPU and memory) are being used to keep track of order books and run bot calculations. So your machine's resources will be a limiting factor. A very powerful machine could run against more trading pairs with a faster calculation interval than a weaker machine. On a standard desktop I'd estimate you may be able to run a bot against a max of maybe 10-20 or so trading pairs, depending on a number of factors.
legendary
Activity: 2156
Merit: 1622
You probably don't wanna be using an exchange that doesn't even offer a websocket connection tbh. Every single major exchange supports it, so this is a non issue.

I know few that still uses Rest API but you are right. Majority of them are using websocket (at least big exchanges) and thanks to that rate limits for order books are not an issue.

This was just an arbitrary example of a bot configuration that I had used. You can let bots run forever if you want, you also have the option to set a time limit if desired.
I don't think that this utility is worth to add to bot (time limit). I doubt that anyone will use it.

and OHLCV feed for a few different trade pairs),

Why you need OHLCV for? Isn't it useless for arbitrage bot?

Will such bot perform well if you want to arbitrage on many trading pairs (like 50)?
jr. member
Activity: 88
Merit: 9
Quote from: cryptovigi
Websocket subscribe ... an interesting solution, unfortunately not each exchange supports this solution...

You probably don't wanna be using an exchange that doesn't even offer a websocket connection tbh. Every single major exchange supports it, so this is a non issue.

Quote from: cryptovigi
Why 48 hours or is it a limit?
This was just an arbitrary example of a bot configuration that I had used. You can let bots run forever if you want, you also have the option to set a time limit if desired.

Quote from: cryptovigi
I do not really understand how it is possible that API query limits are not a problem websocket subscribes has also limitations for example binance 5 messages per sceond

WebSocket connections have a limit of 5 incoming messages per second.
...
A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.

There are two reasons this isn't an issue:
1- A trading bot will only have to subscribe to data once. So the bot starts, it sends a subscribe websocket message to the exchange to subscribe to an order b ook feed, and then it no longer has to subscribe again.
2- Limits are just that, a limit. As long as you adhere to the limit you'll be fine. Even if the bot does need to subscribe to more data feeds, the application enforces a short wait between subscribe calls to ensure that it's adhering to each exchange's API limits by not subscribing to too many at once. So if the bot did have to make a number of subscribe calls (say it needs to subscribe to the order book feed, trade feed, and OHLCV feed for a few different trade pairs), it would spread these out by waiting X seconds between subscribe calls. The bot would just wait until all the data is loaded, even if it ends up waiting 20-30 seconds for all data feeds to be established. Once they're established, no more subscribe calls will need to be made.

hero member
Activity: 714
Merit: 611
There is a single REST call to get the initial snapshot of the order book, and a single websocket subscribe call to subscribe to level 2 order book updates.
...

Websocket subscribe ... an interesting solution, unfortunately not each exchange supports this solution...

...
A bot can subscribe to two real-time order books (for example Kraken BTC-USD and Coinbase Pro BTC-USD), and calculate spreads every 25ms over the course of 48 hours with only two REST calls and two websocket subscribes. API limits truly aren't an issue. ...

Why 48 hours or is it a limit?
I do not really understand how it is possible that API query limits are not a problem websocket subscribes has also limitations for example binance 5 messages per sceond

Quote
WebSocket connections have a limit of 5 incoming messages per second.
...
A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md
jr. member
Activity: 88
Merit: 9
But you need to ask for order book 2400 times per minute per trading pair and as I know public asks has rate limits too. On some exchanges even more strict than private asks (f.e create order). Is your bot using some sort of proxy to bypass this hiding ip?

Nope you don't actually, the application uses real-time websocket feeds for all order books. There is a single REST call to get the initial snapshot of the order book, and a single websocket subscribe call to subscribe to level 2 order book updates. The application maintains a full replica of the order book in local memory, applies real-time updates to that, and runs all calculations off of that.

A bot can subscribe to two real-time order books (for example Kraken BTC-USD and Coinbase Pro BTC-USD), and calculate spreads every 25ms over the course of 48 hours with only two REST calls and two websocket subscribes. API limits truly aren't an issue. The app also polls for your wallet balances on an interval (roughly every 90 seconds), and it includes an application-wide staggering/delay of ALL exchange API calls (excluding managing orders) to avoid rate limits when necessary.

I would be VERY impressed if you could get yourself rate limited using the app  Wink
legendary
Activity: 2156
Merit: 1622
Rate limits won't come into play unless you're bot is attempting to submit multiple orders consecutively due to finding spreads very close to each other. All real-time data being used by the bot is done via public websocket connections, so the bot isn't making any REST calls until it's time to submit orders. Since most rate limits are for within a certain time period, i.e. X calls within 60 seconds, your bot would have to find a lot of spreads within 60 seconds to trigger a rate limit. This is still in beta though, part of the beta will involve testing these things and collecting data on how bots are working for our users. We'll see!

But you need to ask for order book 2400 times per minute per trading pair and as I know public asks has rate limits too. On some exchanges even more strict than private asks (f.e create order). Is your bot using some sort of proxy to bypass this hiding ip?
jr. member
Activity: 88
Merit: 9
I don't understand why you have "exchange to buy on" and "exchange to sell on". If you are arbitrage trader it does not matter where you buy and where you sell.

This is only for the first strategy available: "Arbitrage: Two exchanges, no transfer, one direction". It's a very basic strategy that will only watch one trade pair, and only buy on one exchange and sell on the other. More strategies are coming soon, now that the framework is in place it will be much less effort to add more strategies.

And how about "triangular arbitrage"

A triangular arbitrage strategy is already in development and will be available some time soon Smiley We're also experimenting with "deep arbitrage" (inspecting multiple levels of the order book instead of just the top)

On all exchanges? I'm asking because all of them have different rate limits.

Rate limits won't come into play unless you're bot is attempting to submit multiple orders consecutively due to finding spreads very close to each other. All real-time data being used by the bot is done via public websocket connections, so the bot isn't making any REST calls until it's time to submit orders. Since most rate limits are for within a certain time period, i.e. X calls within 60 seconds, your bot would have to find a lot of spreads within 60 seconds to trigger a rate limit. This is still in beta though, part of the beta will involve testing these things and collecting data on how bots are working for our users. We'll see!
legendary
Activity: 2156
Merit: 1622
Ohh its nice to see that you automated your bot. Now we can talk Smiley I don't understand why you have "exchange to buy on" and "exchange to sell on". If you are arbitrage trader it does not matter where you buy and where you sell. You take care only to have high enough spread to cover fees and provide extra profit. You want to buy on x and sell on y and even instantly after if there is good situation buy on y and sell on x to balance both wallets and repeat trade after trade. IMO it should be more like "tick the exchanges that you have liquidity on (exchanges on which you have coins/tokens that you want to arbitrage". If there is kraken/bittrex opportunity bot is taking it, if there is bittrex/binance opportunity bot takes that.
Bot could compare prices on all ticked exchanges and do something like:

take min ask out of all ticked exchanges and compare with max bid out of all ticked exhcnages and perform trade if spread >x%

that can find and react to arbitrage spreads within 25 milliseconds!

On all exchanges? I'm asking because all of them have different rate limits.

well given the number of exchanges and markets we support there is plenty of room for traders to not step on each other's toes. We support over 1,000 different combinations of trade pairs and exchanges.

What exchanges?

And how about "triangular arbitrage"
legendary
Activity: 2674
Merit: 1226
Livecasino, 20% cashback, no fuss payouts.
The problems you identified for successful arbitraging are even bigger than you said actually and this is why it's really not such a simple or straightforward thing when we talk about arbitrage trading. I even tried it myself. Too slow or too inefficient to really make a lot.

Have you considered doing something for P2P?
jr. member
Activity: 88
Merit: 9
Hey everyone, I wanted to provide an update!

We've taken the previous arbitrage experience and bundled it into a fully automated crypto arbitrage bot that can find and react to arbitrage spreads within 25 milliseconds! You can read a blog post about it here: https://www.coygo.app/blog/posts/crypto-trading-bots-with-coygo-terminal-simple-secure-and-fast/.

Someone mentioned that only 2 or 3 traders can use this app because they'll be competing and this solution won't work because of that....well given the number of exchanges and markets we support there is plenty of room for traders to not step on each other's toes. We support over 1,000 different combinations of trade pairs and exchanges.

(Trading bots are currently in beta, for the time being all bots are run in test mode and don’t submit real orders to exchanges. We need your feedback to make the best possible solution for you!)




Why use Coygo Terminal’s crypto trading bots?

Don’t trust the cloud
Your API keys are only stored on your machine, not our servers. All orders are submitted directly from your machine. Coygo’s servers never have access to your accounts.

Low latency
Real-time websocket data feeds connect your machine directly to each exchange to provide the fastest possible access to order book and trade data, our servers don’t act as a middleman.

Test your strategy with simulated trading
Run and tweak your bots in Test Mode to simulate a strategy and compare different configurations without submitting real orders to exchanges.

High-speed crypto arbitrage bots
Configure and run arbitrage bots to find and act on Bitcoin & crypto arbitrage opportunities within 25 milliseconds.

Predefined & configurable crypto trading bot strategies
Bots trade using a specified strategy which you can configure to your liking. For our initial release we’ve included one strategy, with more currently in development. Expect a crypto triangular arbitrage trading bot strategy soon!



We would LOVE any feedback you've got!
jr. member
Activity: 88
Merit: 9
Max order amount is not so important IMO because if trigger conditions will remain bot will perform second trade, third and so on and in fact will do the same as without this parameter (only longer). It is only a parameter to set if you don't trust bot (what is understandable) and you are scared that bot will do losing trade with whole wallet because of delay in api communication (hmm... it makes it important than Smiley ).

If I was doing it for me I would set it like that:

(BTC/USDT arbitrage example)

conditions on one of exchanges  -  spread parameter
95% of wallet in BTC, 5% in USDT - perform trde if spread >5x%
80% of wallet in BTC, 20% in USDT - perform trade if spread >2x%
50 % of wallet in BTC, 50% in USDT - perform trade with spread >x%
20% of wallet in BTC, 80% in USDT - perform trade if spread >2x%
5% of wallet in BTC, 95% in USDT - perform trde if spread >5x%

Or I would put it in parabolic/linear function to achieve better performance (better adaptation of the bot to the conditions) with less code.

This should help optimate profit because of limited wallet supply and no withdrawals. You will not sell all BTC on one exchange for 1% profit when few seconds after there is 2% profit conditions. This will somehow work as max order parameter because if spread>x% bot will perform trade and wait for bigger spread or wallet rebalance (it will not go all in one trade).

Thanks for the ideas. I hadn't thought of allowing different conditions depending on current wallet balances. And yes the "max order amount" is mostly about user confidence, if users don't want to fully trust an automated system with all of their funds they can set a max order amount and see how it goes.

I would also code "inside 1 exchange arbitrage system" (doing instant circles f.e. USDT-BTC-ETH-USDT).

We're currently exploring triangular arbitrage (inside 1 exchange), it's definitely on the radar for a future release! "Deep" arbitrage analysis is something we're exploring as well, where you look at more than just the top of the book. Sometimes incurring slippage and filling the top 2 or 3 orders can lead to a profitable spread if your order is large enough, when just the top ask/bids wouldn't be profitable.

There is a bitter fact about making use of arbitrage things, are you sure how effective your tools will be?

Price gaps are short living. Only profitable to early finders. So, if you sell your tool to some 100 traders, only 2 or 3 may get profits.
If a whale find the gap in price levels across exchanges, I am sure only that whale could make use of that arbitrage opportunity.

Simply, arbitrage opportunity is based on TIME and VOLUME unlike spotting a trend which works for all the traders who find and join. So, if your tools works perfect to spot a price gap, almost 90% of your subscribers will blame you for INEFFICIENT SIGNAL as the more they take to trade, the faster the prices to converge.

After all this, some or more exchanges are not processing withdraw instantly.

You'll never make money off arbitrage if you're trying to withdraw between exchanges, this is about submitting parallel buy/sell orders on two exchanges simultaneously while holding balances on both.

There are actually a TON of arbitrage opportunities every day if you can be fast enough to act on them. We could have 1,000 traders using our platform, but we also support 10+ exchanges and 400+ trading pairs. There's plenty of room between combinations of exchanges and trade pairs for a number of traders to compete and make a profit. It's a great tool when the candlesticks aren't moving much for the day and you still want to day trade.
legendary
Activity: 2156
Merit: 1622
After all this, some or more exchanges are not processing withdraw instantly. They do batch processing withdraws for security and cost effective reasons. Even USDT kind of things are available in support of arbitrage trading unlike what we had some 5 or 7 years back, there could be only 50% chances to remain effective when we are moving assets across exchanges. People are sharing like they do keep funds on more than one exchanges to get rid off withdraw delays but not sure about their ROI with respect to all the combined funds across multiple exchanges.

We are talking about no withdrawal arbitrage.

People are sharing like they do keep funds on more than one exchanges to get rid off withdraw delays but not sure about their ROI with respect to all the combined funds across multiple exchanges.

That's where you have advantage over others. You feel ok with holding ZIL ? You are arbitraging ZIL. You are ok with holding DOGE? You are arbitraging doge or even using DOGE/ZIL trading pair if you find it on one of exchanges. This is really huge market and there is for sure space for more than 100 customers considering amount of trading pairs, exchanges, attitude of people to hold certain altcoin.

You can also use it to increase profit from your regular altcoin trading. You see buy opportunity on ALT/BTC trading pair? You open trade and in the same moment start arbitrating this altoin across few exchanges to increase it's amount. You want to close trade? You turn off arbitrage bot and sell on exchange where it actually is.
hero member
Activity: 3122
Merit: 672
www.Crypto.Games: Multiple coins, multiple games
There is a bitter fact about making use of arbitrage things, are you sure how effective your tools will be?

Price gaps are short living. Only profitable to early finders. So, if you sell your tool to some 100 traders, only 2 or 3 may get profits.
If a whale find the gap in price levels across exchanges, I am sure only that whale could make use of that arbitrage opportunity.

Simply, arbitrage opportunity is based on TIME and VOLUME unlike spotting a trend which works for all the traders who find and join. So, if your tools works perfect to spot a price gap, almost 90% of your subscribers will blame you for INEFFICIENT SIGNAL as the more they take to trade, the faster the prices to converge.

After all this, some or more exchanges are not processing withdraw instantly. They do batch processing withdraws for security and cost effective reasons. Even USDT kind of things are available in support of arbitrage trading unlike what we had some 5 or 7 years back, there could be only 50% chances to remain effective when we are moving assets across exchanges. People are sharing like they do keep funds on more than one exchanges to get rid off withdraw delays but not sure about their ROI with respect to all the combined funds across multiple exchanges.
legendary
Activity: 2156
Merit: 1622
  • Minimum spread percent
  • Minimum possible profit
  • Max order amount

Max order amount is not so important IMO because if trigger conditions will remain bot will perform second trade, third and so on and in fact will do the same as without this parameter (only longer). It is only a parameter to set if you don't trust bot (what is understandable) and you are scared that bot will do losing trade with whole wallet because of delay in api communication (hmm... it makes it important than Smiley ).

If I was doing it for me I would set it like that:

(BTC/USDT arbitrage example)

conditions on one of exchanges  -  spread parameter
95% of wallet in BTC, 5% in USDT - perform trde if spread >5x%
80% of wallet in BTC, 20% in USDT - perform trade if spread >2x%
50 % of wallet in BTC, 50% in USDT - perform trade with spread >x%
20% of wallet in BTC, 80% in USDT - perform trade if spread >2x%
5% of wallet in BTC, 95% in USDT - perform trde if spread >5x%

Or I would put it in parabolic/linear function to achieve better performance (better adaptation of the bot to the conditions) with less code.

This should help optimate profit because of limited wallet supply and no withdrawals. You will not sell all BTC on one exchange for 1% profit when few seconds after there is 2% profit conditions. This will somehow work as max order parameter because if spread>x% bot will perform trade and wait for bigger spread or wallet rebalance (it will not go all in one trade).

I would also code "inside 1 exchange arbitrage system" (doing instant circles f.e. USDT-BTC-ETH-USDT).
jr. member
Activity: 88
Merit: 9
Quote
Tool looks great and for sure is useful but you automatized 95% of work and remaining 5% is as easy/hard as those 95% was.

Quote
Just do one step forward, run it as 24/7 automatic bot and leave your company

You've caught on to my plan  Wink Everything that's been built here has been w/the end goal of being able to set up your parameters and let the software automatically submit your arbitrage trades for your. With real-time low latency ask/bid data, real-time slippage detection, and automatically setting order amounts, all of the pieces are in place. The hope is to get that released soon! And unlike most other options, this will allow you to run an arbitrage bot w/an easy-to-use UI without your API keys ever leaving your machine, as this is downloadable software and API keys are only stored encrypted on your hard drive.

I'm curious, are there any other parameters or configurations you'd want to see when setting up your triggers for automatically submitting arbitrage trades? So far I'm looking at these config parameters:
  • Minimum spread percent
  • Minimum possible profit
  • Max order amount
legendary
Activity: 2156
Merit: 1622
This should be a 24/7 bot that do it all by itself without human hand (in fact that's how majority of arbitrage is done nowadays). Don't get me wrong. Tool looks great and for sure is useful but you automatized 95% of work and remaining 5% is as easy/hard as those 95% was.

Just take a look at that:

1- earning opportunity
2- human reaction time (if he is in front of PC at all)
3- human doing click click clik to do perform trade
4- human is human and just made mistake, money lost, opportunity is gone (or was gone long ago between point 1 and 2 or 1 and 3)

instead of:
1 - earning opportunity
2 - 0.1 - 1 sec after trade is done 24/7

After I've done my first trading bot that works 24/7 (liquidity provider) i just can't imagine how people doing things like that manually (even with tools).

But bots like that are not an object that somoene wants to sell (at least i would never sell my bot because it just works and earns)

Quote
So instead I've been primarily focusing for solving arbitrage when you already hold assets on two exchanges and submit accompanying buy and sell orders in parallel on each exchanges

That's the only right way. There is no other way of doing it correct, profitable and with minimum risk. Good work with choosing this system.

Quote
Order sizes:
Largest w/o slippage
This is great

Just do one step forward, run it as 24/7 automatic bot and leave your company Smiley
jr. member
Activity: 88
Merit: 9
bump in hopes of getting some feedback from someone who knows what they're doing w/arbitrage or is interested in it!
Pages:
Jump to: