 Hey guys, it's MJ and in this video what I want to talk about is Bitcoin arbitrage bots Last year I made a video where we saw that in South Africa people are paying 20% more for bitcoins Than they are elsewhere in say America and Luxembourg And what is amazing is that I made that video last year and in certain days You can still see this 20% arbitrage just up for grabs Now what makes this quite interesting is that we have the same product That is trading at different prices at different markets So the very easy thing to take control of say of an arbitrage is To buy where it's cheap and to sell where it is expensive The problem though is that with these exchanges where you're changing fiat into crypto They do need a whole bunch of Verification you need say an American or let's just say you need local bank accounts And all the exchanges that you want to take advantage of There's quite a process to withdraw the cash there's normally a delay and then there are the whole transaction fees and converting fees and also you're dealing with USD RANDs and Crypto and it can get quite quite messy and so even though you've got 20% at the end of the day through all the effort Sometimes it's not just worth it but but We now live in a day back then there was basically You know Bitcoin was the main one But now what we have is we've got various crypto coins. We've got say Bitcoin We've got Litecoin. We've got Ethereum. We've got the Dodge coin. We've got Dash, you know, we've got the new Economy coin. I mean you've got Monero. There's there's just so many coins and What's also really cool is there are so many exchanges And This has opened the door for Quite a lot of cool things to happen because when you're just dealing with say crypto currencies One of their big advantages is that you can transfer them quite easily So what we're gonna be showing you in this video is how your Bitcoin arbitrage is or your bots should be focusing more at the Crypto arbitrage is between these various coins on the various exchanges Rather than worrying about the fiat currency also because I'm sure everybody else is busy doing that So what you would do is let's say you've got your your exchanges That have the various prices. I'm just making these prices up For for the example sake what you want to do is is Get all your information so one of the things that your bots are going to want to do is They're going to want to go and scrape the data so you want to scrape this data from the exchanger so To do a scraping program. I mean that there are lots of tutorials online how to how to set up a scraper Let me just finish this little table probably made it too big But essentially what you want to do is each bot so you'll have bot one bot two bot three Each exchange you might have to write it in a different language depending on what the exchange is what their rules are blah blah blah blah blah But essentially you're gonna have these bots and the first thing that they're gonna be doing is scraping the information of all the various coins and Then what they're gonna do is they're gonna send this information to your server So you want some sort of central server That would then look like this it would then have this this matrix of information and What your server will do is so you're gonna have bots sending their information their price information to the server What you're gonna do then is your bot is then going to look How do I change colors? There we go. It's then gonna look at which ones to buy So we're gonna be looking at all the various coins and What we can do is we can buy say Bitcoins the cheapest there Like coins the cheapest there Ethereum's the cheapest there dogs the same price everywhere that one's at 40 that one's there and We go over there Now first thing let me just just say out over here for simplicity I'm using a Measure that is kind of all the same what you could do is you could use All of these as the the Bitcoin price so almost you take away Bitcoin See you're gonna be doing Bitcoin arbitrage, but not necessarily on Bitcoins value you're gonna be doing it on all the coins Coins is relative value to Bitcoin and the reason why you just want a standard Unit is just to make things a little bit a little bit easier Normally what you do is USD with the various other Currencies but what we can do is these can be there for the ratios to to Bitcoin What you would want to then do is you then know which ones you want to buy so these are all the currencies in relation to Bitcoin You then want to also look at which of the exchanges are The most expensive and these actually be the exchanges that you're going to want to be selling at Okay, so we're gonna be buying those coins from those exchanges and we're gonna be selling These coins at these exchanges. So what's gonna happen is our server will then come to bought three Until bought three that you need to sell light coin and you need to sell You know, nim It'll come to say bought one and it'll be like, okay listen here You need to sell Monero and to bought two you need to sell Ether and you need to sell Dash and it's gonna do the exact same thing when it comes to buying it will also send them They're buying Instructions, so it'll be like by light coin on exchange one bought one by Dash as well and by theorem at exchange three. So what you're gonna be doing is your server is Going to be receiving all these price informations and then it's going to be sending out instructions on What bots need to do what so basically what you're bots doing is it's sending out trading instructions Trading instructions now Essentially what you might want to do is you want to look at the percentage difference The greater the percentages the more likely you want to do that trade So for instance if we look at Monero, that's one over here We're buying at 50 and we selling at 70 that is a very nice spread Compared to say one where we buying at 38 and we're only selling at 42 So you what you want to do is you want to find the ones that have the biggest spread or if you're spread That's also known as the percentage if your spread is above a certain rate that is More than the transaction fees Okay, the the smaller you make your spread the more trades you're gonna be making but the more you're gonna be paying in Transaction fees the greater you make it the more profit you're gonna be making but the less opportunities you're going to be finding So that is a trade-off that you need to try to figure out What you could even do is some sort of machine learning Algorithm that then determines that for you. So what you do in that situation is you set that spread as a random variable You then see how much profit you're making and then you tweak it and see what the profit is if the profit moves in a good way You keep moving in that trend. Otherwise, you reverse it until you find the sweet spot Or you could just say that's not the true 5% I mean that that probably be is the best way to start you can maybe use that as your Prior information and then do some machine learning Bayesian techniques to get a posterior wine and then join that you together Sorry, I'm going a little bit off off track. Let's let's get back to To the Bitcoin arbitrage. You can have a lot of fun like in between doing how these things are The final thing the final thing and this is where having a background in actuarial science You should have a little bit of an advantage over all the other traders is you now need to do your capital management Okay, essentially what you need is you've got bought one you've got bought two you've got bought three All of these bots need to have a reserve of coins So they need to have a reserve What I mean by a reserve is so when you're setting this up you want to almost say, okay, we want 100 light coins we want 200 of this one so that you can take Advantage of the buying and selling at a more quicker rate. You could do it so that I mean you come Sorry, I'm trying to to swipe on this iPad thing. How do I swap to the previous page? Yeah, you could have it so that you just have the buying straight away In which case if you're going to be doing this approach Sorry, we have Having a little bit of technical difficulties anyway, we back we back So you could have this approach where you you store a reserve of of each coin So you'd have say a hundred light coin in all the exchanges a hundred Ethereum a hundred hundred hundred and then buying and selling and adjusting like that Or you could have all your capital management just based around Bitcoin But what's going to start happening is that the exchanges that are doing a lot of the buying Their Bitcoin reserve is going to decrease and the ones that are going to be doing the selling Their Bitcoin reserve is going to be increasing Now it's very simple when you've got just a bot one and bot two But when you start introducing bot three bot four because the more bots you get the more of a charge opportunity You can potentially find it then starts getting a little bit tricky But what you'd want is to almost have another rule where bot one bot two But three have each got their own Bitcoin addresses and Then have a rule that says if bot two is doing a lot of selling Then or it's trying to sell but it is running low on Bitcoin. It can send a request for coins and Then the coins that are selling they're more likely to give So to do that what you would want is some sort of other variable that every time there's a sell you have a Give a variable and every time you have they buy there is a request variable that goes up and Then what happens is that when this request variable is going up It can then request coins from the exchange that is then selling them because they should have enough and then they can send it This does get a little bit complicated. I'm probably not going to go in too much detail Otherwise this video is going to be way too long But that is one thing where you want to look at your capital Management techniques that you have learned in financial economics and maybe write a little bit of mathematics Around this to just perfect it and optimize it so that because the worst thing is you don't want to so that the thing that wants to sell the coins Hogs all the Bitcoin so that the boss that are trying to buy Cannot buy because they don't have any bitcoins and then you have to manually go in and send and all that type of stuff You do want this whole process to be automated But yeah, there we go. I mean, I think that is a very broad overview on how you can design bots To trade on the cryptocurrencies exchanges try to get some sort of arbitrage Essentially you will have bots on the various exchanges. They'll be talking to servers the servers will then talk to other bots they'll be sharing information and Trade actions that they need to execute as well as sending the coins the thing is is that Arbitrage should be coming Less and less with time as as the market gets more liquid and gets more efficient This arbitrage opportunity is going to decrease So either dedicate a whole bunch of time right now and get this thing set up like ASAP or Risk the fact that you could put in all this work to set up an arbitrage But and then by the time you come to market You're too late. Everybody else has done it and the markets around the world have been optimized and are all efficient So I guess at the end of the day that is the risk that you want to take There are a whole bunch of other little hidden risks So I guess it's not a true arbitrage, but I did touch on that in the last video I hope you guys enjoyed this and as always Thanks so much for watching Let me know if you are into Bitcoin arbitrage trading and making markets and supplying it with liquidity and Profiting and how that's been working out for you. Anyway, cheers