Bitcoin Forum
May 04, 2024, 01:39:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 [All]
  Print  
Author Topic: I've built software for crypto arbitrage, and I'd love your feedback  (Read 735 times)
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
June 01, 2020, 10:30:59 PM
 #1

Hey everyone,

I've been working on arbitrage tooling for my company's crypto trading software called Coygo Terminal (https://www.coygo.app/), and I'd really love to hear feedback from the community of traders here. Does this solve the right problems? Could it be better? Please let me know. (Btw it's free for anyone to try, so if you're interested I'd love to hear what you think after trying it for a few days).

NOTE: In general the tool I've been working on is NOT for the type of arbitrage where you buy on one exchange, transfer to another, then sell, although we do solve for that. It's simply way too risky because of transfer times, transfer fees, and the spread probably won't exist anymore once it's arrived. 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. If arbitrage without transferring between exchanges sounds confusing, please see the section "Strategy 2: Hold balances on both exchanges and submit accompanying trades" in my blog post here https://www.coygo.app/blog/posts/how-to-profit-from-crypto-arbitrage-trading/


The problems I've identified w/being successful at arbitrage

  • 1. Calculating spreads across multiple exchanges
  • 2. Finding spreads that are profitable after fees
  • 3. Submitting buy and sell orders in parallel as quickly as possible to capitalize on a spread
  • 4. Transferring between exchanges is cumbersome and slow

The solutions

1. Calculating spreads across multiple exchanges

In reality you can't calculate spreads by hand across multiple exchanges, order books change too fast and spreads might only appear for a second or less. My solution to this problem is to establish a real-time websocket connection between your machine and each exchange (no server acts as a middle man so this provides the lowest possible latency), maintain a fully updated order book in real time, and use that to calculate spreads across any selected exchanges. You'll notice that the spread is shown in %, as well as an estimated USD profit (before fees) to get an idea of how much actual profit can be made.





2. Finding spreads that are profitable after fees

Every exchange has different fees, and even different users on the same exchange might have different fees. So to account for this, you can filter to only consider spreads above a certain percentage ("Min. profitable spread") or above a possible USD profit ("Min. possible profit") to be considered profitable. Say for example your fees are 0.1% on both exchanges, you may want to only filter for spreads > 0.3% to ensure you'll always be finding spreads that are profitable after fees. To solve for this, Coygo Terminal allows you to set filters for what you consider to be a profitable spread.




3. Submitting buy and sell orders in parallel as quickly as possible to capitalize on a spread

Capitalizing on arbitrage spreads is all about speed, as they may only exist for less than a couple of seconds. Manually entering the order amounts and rates is simply too slow to be reliable when a spread only exists for a second. So Coygo Terminal's One-Click Trading interface helps make configuring and submitting your orders as fast as possible in the following ways:

Rates: Coygo Terminal will automatically set your order rates to the current ask and bid, updating in real-time whenever the order book changes. You'll never need to set the rate yourself.

Order sizes The software has three options to help maximize profit without incurring slippage and submit orders as quickly as possible by pre-configuring your order sizes:

  • Largest w/o slippage— Automatically sets both accompanying buy and sell orders to the largest order amount possible without incurring slippage, updating on every order book change.
  • Limit to max available — Limits order sizes to what’s available in your wallets on either exchange.
  • Set max amount — Allows you to set a maximum order size amount. Order amounts will never be set above this threshold.

The software will also indicate in real-time if either buy or sell order amount is large enough to incur slippage so you'll never encounter slippage accidentally.

With your orders pre-configured and updating each time the order book changes, when a profitable spread appears you can simply click "Submit buy & sell orders" and submit accompanying orders to each exchange in parallel.




4. Transferring between exchanges is cumbersome and slow

Transferring crypto kind of sucks, let's be honest. You have to log into both exchanges, get the deposit address from one, type/paste it into the sending address form on the exchange that's sending it, you need to double check to make sure it's correct, and you don't really have any indication of the actual dollar amount that's being transferred.

When viewing a pair between exchanges, you can use the Rapid Transfer tab to transfer crypto between wallets at each exchange. The wallet address is automatically retrieved using the exchange's REST API so you don't need to type it in yourself, and the estimated USD value of the amount being transferred is shown so you have a better idea of how much you're actually sending. And of course below you can find a list of all pending and past transfers, so you can keep track of when it's completed, all without leaving the arbitrage interface.





What do you think?

That's it, if you've read this far I would really love to hear your thoughts! Crypto arbitrage is not as easy as it used to be, but there is a lack of good tooling out there to help regular traders even attempt arbitrage so we're trying to make it more accessible for beginners and pros alike. Profitable spreads absolutely do still exist, if you're persistent and spend the time to find the right pairs there is definitely money to be made. Some days it's on the big markets like ETH-BTC, some days it's on the smaller markets like ALGO-BTC, but the opportunities are there. It's not like the spreads that existed in 2015 and 2016 but every day I've consistently seen spreads with a possible profit of $10, $30, and more. Arbitrage can be a great tool for day traders when the markets aren't making big movements up or down.

If you want to read more about Coygo Terminal's arbitrage tooling you can see my blog post "Coygo Terminal's Arbitrage 2.0: Master Cryptocurrency Arbitrage" https://www.coygo.app/blog/posts/coygo-terminals-arbitrage-2-0-master-cryptocurrency-arbitrage/

If you want to learn more about how crypto arbitrage works I'd recommend my blog post "How to profit from crypto arbitrage trading" https://www.coygo.app/blog/posts/how-to-profit-from-crypto-arbitrage-trading/










Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714829961
Hero Member
*
Offline Offline

Posts: 1714829961

View Profile Personal Message (Offline)

Ignore
1714829961
Reply with quote  #2

1714829961
Report to moderator
1714829961
Hero Member
*
Offline Offline

Posts: 1714829961

View Profile Personal Message (Offline)

Ignore
1714829961
Reply with quote  #2

1714829961
Report to moderator
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
June 05, 2020, 05:23:38 PM
 #2

bump in hopes of getting some feedback from someone who knows what they're doing w/arbitrage or is interested in it!
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
June 06, 2020, 05:25:41 PM
Last edit: June 06, 2020, 05:39:45 PM by Tytanowy Janusz
 #3

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
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
June 06, 2020, 07:30:27 PM
 #4

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
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
June 07, 2020, 06:58:50 AM
Merited by stompix (1), LeGaulois (1)
 #5

  • 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).
justdimin
Hero Member
*****
Offline Offline

Activity: 2996
Merit: 670


www.Crypto.Games: Multiple coins, multiple games


View Profile
June 07, 2020, 07:35:55 AM
 #6

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.

█████████████████████████
███████▄▄▀▀███▀▀▄▄███████
████████▄███▄████████
█████▄▄█▀▀███▀▀█▄▄█████
████▀▀██▀██████▀██▀▀████
████▄█████████████▄████
███████▀███████▀███████
████▀█████████████▀████
████▄▄██▄████▄██▄▄████
█████▀▀███▀▄████▀▀█████
████████▀███▀████████
███████▀▀▄▄███▄▄▀▀███████
█████████████████████████
.
 CRYPTOGAMES 
.
 Catch the winning spirit! 
█▄░▀███▌░▄
███▄░▀█░▐██▄
▀▀▀▀▀░░░▀▀▀▀▀
████▌░▐█████▀
████░░█████
███▌░▐███▀
███░░███
██▌░▐█▀
PROGRESSIVE
      JACKPOT      
██░░▄▄
▀▀░░████▄
▄▄▄▄██▀░░▄▄
░░░▀▀█░░▀██▄
███▄░░▀▄░█▀▀
█████░░█░░▄▄█
█████░░██████
█████░░█░░▀▀█
LOW HOUSE
         EDGE         
██▄
███░░░░░░░▄▄
█▀░░░░░░░████
█▄░░░░░░░░█▀
██▄░░░░░░▄█
███▄▄░░▄██▌
██████████
█████████▌
PREMIUM VIP
 MEMBERSHIP 
DICE   ROULETTE   BLACKJACK   KENO   MINESWEEPER   VIDEO POKER   PLINKO   SLOT   LOTTERY
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
June 07, 2020, 07:42:47 AM
Last edit: June 07, 2020, 08:57:19 AM by Tytanowy Janusz
 #7

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.
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
June 08, 2020, 06:01:28 PM
 #8

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.
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
August 26, 2020, 09:03:25 PM
 #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!
slaman29
Legendary
*
Offline Offline

Activity: 2646
Merit: 1212


Livecasino, 20% cashback, no fuss payouts.


View Profile
August 27, 2020, 07:59:33 AM
 #10

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?

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
August 28, 2020, 10:21:27 AM
Last edit: August 28, 2020, 10:34:40 AM by Tytanowy Janusz
 #11

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"
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
August 28, 2020, 10:24:53 PM
 #12

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!
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
August 29, 2020, 06:20:16 AM
 #13

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?
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
September 01, 2020, 07:38:51 PM
Last edit: September 03, 2020, 05:01:51 PM by its-a-me-mario
 #14

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
cryptovigi
Hero Member
*****
Offline Offline

Activity: 714
Merit: 611



View Profile
September 04, 2020, 07:43:45 PM
Last edit: September 05, 2020, 09:14:57 PM by cryptovigi
 #15

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
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
October 20, 2020, 10:08:12 PM
 #16

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.

Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
October 21, 2020, 05:43:54 AM
 #17

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)?
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
October 23, 2020, 07:37:57 PM
 #18


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.
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
October 23, 2020, 07:49:30 PM
 #19

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?
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
October 27, 2020, 08:41:20 PM
 #20

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.
its-a-me-mario (OP)
Jr. Member
*
Offline Offline

Activity: 88
Merit: 9


View Profile
December 11, 2020, 07:09:22 PM
 #21

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/)
Pages: 1 2 [All]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!