Want Better Returns than Stock Trading? Configuring BitMEX and Deribit Market Maker Crypto Bots

hello people of the internet this is Jared done the chief liquidity officer of coin deck slabs bringing you the first in our series of informational videos about market makers and trading bots and algorithmic trading so what is going ex lives more on our market maker and to sign up or five day free trial is in this previous video that I just took today and this will be in the description of this new video in this new video what are we doing today we’re looking at how to set up and run the Big Macs simple market maker and debit configure and that’s exactly what we’re doing today so first step in this process is to visit the bit max get up you can find this by searching bit max sample market maker get up on your favorite search engine I mean finding this handy-dandy github repository so I’ll throw that in the notes you don’t really need to know how to use git in order to get this posit all you do is clone a download you downloads in find a place to download it open it up extract it to a location where you know where it is Thanks we’re gonna open up a command prompt CD into that directory bid max what’s Sam I already have Python installed this is on window so you can download and install Python from the internet for your operating system make sure to open a new command prompt doors from the window once it’s installed so here’s how to install python for various operating systems now what we need is if it makes API key and we can create an API key like so this is gonna use a live net balance where you gotta keep management give it a name CIDR we can leave blank we’re gonna now order and we’re not gonna live withdrawals my two-factor token exists here and we’re gonna take note of my API key before it disappears so again this isn’t allowed net balance on bit max from my referral income over the last a while which is not terribly much money however we can now open up gedit or e we’re gonna get rid of that open up error which is on the here it is here so the first thing we’re probably gonna do is Python setup WI install under our repository would tell us to do that hmm it tells us which I saw using pip by the way I was just miss all using Python but I guess we didn’t have to download the repository exists in the pit package repository and you’d have to just install it using this command now we run this command ok modify settings up you I did turn parameters edit settings up he would add your bit about API P and C secret and change bought parameters note the user password authentication is not supported dry with truck trial run with dry run equals true to test cost and spray running with my cat maker symbol so it only supports one symbol at a time so it’s already inferior to other boss that can support more than one support ones so we just need to set the base URL in settings where is it settings up your base from test net to WW may be a key and secret exists here so for instance the coin Dex a market maker runs on many pairs at once we could actually see it live on know why it’s not showing me oh I mean there at the edge account no wonder it’s not showing the orders I had that problem on the last call and then somebody just message being on disk anyway as you’ll see in my live night trader we’re gonna be trading perpetual and two futures with all these open orders we’re currently selling because our skew is positive by too many contracts we’re trying to reduce the net zero so that our overall exposure is not risky and that’s approach that but for the bit next sample market maker you just said our API key and secret I guess it has a symbol here already that we don’t need to set when we run it how many pairs of eyes so orders to keep open well if it makes his API actually is really slow it’s about one or two seconds between orders so having six buy sell orders will be twelve orders at a time and it’ll be very very slow so that’s 12 to 24 seconds to recreate new orders along the books but we’ll leave it at the default setting order start sighs I don’t want it to be a hundred dollars and I don’t want this step size to be hundred dollars so that is what the order the default order of values should be so we’re gonna get one dollar and then the step size is one dollar plus one dollars is $2.00 distance between successive orders as a percentage so this is the distance between orders on the book so if we take a look at my market maker that’s running the coin deck say I will see that they’re 50 Cent’s apart here right now on the coin decks market maker and also on the day of of micro makers we’re gonna look at here in a second this distance between orders increases as there’s more volatility or implied volatility or expected volatility according to the artificial intelligence we could actually probably see that in real time we washed it long enough I wonder if any of these are good examples of orders that are more than 50 cents at burn no so I guess the market is just generally not vault i right now right now and I can’t show you a good example that but we’ll see it when we configure that the good day or good market maker here in a minute so as a percentage Oh point five percent so 0.5% is a huge distance in big one orders for our market maker so at 6000 7000 dollars that’s $30 between the orders so we want a much lesser business than that and it will spread to maintain and pretend in percent between astin bids we’ll leave that at 1% maintain spreads we want to we want to have potentially profitable spreads among exactly sort of this means we’d have to look at the code this number defines far much the price for a much the price of an existing order that’s terrible terrible English so this means that if our order our initial order changes that if the distance between the best bid ask the best bid offer and the initial orders changes by more than this interval will change that order around basically it’s bit max trying to make their rate limits work even then they don’t even though they don’t check position limits so this is this is in durban record maker the position limit long and position limit short which basically means that we want to make sure that we don’t expose ourselves too much of one direction so that our or both directions rather so there are maintenance margin doesn’t get too high and we avoid the risk of liquidation so on the day when I can maker that’s actually a percent of total balance whereas in the next year we’re doing a dollar value and it’s actually set to false by default so it’s again an inferior product post only is set to false meaning we could actually have some market trades and then the market maker part of the benefit of him right to maker and I went over this in my last video is that it profits from trading for you rebates on certain exchanges there’s about eight of them including bit next and David that have market maker rebates meaning that if you make the market or add liquidity to the books and it’s not instantly actioned against then you earn the percentage of that feedback to you we can see this in live on my debit market maker that’s burning fees on every trade it does these are negative fees that we are being paid by the exchange in real time for our post only orders so this is asking us if we want post only which means that it has to exist on the books before it’s active against it has to be a market maker orderly mentions up to true dry run we don’t care about dry run how often to recheck and replace orders generally it’s safe to make this short because we’re fetching from WebSockets but if too many order and then replaces are done we’re actually not fetching for WebSockets because it max took the order functionality out of WebSockets so that’s a misnomer from an older version we’re actually using the REST API to post new orders we’ll leave it out of the default though API rest interval one second API error interval ten seconds time out of seven seconds if we’re doing a dry run how much bitcoin log level logging info or div’ predicts watched files I’m sure that’s fine contracts expertise USD so I’m pretty sure that we just run our bot now that we’ve saved our file we don’t even have to look at the source code because we can run our market maker by doing the command market maker woopsy market maker and let’s just watch the output so we authenticated him can’t sing all open orders here’s a request that we sent to do some orders or we can order in bulk which I didn’t know but it makes that’s a very good thing that I just find out so that rate limit that I mentioned is actually not as deadly so the thing is with a bulk order I can send six orders or twelve orders at once rather than having to wait two seconds to reach those individual orders on my market maker that I’ve created for picnics which makes it much more viable product so thank you guys for letting me create this video and I’m gonna take this guy and saying here be YouTube video so this YouTube video actually just made me turn a profit here’s my current BTC balance and it’s doing stuff I guess it’s uh waiting to repeat the cycle we set our distance at five dollars apart and we have six orders on each side of the books so let’s see what it’s doing on the interface order canceled that’s not good free trade with no charts we do it every day we have no positions we don’t like two orders why is that that’s not good why didn’t our order history fail cancelled oh I can’t discrete a minimum order of a dollar because it’ll be marked as spam I think the minimum that we need is about 20 bucks I don’t know if I have enough money for that let’s find out we probably do have enough money if I set my uh my lever just cross it to be okay so it makes doesn’t let you submit small orders a whole bunch of times now we have orders they’re submitted and they’re active and let’s see if we get it in trades you get a week for Bitcoin to go up and down and priced by about this isn’t show me on the chart it does show me on turn me I wanna see the bodies two guys I can see them now so if the price goes up by that’s a huge interval on the best bid I ask best bid offer well I guess what we could do is we could leave this bot running and see if it trades any while we set up our dare the block so here’s the Dare of a bot ah let’s download it shall we examples Python market maker examples other examples I couldn’t even find this by searching kid I don’t dare a big sample my maker and it’s the first result on Google now you can download the zip again I’ll show you how to clone it using git in case you wanna learn how to do that so I’m gonna see do to my C Drive and get clone this repository which is the same as downloading the zip is if I can do some more stuff so I mean the Python mark to make your directory now I’m going to open that directory in my handy old notepad plus plus on my windows on my windows examples I was the only example they have so in here we have our market maker file and we also our set up top UI meaning I can run inside of Python set up install yet again to get dependencies now this is a much more fancy bot first off we can use a whole bunch of extra futures at once rather than having to rely on just Bitcoin and I’m pretty sure it’s gonna fail if our instrument name contains eath because it’s an older American maker and hasn’t been updated the original creator you real has cop stated this plus significantly since it’s been developed and released on under bits github however that is aside let me create an API key again I’m feeling this with some very small referral balances I have some ether in here too but I’m sure the bot doesn’t work for ether I’m sure we’d have to modify it significantly which I have done actually in the coin Dex live trader market maker bot that we’ve based on this derivate sample we’ve also added about a dozen different indicators the debit market may be disabled uses one oops they use EWN my ma to estimate in order to find out what the volatility has been over the last four ish checks of the bot on the price invalid to a PHA code arm in the wrong one dear a bit nine four four seven to nine excuse the very good API key I’m gonna throw this in the market making duck uy file under key here under not the test name we’re gonna change the use product variable to be true by default our studies frogs because cuz we want to use the live net for our run so what can we configure you the contract size on David is ten by default we can reduce or increase this variable to reduce or increase the cap on volatility estimate I’m gonna go ahead and throw in my thoughts on the most important variables like men order size which can be done for one contract max layers we’re gonna reduce that to increase the size that’s again like we saw on bit max when I can show you again is where we said six orders up and down the books one two or three four or six one two three four five six this is saying by default we want five on each side we’re gonna change that to three our n legs that’s how many times backwards to see the volatility using the ewm a indicator what do we have here percent limb long and present them short this is the percentage of your account balance to have in Long’s and shorts before stopping the new buys and sells on the books so if you’re feeling more risk-averse you can reduce these numbers say by half and it’s already 2 percent quality basis your percent order quantity and BPS as a percent of account on each order so if you’re feeling more risk-averse it can reduce this number and have less order sizes you men loop time is how long to take between locally increases to a large amount if you don’t like to have faster loops your wrist charge volve this is an interesting variable if you increase research well well actually I’m going to show you in when we run this bar 233 and that’s basically the most important settings and that’s how we set up the market maker so if I do I thought market maker and should see some output $7 in there it’s trading these contracts which is again better than the bit max Bart and again the coin Dex but the coin Dex market maker can do ether as well we observe positions no bid no offer is not a good thing to hear no bid no offer so why do we hear no bid no offer no good meanwhile my percent may be a reduced position we wanted to be larger so it wasn’t it was refusing to enter into the two bids in sells the Bisons also either bids and asks Bateson offers we changed the config variable no bid no offer so what is that value at showing the after no big offer and this is just because of a very small account value yes if we have a higher man order size it’ll act in more cases and let’s see if it’s acting now we could actually watch his on the shirt [Music] okay no big no offer I wonder what this value is of the no no pause lamb long yeah so we just increase represent when again again this is more risk but we need it for smaller balances because obviously you’re gonna risk more if you have a less of a balance that’s why a higher balance will have an arrant less risk we still see no big no offering so why is no big no offer doing that well we know it’s because of the percent increase it again no big no off no big no often it’s increased missing number which is good pose limb place asks and bids the minimum of pause along divide away quantity bcz and max layers the minimum of hours long but quantity VCC let’s see what this value is probably not much because I quantity BTC is very very low of zero point zero two eight so this number needs to be above one pressed I have a bid or an ask and we kind of wanted to have three layers so I’m gonna have to change pause then percent Lin long to be so he wants me for three we want to be sixteen point two seven times larger than one days and this is obviously not a good idea you would want to more of a balance anyway what’s $26,000 to do now we should see some orders and I think that’s where most people get tripped up it actually tripped up me and my CEO Ryan for a little while when you’re first configuring the same for American maker with our test balances it’s doing stuff the warren order it’s saying my orders are failing I wonder if I have enough money would be fifty bucks oh it adds some orders maybe it’s failing for certain features and that could just begin because the bot is old and I’ve already fixed that in the coin next market maker and you can be more about that in my other video that I just created and published today on a brand new YouTube while you’re at it you could also size USD 490 it’s doing 50 as contract size you don’t want we want five contracts or fifty bucks try that which means I might have to increase pause live long and short by ten time is in order to compensate for the difference we’ll find out you can give us a like subscribe and comment 50 bucks five contracts that’s good and it’s doing more buys and sells it’s doing a whole bunch and it’s doing BTC perpetual so it’s doing the features and perpetual which makes it better than the bit max bought let’s zoom in a whole bunch on the one-minute chart you can see that it’s actually going to take action much more often than our friend bit mix bought and I wanted to show you you see the distance between these all I wanted to show you that if we increased our risk charge of all maybe four times you’re gonna see the distance between these orders is gonna be four times larger now here’s where it gets interesting the ewm a indicator where does it change EPS yes EPS equals a percentage point comes vol which is coming from these self-taught Vols greater volts are showing this like times the risk as well so we can see now these orders are more distant which means we’re gonna enter into orders less often and if the price goes up or down more often we’ll find that if we entered less often that we get to soak up more of the difference in the in the change in price before we run out of maintenance margin which I’m getting pretty high on right now so we should probably have some positions and what I meant by that vol variable here we’re long 200 were long 350 now the hyung decks market maker know this is when you’re too much long or too much short and I do like hedges and tries to help you perfectly back down to zero so you see here that we’ve shorted BTC perpetual a whole bunch we long creatures and we’re actually doing that on purpose because as the price of the futures average price approaches the visuals you’ll see that because we bought lower and we’re selling higher we in we earn another different revenue stream just from that that the same folder but market maker doesn’t have it’s also starting to get very much skewed in a positive direction so if the price of Bitcoin wants to go down now which it just did you can see that we’re gonna have losses because we’re skewed positive far too much by the basic logic of the bot now the fall indicator that I mentioned is the one indicator that that the market maker has which is this variable here we’ll see this number go up if the price continues to move and we’ll see it go down if the price stays about the same so we saw it go down a little bit from the last time it updated it’s probably gonna go down again because default value was 150 for a hundred percent for the last few runs we’ll probably see it go down again when it goes down let’s say if it goes down by half then the distance between these orders will also decrease by half now the coin Dex market maker hasn’t got a dozen different indicators that some of them affect how the volatility index is calculated some of them affect how is multiplied into itself some of them including the artificial intelligence indicator which comes from coined X’s three-year long the battle creating a proprietary and patenting neuro-evolutionary AI in a link to my hacker noon an article describing how I think that works from my basic understanding is in the first deal which is linked bottom of this document or this this this YouTube video so you can see that we’ve actually sold some contracts so we should be earning money on fees let’s have a look yeah every single one of our trades is posted on the limit and we’ve earned fees on each of these now on bit mechs let’s see if we’ve made any trades yet whatsoever on a market maker position zero so no we haven’t so it’s just waiting for the price to increase or decrease a lot before it enters into our position we could make our dare but market maker less likely to enter orders it’s actually very very skewed now it’s out of thousand dollars so as the price continues to go down it’s gonna see more and more losses I’m actually gonna lose all my balance here soon if I don’t stop the ball because it’s approaching my maintenance margin so let’s stop the bot then kill our orders and market out of our positions let’s also kill that API key we’ll add it and that’s basically how to set up configure and launch and optimize a bit next sample market maker and the derivate sample market so I’m happy to have been able to help with this process now let’s just finish up this video by deleting my API key so this one actually killed the active orders when I told the pod which is very very smart and if I go up here into account or API or rather I can kill that King I can kill the King now it’s not good for the fact that I showed you what Mikey was and that’s why we’re not keeping it alive and you should never share your keys with anyone that you don’t trust now they weren’t withdraw a key so there’s no chance that somebody could have withdrawn my balance using my API but somebody could mess with my old keys oh that’s the wrong it’s uh where’s that bit as I can oh no it is the very buttock I know it’s my main two every time so I need to go and get my oh my dear a bit four five one nope three one off yeah three one oh seven five seven here’s my new key is that the key pride care I should probably clean all these now that I’ve gone ahead and shown you like this disable them I gotta enter my two-factor authentication code do you go no seven five seven and three seven seven two six four line something went wrong I need a new key this one Hado have it’s hard to do it I said to set up the wallet and that’s how to succeed with the bots um to view more about our sample market maker watch it in action it’s actually done with zero net contracts now so I mean that means if the price of Bitcoin goes up or down relatively speaking among the features and professionals it’s now perfectly hedged meaning is up or down doesn’t I just brought something doesn’t affect our position returns on the positions because they even out and you can see here I brought our bot in this session has gone up by a fraction of the coinage considering this much and this is our maintenance margin that we have in our initial measurement we have on the account but yeah the other video goes into it into more detail and we’ll have more videos coming up on how to best make use of the coin next market maker all righty thank you so much