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

Coindex Labs – Who Are We? How Can You Try Our Free Trial? + See Our Market Maker Trading Bot LIVE!

hi and welcome to this introductory video introducing coin deck slabs our inaugural market-making bought and the free five-day trial that we have on offer for new signups so what’s the agenda for today what is coin deck collapse well my novice understanding of the underlying artificial intelligence algorithms lives at this hacker noon article which I’ll put in the video description we’re just after coming on I gave a brief overview of how I thought the artificial intelligence works but basically what it is is it’s a proprietary and patent pending algorithmic trading engine that can apply to a whole bunch of stuff other than just trading markets but it’s actually really well suited at trading markets and this particular version of artificial intelligence is highly resistant to overfitting which is a classic problem that artificial intelligence faces when you train it too much and it becomes too used to be input data and can’t react well to the new data so our algorithms or our average intelligence is much smarter than that but in short coined xlab’s is exactly that it’s the company surrounding this artificial intelligence for market making and perfer creating opportunities in markets and they found me on my birthday actually of this year August 2019 Ryan the CEO of coined XO you can find here on the team page near the talk Ryan found me through my github which has over 100 auditories mostly dealing with arbitrage or crypto markets and it sent me an email he said hey would you like to take part in in corn X labs here’s me on I’m Jared Diamond Bailey the chief Lakota the officer actually your lead engineer Marcus liquidity get coin next laps I’m in Nova Scotia Canada you’ll find me a medium afternoon which are linked here actually so I could throw this link in here and actually one post on hacker noon that’s gotten some attention recently is this most recent one where is it where I discuss negotiating and successfully landing different preferred rates packages with derivate and Finance where we have better market maker market and and taker fees for our trading boats but we’re going to use in our inter Consolidated Fund which we’re launching at a later date but for now we have our software service offering soft launched and that’s part of the point of this video is that in the end we’re gonna go into subscribing and how to set up a trading bot with my help using the five-day trial that we have on offer anyway you can see some of the returns that we’ve seen in the past this one was on a balance of 0.9 Bitcoin or this many Satoshi shoes over the course of less than a day and we’ll get into more of the performance later here when we get through this video so basically cornets Labs has been around for about three years making their it official intelligence that powers the bots that we have and I’ve been here since August which is a few months anyway basically working on a free and open source bog that we’ve taken and completely revamped and recreated in our own image so what is the market maker then um the market maker that we have in production is a version of a bot that we’ve added a bunch of basically a dozen different custom provider indicators to we’ve also added hedging logic something so that it’s most of the time perfectly hedged between futures and perpetual zon and Arabic we’re gonna extend it to a whole bunch of other exchanges in the near future it is working on Finance and FTX right now on a whole bunch of different pairs on FTX because they have our edge tools and features we’ll bunch of different stuff but that’s not really long yet so the bot earns on trading feed rebates on debit and I can actually show you what that looks like live so it looks like we’re up by a whole bunch of little bitcoins here from our balance of this many bitcoins which is good news when I show you the performance later but what this looks like for our closed trades is that the fees here are actually negative in all of these cases and they would be in most of the cases for the recent trades so we’re actually earning this many Bitcoin every day every single time we trade sometimes more than that this is a bigger fraction of the beat and every single time we trade or earning that little tiny amount of feet it earns on the spread itself which means that if we take a look at one of these futures contracts would probably see a larger spread and what the spread is is the difference between this lowest ask in this highest bid I think I have that the right way around so you can see here it’s actually not that much of a spread it’s only 50 Cent’s it’s right on the dog in between these two orders but you can see where my orders are placed these little X’s show that I can cancel these orders that means that if the market was to go down to 602 five and then up to six or to 750 I would make that difference in the 2 bucks in 30 cents on those orders that have executed that’s on average and it takes a while to average out over over many many tens of thousands of trades in order for the spread to be successful in earning because sometimes you’ll see that the markets will go down signaling more than we expect and we have to basically size or orders and hedge our positions to resist the downwards potential there it earns on the spread itself it earns on the convergence of futures prices to perpetual is also known as cash and carry arbitrage now I wonder if I can find my medium post where this actually happened in a very favorable way somewhere in here I have a day when we’ll go back to the urban interface a day when the price of one of these features I think it was September went from say sixty seven hundred dollars or so down below the price of professionals and because we’re always buying and selling to keep a net sum that’s close to zero to reduce our risk that means that when it exactly reversed from my situation now so we’re buying features because they’re lower in price than perpetual which means that as the futures price the the mark price approaches perpetual will gain well I mean it says right here the average price that we bought for this June feature was 604 six the average price we bought for this September feature was six over four and the average price we sold was six one two three so as approaches converge or move as the prices converge or move closer together we’ll realize the difference in buying low and selling high and that’s all that means but I think there’s a really good article that explains yeah on one day a couple of weeks ago two of our subscribers before we even had the subscription model launched managed to do ten times and 40 times their balance in a matter of minutes because of this this effect of convergence of huge prices to perpetual basically the funding for perpetual is flipped from positive to negative or from negative to positive and in that process that the price of December futures came crashing down and our shorts on those features cashed in kind of heavily what has performance been like let’s go back here nope go back here and go back here we actually have a testimonials link now on the home page which is gonna show you first this anonymous testimonial from our trader with the largest balance he’s actually over one Bitcoin total balance now from his original balance of a combined balance from his hedging account and his main account at 0.9 Bitcoin you can see the hedging account this is daily and weekly the edging account was up over double in less than a day when this screenshot was taken and his total balances up in the nearly 10% and he gave us this testimonial testimonial here our second testimonial that we’ve thrown in here it was actually a 10% increase in less than a day’s not since this started trading it was less than a day and this person asked if he could then increase his balance and let’s take a look at the live trader now I haven’t checked these results to see if they’re gonna be really positive or promising so hopefully the livest Raider since the boss reset it on an error maybe half an hour ago have been seeing some success let’s find out so it looks like the average Bitcoin on profit and loss projected over 24-hour period is about 12% gains a day on Bitcoin while the USD value of that Bitcoin has gone down and if we look at the one-hour chart which is yep the value of Bitcoin 2 USD the ticket price has gone down by about 60 bucks which explains that but you see that our Bitcoin balance has been creasing as time goes on this shows all of our subscribers profit and loss in Bitcoin and USD as you can see that this subscriber NS he’s the fellow it was one Bitcoin which is our largest balance of a subscriber account right now you can see he’s got 8% Bitcoin yield every day on his realized gains of point 17 percent in a shorter period of time while his his USD games look like they’re third in the list of 65 here so this person is in the lead with more than one percent daily yield and this person has a little bit less losses but the person with one Bitcoin comes right about in the middle which is less than half the losses the theoretical losses it depends if you like Bitcoin or if you like US dollars more or whether or not count these as losses but altogether I think if you’re up nearly 13% in Bitcoin and only down coup percent on average every day and US dollars this is again over a very small sample size but it is live and updating from our running subscribers now all of this brings me to my final point how do you as people that are new to this idea or new to corn X labs or maybe have known me or Ryan or any other members for a longer period of time but looking to sign up how do we do that practically so I’ve included the link here this is going in the description of the YouTube video and I think this video was actually going on this page the SUBSCRIBE page to help people with their subscribing so this subscription page goes over the base tier the pro tier and the master class here and basically the difference between these tiers are described in these short little bullet points here this recommended trading balance is probably going to increase because as I just showed you the live trade with the fellow with one Bitcoin is doing far more sustainable results than the people with less than one week going by the way you would select one of these tiers and hit the subscribe button that being said like I promised there is a free trial if you read this little blurb here it says you can optionally take advantage over a five day free trial instead of first sending in your subscription fee the trial is a maximum balance of point one Bitcoin we’re probably gonna change that though so people can see more gains in your market making account there are details on how to participate in the trial after you solicit after you select your subscription tier here submit your email and details and receive our welcoming now thank you so if I hit subscribe on anyone these yeah it’s gonna present me with a forum to fill it my name my email a referral code if I have one choose a tier that I’d like to subscribe to your according to the benefits that are described may be optionally join the discord server and we should change that subscribe and pay button to just say subscribe and I should have got a welcome email from myself let’s go look so in my email box I see that I have an email for myself this will of course come from me and not from yourself to yourself this will be from me to you thank you fairly filling out a form on the website or otherwise expressing interest this basically says you could have the trial or not have the trial if you don’t have the trial if you don’t have the limited balance for the first five days you can send your subscription for you to this blocking Bitcoin address otherwise if you’ve done that already or if you’re signing off the five day free trial you can figure my trading account now what you need at this point is a debit account now we are going to support more exchanges in the very near future a lot of people like new people oops I do not want to do that you can hear that dinging in the background is actually the market maker making trades and earning feet big this is gonna be my account that I set up now people in the US aren’t able to create brand new accounts I don’t know a way around this and I don’t think it’s wise to try and find a way around it as it would violate their of its Terms of Service by anybody outside of the US and in my country not in Quebec which i think has something to do with their laws being a nation within a nation Caine created an account now that I’ve created an account I think I need to check my email and sign up to direct Cognito window now I’m activated so if I log into this the next step would be to fund my account now I’m not gonna walk through how to is that non plus demo plus test I’m so sorry what did I just do okay I’m not gonna walk through actually how to buy Bitcoin there’s tons of guides and it all depends on your country and your preferences how many fees you want to pay all you want to wait you’re gonna log into your account you’re gonna be unverified which means you’re not able to deposit the bitcoins that you just bought into my name my last thing my date of birth is gonna be a long time ago it’s gonna be done here please nobody steal my identity but my address and city this is gonna be test two o matic because people probably will steal my identity and I’m in Canada now that my personal information is saved I’m able to withdraw up to twenty one Bitcoin every 24 hours or up to fifty ether every 24 hours if I want to withdraw more than that I would need to submit my ID documents which is the ID document itself and a photo of me with a webcam or mobile phone now that I’ve verified two levels zero which you can see this green little area this text up here I can go to the deposit screen I needed to generate an address I would send my Bitcoin to this address if I’m signing up for the trial again the maximum balance right now is pulling one Bitcoin but that might go up so be able to withstand some gains or more sustainable gains by the way you would you would submit as much Bitcoin as you want to to this address now the next optional part is if you want it’s tough to explain let me see if I can figure out what the chart that I have if you want to hedge against Bitcoin USD movements so that your US dollar returns remain neutral as Bitcoin goes up and down we can optionally short Bitcoin for as many dollars as you have in both your trading account and hedge account what this means is in practice I’ll show you here this account has 0.1 Bitcoin and this hedge account that’s about 500 600 hours this hedge account here is actually shorting all of these contracts for about a thousand dollars which should be right actually we have more balance in here which is why it’s a little bit confused so it’s a little bit too sensitive to the market price right now which I can fix I could probably fix just by doing this it’s probably gonna be less than that much you wouldn’t have to worry about this so yeah I know it’s sold up to 640 dollars which is what we have in the accounts so we’re short six hundred forty dollars which means if I go back to this this page you see that as Bitcoin goes up and down in price and which is the blue line the Bitcoin US dollar value the black line which is our USB return our US dollar of returns remains about the same and the Green Line does whatever it wants the Green Line actually goes up and down as an inverse to the blue line because of the fact that we’re short and that makes our net position much happier when the big one price goes down but our black line our US dollar returns remains about equal and should hopefully be increasing over time but the markets are big fluctuate I mean in general it’s up its down since this chart started since we withdrew some funds but altogether it it is making gains like from here to here it gained about 0.2% total which is good on the US all the returns so to create a hedge account in our brand new David account we would go into mmm settings by clicking your username in the top right you click on the sub accounts now this is optional some of our people don’t have sub accounts created that are hedging against the main accounts and that’s fine too so now that I have a sub account one my deposit it is in all I would do is go to this transfer button here I would transfer from my main account to my sub account I would transfer about a tenth or maybe a fifth of the total Bitcoin that I have so if I had point one in here in my trading balance I would just trade put point zero one five maybe I can’t right now but I would put zero point zero one five I can to my other account I can show you so this is the account with balance I’m not actually gonna do it but if I was to do it this is what it would look like so I appoint zero eight in there so I put a point point zero one in there into the hedge account which is about a tentacle balance or between a fifth and a tenth of the balance in a later version of the software it’s gonna automatically we gained even more Bitcoin here since I started the video which is pretty good sorry uh where was I the hedge account in the future version of the software that the main account will transfer to and from the hedge account to adjust the balances in order to avoid the chance that the hedge account liquidates which actually happen in one of our subscribers cases recently he just basically had to top it up again and now he’s back up over his original balance which is great that’s how I create a hedge account that’s how I fund the hedge account after I deposit my Bitcoin and now I need to create an API key how do I do that well for both the hedge account and the main account you would go into this API settings screen you would create a read and read write on account and trade for this API key and you would I this API key you would then copy this client ID with this handy copy button here throw it in the notepad mean I can be main I cannot secret actually we don’t even have to throw it in notepad it’s easier than that because as you’ll see in the sign up email you had this link to configure my trading account so insight configure my trading account we would throw the trading I can’t API key which is I have too many screens open this one raid in here my trading account API secret I would throw in here my starting balance this is just for us to know we can actually check using the API and actually tell you the truth we do the the insurer over sizes in logic will not put your account at undue risk we do this automatically now without this form field so it might not even need this form field in the future which I can actually say my email address are we doing a trial or no yes or no with our maximum BTC equity I should change this just a sec Brian manages the site for Mossberg versus so are we running a trial yes or no continue and lastly the hedge account API key which is the second account the sub account that we created which again is optional and it describes it here for you we submit this form I’m gonna get an email to my index account which says this person has signed up this is the API key and then I would go and create you your trading instance which is located generally close to their bit servers for our master class here that’s actually located in the same building as the Dara bit servers which increases latency by a fraction of a millisecond which is actually very helpful for high-frequency trading that said as soon as you notice me set up your account and I’m gonna talk to you probably to make sure that your balances are there and that you’re ready and all that fun stuff when I set up your account and launch the bot you’ll see that it’s gonna enter into positions I don’t know why I don’t have open orders right now see this is why we add the personal touch because sometimes there’s no open orders I actually tell you think truth I think it did this on purpose it looks like it uh it did some limit as market orders paid some fees and exited out of the net position it was in or it should have all look into this later basically all I think I need to do is restart that instance to get it going again and again that’s why we have the personal touches in case anything goes wrong we can react to it and make sure everything is right I should probably check the logs to see exactly what happened there from from what I understand from that from the transaction history it looks like it it noticed there was gonna be a lot of volatility in the market decided it wasn’t gonna trade that volatility and exited out of it accordingly and took a little break but I just wanted to trade now so I’m gonna manually restart it and we’ll see my trader start the trade balance I’m actually gonna wait first like to see that those no orders to show you because that’s what it’s gonna look like when the bot starts for the very first time but you’ll have no position so you’ll have no positions and it’s gonna go ahead and open a bunch of orders actually just takes a few minutes to start through so we’re just gonna waiting patiently I might as well throw in our Twitter and our LinkedIn because I think that you guys should follow us he also he also should like this video if you did like watching it and subscribe to our brand and YouTube account we’re gonna do useful tutorials on lots of things like how to set up free and opensource bots comparing free and open-source products to our software specifically also fun things like how does our software handle order sizing and obviously give you a little preview of what that video is gonna look like basically I’m gonna say the initial quantities based on bled it’s further refined but bled if position is negative returns to something a position is positive returns do something and let’s watch as I manipulate the skew which is the net position difference between all the positions watch the skew affects our order sizes and that’s actually playing for one of the next videos another the next video we’re gonna go over is some github repositories like they’re a bit market maker and this is actually the bots that ours is based off of made by a guy named Muriel and he’s kinda fantastic this is the wrong repository it’s the one that actually is hosted by Dara bit somewhere in here there’s a market maker hope it removed it oh that’s funny anyway they did have a sample market maker so let’s see if I can find it somewhere I was under examples so here it is here’s their market maker we’re gonna set this up in another video we’re gonna see how do we can manipulate some of the input variables like all of this stuff here to do different things and accomplish different goals we’re gonna get it set up on the test net it’s also set up to run for another live net if you were to use the test net perimeter of the live net parameter we’re also gonna then compare that against the bit max sample market maker github which is a much more simple part basically placing some grid orders on the market book regardless of price and we’re gonna set that up we’re gonna give that running and we’re gonna get some testing that balances thrown around on picnics which should be fun so is that bought trading them live trader maybe that’s why the USD Delta is so fine so now we get to actively debug why something is not working the way that we expect it to so the first thing I’m gonna bid is to eat the sentence actually I’ll do bug that off the call so I don’t have to show off my processes or my API keys which should probably remain semi-private are any well that’s basically it for now I do wish that I could show you that bond or maybe I can show you a different part through the logs so let’s take a look at that Bart that’s running a balance and show you the logs so we can show you it doing stuff basically I’m a fairly advanced Linux user so I know some commands to give us some output from the logs that’s gonna hopefully show us the bought in action now the bought the logs are very much development Long’s and they don’t make a lot of sense to most people do you do do do do do do and apparently it’s not letting me connect come on Google Cloud okay let’s try a different one yeah we might just give up on this if Google cloud doesn’t want to play ball I’m already connected one no no I’m not yeah it doesn’t want to do that maybe I can do this a different way if I can go in here to my remote desktop session going here and g-cloud compute this is H root this oh no I don’t Europe West to see oh it needs to be the instance name all right tail bar logs Islam the chef well it doesn’t look like it’s actually generating logs let’s just look at all of the logs and look for Delta and that was probably too many logs and you can see that the bot was trading and the total of the amounts between all of the positions the net position Delta has been changing regularly and now and now the video is complete I guess and we’ll we’ll continue this conversation over there our next video is like I said we have a few planned we’re gonna plan a bunch more and we’re gonna make this YouTube really popular and we’re gonna hopefully seen you on the discord just the very friendly chat um in here for all those folks that like coin decks and like to run bots talk about stuff like wine alright can stuff thank you so much and have a wonderful day

Next Up on Ongoing Negotiations with Kraken, Bitfinex, BitMEX, and Successful Ones With Deribit and Binance: FTX!

Darren,

While we’re excited about the prospect of trading many more high-liquidity perps vs futures, FTX allows many other interesting opportunities.

I rewrote the bot and was trading around 12 perps and hedging them against futs or vica versa simultaneously – the bot is ready to be put in production, even though the change from deribit/mex maker fee rebates to paying fees in all cases appears critical.

We’re actively interested in trading and hedging using leveraged tokens in many cases, including holding and manipulating baskets of leveraged tokens based on leverage amount, based on market conditions and predictions by our proprietary patent-pending neuro-evolutionary artificial intelligence algorithms.

While we can imperfectly hedge using these tokens, they also offer up other interesting opportunities: the inefficiencies among these markets and furthermore among exchanges offer many interesting ways to arbitrage and create risk-free profits in the here & now and in the future (and in some cases, specifically, at settlement).

Trading the perp/fut/LT indices incurs additional reasons for thinking from the team.

We’re very much interested in this opportunity to work together, to bring you business from the different revenue streams we’re beginning to realize or are realizing or may realize: specifically,

  1. We soft-launched our consumer (non-US) SaaS offering and have 5 paying subscribers and 1 free trialer in <48 hours. https://medium.com/@jarettdunn/coindex-saas-soft-launch-gains-of-3-14-daily-a-testimonial-c320cbcf1ec0
  2. We’re also going live with the initial test investment for our as-yet not registered commodities fund, which will be live for 1-4 weeks on Deribit before a much larger pilot funded by some additional parties. This will be closer to $250-$350k among a few select exchanges, weighted by fee rebates and any preferred edges those exchanges can give us over our competitors on those same exchanges (including the orderbook as a whole as a competing force, haha). Lastly, we’ll be rounding up funds for our first public offering of the fund, for a target of $50m AUM.
  3. Today we provided the screenshotted piece of news to our current and potential subscribers, along with the promise for another revenue stream: ‘We understand if this disqualifies some people from participation, and we will look into new and interesting ways to optimize bots for lower balances — and new ways for people to invest in a broader vehicle that provides exposure to this kind of trading opportunity. An investment structure like that is completely subject to regulatory compliance so no guarantees of anything yet but hopefully more news to come on that soon.’

For context, do view this earlier Medium/Hackernoon re: negotiations with Deribit and Binance to date. We’ve also opened negotiations since with Bitifnex and Kraken, and to a much lesser extent BitMEX.

https://hackernoon.com/heres-what-my-crypto-trading-bot-will-do-with-a-little-help-from-binance-and-deribit-ac1ml32ny

I hope you’ve had a marvelous weekend, and the support queue didn’t get too hard with questions re: Binance delisting LTs. I also hope this event has significantly increased your rate of new accounts, as people move their LTs onto net-new FTX accounts. There’s always a silver lining, yes?

Coindex SaaS Soft-Launch – Gains of 3%-14% Daily + a Testimonial!

Hi there friends, followers and colleagues!

UPDATE: We’re now LIVE with our offering for a 5-day trial with max 0.05 BTC balance. The market maker will prove itself by working for you before you have to pay us anything! https://www.coindexlabs.com/subscribe

TL;DR: Join us on Discord for fun and (no assurances…) profit! https://discord.gg/xuWjAUv

Coindex has (soft-)launched their SaaS platform (along with some manual steps for us to verify your settings and spin up your VM). We’re also happy to welcome my dear crypto friend Vivek Sahni to the team, as community support advisor!

My CEO Ryan wrote me a very appreciative bio on https://www.coindexlabs.com/team!

Our subscriber signup page details the several tiers available to our subscribers, and within 24 hours of our soft-launch we have 2 people live and 4 more showed interest in the initial subscription form. Mewn!

Word to wise: you can append ?ref=YOUR_NAME_OR_CODE to acquire a 15% revenue share on referrals you pass our way, to the /subscribe page, like so: https://www.coindexlabs.com/subscribe?ref=jare – and then, when they click subscribe for the subscription modal (or even if they revisit the site later without your referral code – it remembers!) it’ll auto-populate the ref field with your details.

We’re moving along swiftly by augmenting the code, integrating Coindex’s proprietary patent-pending Artificial Intelligence, and generally making it less risky and prefer making over taking – acquiring more and more fee rebates, gaining on the net difference from futures vs perpetuals prices, and the spread itself.

Look! BTC dumped about $400 and the bot was poised and ready to soak up the difference in % gains BTC. % gains USD shrank, but check that black % USD line – recovering nicely, recovering quickly!

One of our initial subscribers is running close to 1 BTC balance, check these stats:

First column tag, second column daily % PnL, third column total % PnL, fourth column balance BTC

Another subscriber realized even more gains, promptly increasing his balance:

That first subscriber wrote us a little testimonial 🙂 Here it is:

I’ve tested A LOT of crypto trading bots and even customized a few but most end up making losses in the end or struggling in a volatile market. I’ve been using [Jare’s Bot] and can tell it’s a whole different machine and even through a few random pumps or dumps that didn’t follow a trend it still held up fine and hedged against it. Solid bot that aims at consistent gains.

Note: we can not and will not assure or imply returns. Risk only what you can afford to lose.

Some Major Negotiations with Some of the World’s Largest Crypto Exchanges, Binance and Deribit

See this article in it’s original from on Jare.cloud!

UPDATE: We’re now LIVE with our offering for a 5-day trial with max 0.05 BTC balance. The market maker will prove itself by working for you before you have to pay us anything! https://www.coindexlabs.com/subscribe

Over the last week, I’ve managed to wrangle Deribit and Binance into some pretty advantageous situatiuons.

First, I acquired 60% of the fee share on Deribit for our frontrunning account, where Coindex and I will be running a $15 000 trial in the coming weeks, using our proprietary AI and proprietary order risk management through hedging. Very exciting times!

Deribit also offered their partner program to Coindex and to me specifically, where we can earn an extra 20% of their fee structure of 0.075% for people we bring in and run our bots on their behalf, after they login to our OAUTH login flow and then we add some partner request headers and magic so that people everywhere can use my Market Maker.

My subscribers have been having some fantastic days!

My efforts at Deribit could not have been as successful without their dead-on support rep @MrJozza!

Next, Binance welcomed me into their Broker’s program. There’s a few models and fee rebate/discount tiers, but once we’re in the master/subaccount model I can be granular by assigning discount rates for my subaccount models. This allows a ton of additional opportunities, like creating an SaaS-model platform to take advantage of (nearly) 50% off trading fees for stablecoin->stablecoin pairs, which will eliminate risk as they always range around $1 and the difference in bid/ask alone with the discount means that we can soak up some of the $10s of millions in liquidity in immediately profitable trades.

That’s in the books – same, too, with a funding fee arbitrage bot that buys long with there’s a premium and sells short where there’s a premium, across dozens of futures exchanges, and then waits for those prices to converge before cashing in considerably. This actually happened to us with our funding rate arbitrage model on Deribit, some of my users seeing 240% profits all the way up to 10x, 40x.

ANNOUNCING Jare’s FOSS Market Maker Referral Program – 50/50 Split!

As some people are up as much as 10x their money today from clever shorts in the bot – from BTC diving as much as $700 in a matter of minutes – I’m happy to announce the referral program.

I’m earning 10-20% on the taker trades that are executed on Deribit/BitMEX. The BitMEX bot is more of an afterthought and a few things don’t work: 1. about half the indicators aren’t working 2. some orders are still failing, not sure why until I look at it again with some live balance 3. it doesn’t arbitrage futures vs perpetual 4. even if everything worked as we’d wanted, there’s a 2-second delay between orders and edits enforced in the API that keep us from achieving a High Frequency Trader.

As such, the referral program will be for Deribit only. It’s also easier to control and monitor referrals on Deribit because they allow subaccounts for reporting and individual, unique referral links.

Since launching the recent ref program, I’ve earned $47.15 (with today’s deflated value for BTC/ETH) – $37.95 in the last two days & having daily growth in $ of 119%-153%, with about 2-3 active referrals. To date, I’ve had $709.62 in today’s BTCUSD price across 35 refs.

The revenues continue day after day so long as people continue to use the bot — and on each taker order, we earn a fraction of a %. Taker orders exist in the bot 1. to return the skew to net neutral every minute or so (so less exposure, less risk of stoploss, less risk of liquidation) 2. at stoploss/takeprofit when it again returns to net neutral 3. at the 2nd layer of stoploss/takeprofit where it returns each position to exactly 0 and takes a break from trading.

Our community lives here: https://t.me/jaresmarketmaker

https://docs.google.com/spreadsheets/d/1WmSDOGiG_AhFFoBMNtnZbEJcb5yc399-8K2qJWBPkU4/edit?usp=sharing

The process is that you can chat me here, in PM or on jarettrsdunn+git@gmail.com, and we’ll create you a Deribit subaccount and give you your unique referral URLs, you’ll refer people and your referral # will increase in near real-time. Your referred ETH and BTC amounts will increase every morning at 8:05am UTC.

It’s an opportunity for evergreen income and the chance to build people’s portfolios with my proven strategies. You’ll be able to keep 25% of the revenues you drive, so long as they meet a minimum threshold, every week! Should your referrals produce more than 0.08 BTC or 3.5 ETH/wk, you’ll receive 50% of their referral fees.

What is it we’re selling? Market Maker in Livenet Production on Deribit UP more than DOUBLE in MINUTES as it realizes gains from cash n carry futures convergence giving arbitrage yields!

Market Maker UP 7.5% before September futures fundnng flipped sides: https://i.imgur.com/gKM1zkU.png

Up a whole 240% at all-time high, settling around 130-140% after September futures dropped below perpetual price, realizing gains on convergence of cash n carry futures arbitrage: https://i.imgur.com/mAEKnJE.png

What is it?

This Deribit and BitMEX market making bot earns on fee rebates when making an individual post-only limit order turn into a position. It also gains from the (average) difference in spread on an individual instrument, and as I saw overnight while I was sleeping it gains significantly on the convergence of perp vs futures arbitrage based on funding rates.

Moon!

You can review the bot’s graph in real-time here: http://jare.cloud:8080 – note that since the huge climb and for most of today it took a break, as it noticed the increase in balance and decided to sleep for a day (the higher of my two Takeprofit values). I’ve manually intervened and it’s now pumping out trades again.

I’m offering the bot FREE of charge for those people who use my referral link. My referral link earns a % of fees when people market out of a position (every other ordering cycle it reduces it’s skew, and on either layer of stoploss/takeprofit it first reduces it’s skew back to delta-neutral then all the way down to 0 position). I believe in Free and Open Source as a religion – and while the final bot that we end up putting into production will have configs and values fed to it by our AI at Coindex Labs, the Intellectual Property for the bot without AI is mine and I decide to share it. There would need to be literally tens of millions of dollars on this bot for it to hurt anyone else’s edge.

While I’m asking for people to sign up for referral links, I’ve closed the repository with the bot until after people provide proof they’ve signed up on the referral link. While the bot was 100% open-source before, I noticed that 40 people cloned the repository in one day while I only received maybe 2 referral link signups – which isn’t sustainable. Once you sign up on the referral link, you’re free to review the code in full or have someone audit it.

You need to enter your key and secret to the testing.py file for Deribit or bitmex2.py file for BitMEX for the bot to function. It never ever sends these keys anywhere other than to the exchanges, and when it’s sent to the exchange it’s hashed into a signature that people can’t figure out. Moreover, on an exchange like Deribit so long as the keys aren’t withdraw keys then there’s very little risk in using them in the first place.

Moon!

https://github.com/DunnCreativeSS/deribitBitmexMarketMaker_ByFunding

A Perfectly Symmetrically Delta-Neutral Market Maker

Check out Coindex Lab’s symmetrically delta-neutral market making bot!

Great news! It’s available here: https://github.com/DunnCreativeSS/deribitBitmexMarketMaker_ByFunding

(please do sign up under my affiliate link, though!)

How is this fantastic?

Hey Deribit,

I did about $200k volume on BTC perp and futures last 24hrs on $70 balance.

and >$6million total.

my CEO has done $12m

We’re increasing our market maker first to $5k balance next week on a separate account, next pilot will be $150-$300k and then our first round of funding will be ~$50m (which should be a significant amount Deribit but also diversified a bit).

We’re wondering if we could negotiate a preferred fee rebate on top of the standard offer, to provide this kind of liquidity? Even a slight improvement on rebate would be exponential for us.

Jarett
Chief Liquidity Officer
Coindex Labs

Also,

And this is just me talking out loud:

https://blog.deribit.com/partners/

We could certainly provide an endpoint, websocket or SaaS for market making signals if we were to arrange an agreement.

You can follow our livenet market maker on Ryan’s subaccount bot_POC on (redacted email) or here: http://jare.cloud:8080

How do we negotiate a partner status with Deribit, while we’re preparing to go live with our fund?
 
-Jarett
Chief Liquidity Officer
Coindex Labs

The bot checks funding rates on Deribit among perpetual and futures, and longs whichever pays the other. When longing or shorting perp and shorting or longing futures, it 4x the longs on perp in ordersize so that – effectually – at any point it should be near 0 total position. This effects a situation where upwards or downwards movement in market doesn’t affect the returns, and you effectively collect on fees + the convergence of your perp and futures in cash n carry arbitrage + the spread.

Isn’t that beautiful?

GOOD NEWS! dexArb is Ready for the Masses! Free (with extra fees) and Subscription (1% more arb opportunities) Available!

View this article in it’s original form on Jare.cloud!

GOOD NEWS!

EDIT: The arbitrageur on totle was a bust their API can’t handle concurrent requests. So I rebuilt the whole thing for 0x swap API but they don’t let me specify a fee for me so there’s no more free option for the bot. Good news is it checks price on 57 tokens every 5.7 seconds!

The round-trip, eth -> token -> eth or triangular arbitrage [bucket of tokens I don’t mind holding] -> token -> [bucket of tokens I don’t mind holding] transactions are BEHAVING AS EXPECTED!

https://etherscan.io/tx/0x013df07c3d36567690059d628eec95e2d939fdc1c6d0f629ebbd5ecef5f2e997

What this means is that when we run my FREE arb bot, it identifies possible trade routes and then acts on them as soon as it notices them. This means that otherwise un-arbitraged trade routes are now available for fun and profit, using any combination of dividend-earning or high-liquidity coins you see fit!

Check out the top performers in all of decentralized ethereum ecosystem’s arbitrageurs: https://stat.bloxy.info/superset/dashboard/arbitrage/?standalone=true

Want to know more? Check out my articles leading up to this resounding success:

https://medium.com/@jarettdunn/shower-thought-can-i-resurrect-and-old-failed-decentralized-exchange-arbitrage-bot-id-built-81eebb5fbae7

https://medium.com/@jarettdunn/a-few-stokes-of-genius-dexarb-a-free-open-source-triangular-ether-dex-arbitrage-bot-b0ea3b49f7a6

–> The FREE option institutes a 0.25% fee for me on each trade, which also adds on the dex aggregator’s 0.25% fee. They don’t have a fee if I don’t have a fee. If you count all the trades in the swap-then-swap to get arbitrage profits, that’s 1% on top of the exchange’s fees. For the low fee of 1 ETH per month I will provide an extra-fee-less version of the bot. This is helpful when trading larger volumes! <–

The sad news is that the dexArb Github repo has been made private. This is to ensure the profitability of my revenue structures. The good news is that the dex aggregator in use, Totle, has offered to audit the source code to add their credibility that there’s no nonsense going on with anyone’s private keys.

Want to join? Check this new dexArb Telegram group: https://t.me/dexArb

Binance HACKED! Two Trading Competitions, My Share of 40k and 10k BNB Prize in <3 Hours! Free and Open Source Bot Github INCLUDED!

View this post in it’s original form on jare.cloud!

Binance is running a competition as we speak for 50k BNB – 40k for spot/margin, 10k for futures – if you trade more than 1 BTC in notional value in either bucket!

Lucky for me I already have a Binance futures market maker – and with a wee bit of edits to the code, it ran fine on margin 5x, too! I ran the futures on 100x and orders of 0.002 BTC and it won the futures contest in ~1hr.

https://drive.google.com/file/d/198dAxfEfmPxxe696t7wnsN3ijBLods4h/view?usp=sharing

Check g543 for the total. Woo!

This bot lives here, if you’ve read this entire article then feel free to sub my github https://github.com/sponsors/dunncreativess if you win this comp! https://github.com/DunnCreativeSS/binanceFuturesMarketMakerPublic

I was +0.5% for most of my bot run on futures, ended at -1% on equity.

Write me jarettrsdunn+git@gmail.com for the margin trader, and get access to the 2nd half of the competition – 4x the total!

I was down about 21% – of my whopping $46 – on margin.

Woo! Binance HACKED! Free and Open Source Software!

I spent about $13 and three hour’s time to win two Binance trading giveaway competitions. I think that’s gotta be a record! Can you beat it?

A Few Strokes of Genius: dexArb, A Free, Open Source Triangular Ether Dex Arbitrage Bot

View this article in it’s original form on jare.cloud!

TL;DR: pre-alpha, almost-working aggregated dex arbitrage bot is FOSS and lives here: https://github.com/DunnCreativeSS/dexArb

Spanning 12+ exchanges:

https://api.totle.com/exchanges

This arb bot was the proceeds of me getting hired by the dex aggregator Totle a long time ago. While the engagement didn’t work out, they funded creating a dex aggregated arbitrage bot with 2+ ether as part of the interview process.

Want it?

Here it is!

const io = require('socket.io-client');
const request = require('request');
var socket = io.connect("https://socket.etherdelta.com", {
    transports: ['websocket']
});

//starting bal 0.329945342678081181 Ether






socket.on("connect", function() {
    socket.emit("getMarket", {
        user: "0x8ebA329784974b96EC6293DD83bf462651BB75E6"
    })
});
const xpath = require('xpath');
const parse5 = require('parse5');
const xmlser = require('xmlserializer');
const dom = require('xmldom').DOMParser;

var Web3 = require('web3');
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
var totleabi = JSON.parse('[{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"handler","type":"address"},{"name":"allowed","type":"bool"}],"name":"setHandler","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokenAddresses","type":"address[]"},{"name":"buyOrSell","type":"bool[]"},{"name":"amountToObtain","type":"uint256[]"},{"name":"amountToGive","type":"uint256[]"},{"name":"tokenForOrder","type":"address[]"},{"name":"exchanges","type":"address[]"},{"name":"orderAddresses","type":"address[8][]"},{"name":"orderValues","type":"uint256[6][]"},{"name":"exchangeFees","type":"uint256[]"},{"name":"v","type":"uint8[]"},{"name":"r","type":"bytes32[]"},{"name":"s","type":"bytes32[]"}],"name":"executeOrders","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"handlerWhitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_EXCHANGE_FEE_PERCENTAGE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"proxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]')

var totle = web3.eth.contract(totleabi).at( "0xd94c60e2793ad587400d86e4d6fd9c874f0f79ef");
web3.eth.defaultAccount = web3.eth.accounts[5];

socket.on("market", function(data) {
   
    setInterval(function(){
    console.log('lala');
        for (var d in data['returnTicker']) {
            fun(data['returnTicker'][d], data['returnTicker'].length)
        }    }, 60000); 
    setInterval(function(){
    console.log('lala arbbing');
       
        arbbing = false;
    }, 500000); 
    console.log('lala');
    for (var d in data['returnTicker']) {
        fun(data['returnTicker'][d], data['returnTicker'].length)
    }
});
var arbbing = false;
var aTotal;
var bTotal;
var total = [];
var total2;
async function fun(d, t) {
    setTimeout(function() {
        var req = {
            "operationName": null,
            "variables": {
                "address": d.tokenAddr
            },
            "query": "query ($address: String) {\n  token(address: $address) {\n    address\n    name\n    price\n    priceChange {\n      change1h\n      change24h\n      change7d\n    }\n    bestPrice {\n      bid\n      ask\n    }\n    orders {\n      asks {\n        price\n        volume\n        exchangeId\n      }\n      bids {\n        price\n        volume\n        exchangeId\n      }\n    }\n    exchanges\n  }\n}\n"
        }

        request.post({
            url: 'https://services.totlesystem.com/graph',
            body: req,
            json: true
        }, function(error, response, body) {
            if (!error && response.statusCode == 200) {
                if (body.data.token != null) {
                    //console.log(body.data.token.bestPrice);
                    if (body.data.token.bestPrice.bid > (1.03* body.data.token.bestPrice.ask)) {
                        //console.log(body.data.token.name + ' arb!');
                        //console.log(body.data.token.bestPrice.ask / body.data.token.bestPrice.bid);
                        aTotal = 0;
                        var aPrice;
                        var acount = 0;
                        for (var o in body.data.token.orders.asks) {

                            if (body.data.token.orders.asks[o].price <= body.data.token.bestPrice.bid) {
                                aTotal += parseFloat(body.data.token.orders.asks[o].volume)
                                aPrice = parseFloat(body.data.token.orders.asks[o].price)
                            }
                        }
                        bTotal = 0;
                        var bPrice;
                        var bcount = 0;
                        for (var o in body.data.token.orders.bids) {
                        	
                            	   if (body.data.token.orders.bids[o].price >= body.data.token.bestPrice.ask) {
                                bTotal += parseFloat(body.data.token.orders.bids[o].volume)
                                bPrice = parseFloat(body.data.token.orders.bids[o].price)
                         }
                       
                        }
                        total2 = 0;
                        if (aTotal > bTotal) {
                            total2 = aTotal
                        } else {
                            total2 = bTotal
                        }
                            var token = body.data.token.address;
                            var name = body.data.token.name
                        	total[token] = totaled(total2, bPrice);
                        if ((total[token] * bPrice) > (0.01 * Math.pow(10,18))) { //100000000000000000
                        	if (arbbing == false){
                        		                        	console.log('arb!')

                        		arbbing = true;
                        		//console.log(body.data);;
                            console.log(token);
                            console.log(name);
                            request("https://etherscan.io/address/" + token + "#code", function(err, response, body) {
                                if (err) {
                                    console.log('err');
                                    console.log(err);
                                } else {
                                    // do stuff with body
                                    const html = body;
                                    //console.log(html);
                                    const document = parse5.parse(html.toString());
                                    const xhtml = xmlser.serializeToString(document);
                                    const doc = new dom().parseFromString(xhtml);
                                    const select = xpath.useNamespaces({
                                        "x": "http://www.w3.org/1999/xhtml"
                                    });
                                    const nodes = select('//*[@id="js-copytextarea2"]/text()', doc);
                                    //console.log(nodes);
                                    var contractABI = JSON.parse(nodes);
                                    var contract =  web3.eth.contract(contractABI).at( token);
                                    if (contract.stopped){
                                    var stopped = contract.stopped.call();
                                    if (stopped != true){
                                    console.log(body.data.token.name + ' arb! ');

                                    buy(token, total[token], contract);
                                }
                                else {
                                	arbbing = false
                                	console.log('stopped! eos?')
                                }
                            }else {
                            	console.log(name + ' arb! ');

                            	buy(token, total[token], contract);
                                }
                            }
                            });

                        	}
                        }
                    }
                }
            }
        })


    }, Math.random() * t * 200);
}
async function buy(token, total, contract) {

    var reqbuy = {
            "buys": [{
                "token": token,
                "amount": total
            }],
            "address": "0x8ebA329784974b96EC6293DD83bf462651BB75E6"
        }
        request.post({
            url: 'https://services.totlesystem.com/suggester',
            body: reqbuy,
            json: true
        }, function(error, response, body) {
            if (!error && response.statusCode == 200) {
                console.log(body);
               var tx = totle.executeOrders(
                    body.response.orders[0],
                    body.response.orders[1],
                    body.response.orders[2],
                    body.response.orders[3],
                    body.response.orders[4],
                    body.response.orders[5],
                    body.response.orders[6],
                    body.response.orders[7],
                    body.response.orders[8],
                    body.response.orders[9],
                    body.response.orders[10],
                    body.response.orders[11], {
                    value: (body.response.ethValue),
                    from: "0x8ebA329784974b96EC6293DD83bf462651BB75E6",
                    gas: 400000,
                    gasPrice: "6000000000"
                })
               console.log(tx);
               approve(tx, token, total, contract);
            }
        })

    
}
function totaled(total, price){
 if ((parseFloat(total) * parseFloat(price)) >(1.05 * parseFloat(web3.eth.getBalance("0x8ebA329784974b96EC6293DD83bf462651BB75E6")))){
	var atotal = total / 1.3
	totaled(parseFloat(atotal),parseFloat(price))
} 
	return parseFloat(total)

}
async function approve(tx, token, total, contract) {
	web3.eth.getTransaction(tx, function (err, receipt) {
    if (err) {
      console.log(err);
    }
    console.log(receipt.blockNumber);
    if (receipt.blockNumber == null){
    	setTimeout(function(){
    		approve(tx,token,total, contract);
    	}, 30000);
    } else {
	var approve2 = contract.approve("0xd94c60e2793ad587400d86e4d6fd9c874f0f79ef", (total), {
                                        from: "0x8ebA329784974b96EC6293DD83bf462651BB75E6",
                                        gas: 250000,
                                        gasPrice: "6000000000"
                                    })
	sell(approve2,token,total,contract);
    }
    })
}
async function sell(tx, token, total, contract){
	console.log(tx);
web3.eth.getTransaction(tx, function (err, receipt) {
    if (err) {
      console.log(err);
    }
    console.log(receipt.blockNumber);
    if (receipt.blockNumber == null){
    	setTimeout(function(){
    		sell(tx,token,total, contract);
    	}, 30000);
    } else {
    	arbbing = false;
        var reqbuy2 = {
            "sells": [{
                "token": token,
                "amount": total
            }],
            "address": "0x8ebA329784974b96EC6293DD83bf462651BB75E6"
        }
        request.post({
            url: 'https://services.totlesystem.com/suggester',
            body: reqbuy2,
            json: true
        }, function(error, response, body) {
            if (!error && response.statusCode == 200) {

                console.log(body);
                totle.executeOrders(
                    body.response.orders[0],
                    body.response.orders[1],
                    body.response.orders[2],
                    body.response.orders[3],
                    body.response.orders[4],
                    body.response.orders[5],
                    body.response.orders[6],
                    body.response.orders[7],
                    body.response.orders[8],
                    body.response.orders[9],
                    body.response.orders[10],
                    body.response.orders[11], {
                    value: (body.response.ethValue),
                    from: "0x8ebA329784974b96EC6293DD83bf462651BB75E6",
                    gas: 4000000,
                    gasPrice: "6000000000"
                })
            }
        });
    }
})
}

Note: this doesn’t work. Neither does backwards engineering it to work, work. The Totle graphql endpoint returns bid: null ask: null for bestPrice. Woe!

Now, this bot didn’t work in it’s original form. The transactions were all reversed or otherwise died in a fire. Don’t believe me? https://etherscan.io/address/0x8ebA329784974b96EC6293DD83bf462651BB75E6

This is because these orders on various dexes ALREADY EXISTED at runtime. Because there’s a delay updating order books, these orders would remain long after some other arbitrager armed with a higher gasPrice and in a quicker fashion datetime wise acted on it.

Check out the earning potential of arbitraging dexes: https://stat.bloxy.info/superset/dashboard/arbitrage/?standalone=true

Check out arbitrage action over the last 90 days. . . there’s money to be had, here.

Now, the first stroke of genius? Index those trades that exist at runtime, ignore them, and re-consider those tokens only after they exit arbitrage-able state and re-enter. This way, we act on only brand-new opportunities.

if (arbWins[token['symbol']] < 0.05 && sym[syms] > 0) {
                                                try {
                                                    ignore.splice(ignore.indexOf(sym), 1)

                                                    console.log('length ignore ' + (ignore.length))
                                                } catch (err) {

                                                }
                                            }
                                            if (arbWins[token['symbol']] > 0.05 && syms[token['symbol']] == 0) {
                                                ignore.push(sym)
                                                console.log('length ignore ' + ((ignore.length)))
                                            }
                                            if ((arbWins[token['symbol']] > 0.05 && syms[token['symbol']] != 0 && !ignore.includes(sym))){// || first && arbWins[token['symbol']] > -1.5) {
                                                first = false
                                                console.log('arb! ' + sym)

Check it out…. genius.

Now, I built a bot surrounding this that trades ether -> token -> ether, on the Totle API. The benefit of Totle API is that it’s connected to all those exchanges, and I can code in a % of the fees (equal to Totle’s %, at 0.25%) for myself should anyone use my bot.

Then.. .all of a sudden.. .as I was publishing the newest version. . .another stroke of genius! Let’s load from a list of tokens I don’t mind holding, see which one I have the highest $USD value in on my wallet (including ETH) and trade with that. Instead of eth -> any token -> eth, I now have:

[“ETH”, “DAI”, “wBTC”, “SAI”, “cSAI”, “MKR”, “USDC”, “UBT”, “KNC”, “USDT”, “LINK”] -> any tradeable token -> [“ETH”, “DAI”, “wBTC”, “SAI”, “cSAI”, “MKR”, “USDC”, “UBT”, “KNC”, “USDT”, “LINK”]

This maximizes the chances I find a profitable arbitrage opportunity. If I edit my strategy to only consider cTokens, Aave tokens, etc. DeFi tokens, then when my bot isn’t trading it’s earning DeFi interest. Genius!

Now, the bot is in an unusable state.

Hi again,

Sorry for all the notes!

I rewrote everything in Node and now tx are going through.

I query /swap for x amount ether -> token, and get an approve and swap tx back.

I then query /swap for token -> back to ether, and get a tx back.

Here’s a sample of three:

1. approve https://etherscan.io/tx/
0xc572a3dcff2826afdc315a32e98d
a4cd9f8203c5a650ffc5fffc18326679ec8f


2. swap token -> ether (Failed!) https://etherscan.io/tx/
0x222229cee345f5dc493aaa15299b
48ca384a9ef0847615317e92354c502bfefa


3. swap ether -> token, with an Ether value (Failed!) https://etherscan.io/tx/
0xb508a9f7e7f5610b2d5a6184740e
4064a3d9cf0447014950fe90de53bca70450


Firstly, am I doing these in the right order? I assume I’d want to trade my ether for token, then approve, then swap back.

Secondly, why is the ether -> token for 0.05 Ether failing?

Thanks,

Email to Totle reps

The ‘rewrote to javascript’ bit has a bit of a backstory. Read previous email:

Hi folks,

running into some issues with python web3. 


after version 4.x, it requires proper capitalization for eth addresses.


https://ethereum.
stackexchange.com/questions/
51148/how-can-i-simply-sign-an-ethereum-transaction
 


this was apparent at first when the ‘from’ address was wrong.


from field must match key’s 0x24E7be68c63B6707f567b933Bdae
546c7C94Ff37, but it was 0x24e7be68c63b6707f567b933bdae546c7c94ff37


I fixed this by manually entering ‘from.’


Now, Transaction had invalid fields: {‘to’: ‘
0x3b21d6d25e7f036c8277efe9a7ebf17ca12fe4f6′, ‘value’: ‘50000000000000000’, ‘gas’: ‘2250000’}


Note the proper capitalization: https://
etherscan.io/address/
0x3b21d6d25e7f036c8277efe9a7ebf17ca12fe4f6



I tried rolling web3 back to 3.16.5, but got errors about the rest of my standardized code.


Is there a way for the totle API to return the proper eth addresses?


Thanks, 

I wanted multithreading 🙁

So, we now wait for 12ish hours from now when folks’ll be in the office on Monday to continue writing the bot – for fun and profit.

Want to run it now? You might lose some $ gas when it does find arb transactions it acts on, but you have all the opportunity to run it and see the pending git commits fixing the Tx:

https://github.com/DunnCreativeSS/dexArb

Like it? Fork it! Star it! Better yet, follow the ‘Sponsor’ button and sign up for some monthly tokens of appreciation for myself, wouldya?

What’s it look like, in production?