New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Special Workshop: Low Latency Trading with Bybit in RUST | 8th October 2022 | 10:00 am - 2:00 pm |

Ethereum MalaysiaMon, Oct 9, 2023, 12:00 AM

Hands-on-step-by-step workshop on low latency trading bot building.

Transcript

so [Music] finally see that for me you guys have seen me I don't thank everyone for coming a couple of things at the quarter if you don't have one already yeah and finally we will also provide lunch so whoever is not eating let me know so that we can we can buy the substitute amount of food so without further Ado let's go yeah okay yes I will pass hey guys very nice to meet you all today so before we start just one more time on the preparation side make sure you have set up everything set appropriate otherwise you cannot get the information you cannot build the code and you basically all the demos or Workshop yeah you cannot run so if you have no setup please take the photo uh because afterwards we will go to other presentations like is it good okay okay then so first of all thank you if KL and every child sponsoring and inviting us to be here uh so I'm Wilson a team and Leo uh so uh just few words about us so we are status we are the first multi-training order book tax uh we are derivatives exchanged and we currently what we are building is offering I'm a cross training and multi-train trading uh solution so if you guys are interested uh feel free to follow up uh Twitter and our beta test as it just went live last week so later on team will also do our demo on on our platform after all the content stuff so I'll pass the time to the team and he will be handling all the uh demo and other clothing Parts okay so hi everyone I'm Tim so let's start for a minute so our topic is about slow latency trading with 5B in rods so we will cover all keyword here so basically we will intro we assume you have almost no experience about Russ about algo trading and after this Workshop you can start to build your own or the first aircraft shading ball so in this Workshop we will increase feedback why would you choose the rust and how to use rust to start some elbow shading and after that we will provide you some low latency trading advice so let's start so the first question is why Russ we can have many other language and according to this step overflow developer survey which is the seven years the most loved language and it's also the most World technology and in the crypto world we know that two of the famous non-uvm chain Solana Nia are all both built in Ross and we believe that Russ will be a more and more important in the crypto world and then what is the benefit to use rods the the major advantage of rust is about the memory safety Ross have a very unit in size about the memory management system called ownership it's very unique I don't think you can find in other languages after the this ownership systems we have a very unique property about it first Redstone needs the garbage collection like the Java or a python and it also not allows any Tango reference and also it's not allowed now in rocks according to the innovator about the notes now it's the billion dollar mistakes I think all of us will be recording in other languages we will use this kind of now or point a loss but when we have mistakes you need to take many time or it's almost hard to activate this kind of problem and in so why we choose was because in the compiler time it or already brought most of them you almost can't you are not able to write this kind of bug because in the capacity you have a very restrict rules and it's got it so and that is also about a type safe language what does it mean is about requires you it's not a dynamic language you can't change the type so when you're in the comparable times it will force everything is correct so the or the only difficulty in for us is about you have to pay more worth our time in the compile time when you write Cooks but after that the performance of rust is fascinating it's almost as fast as C plus plus according to their team they think that the rust is about you can think it's about a C plus plus like the memory management system and some type a survey safe and safe and after that you can use or that's why the crypto will love the rust so much and this is the why the most Powerman thing is the most loved and most want language so and because I guess most of you might not familiar with Russ so here is my own setup and I really suggest suggest you you guys can install these times use the vs codes and install this kind of extension here with this kind of extension it will make your life way easier yeah so and I'm not sure do you guys have some experience about the elbow shading so here's the three favorite basic or you almost it's almost necessary for you to write ago shading script in rocks first one is the Tokyo package it's the async library in Ross I think almost the async stuff in Rust it depends on the Tokyo and second is the ht's clients and it's helped you to send the HTTP request to the and the server or the exchange to post your order and or get the information actively and the last package you want is the website age so we also and actually I I asked this kind of package into the dependency so you can use it just build your AdWords code so okay now I guess we have some base understanding about us so we will after we introduce about some basic information about Ergo shading we can we will start do some coding and get the information in the Bible engine so the and I think um I I have to make sure everyone have registered the Bible testing and test net accounts please use the testing accounts and we will pay you if you use your normal account okay so yeah and for the five piece uh if you want to use the agriculture lens you have to create your API key and they require to you set up the 2fa before you install the the API key and the last thing has you have to ready the use you should get the API does before you call them uh in this Workshop we won't include any all the API function for you we will just list something that I think you'll need it for the remaining thing you can find the API Dot and just change a bit Cooks you can guess what you want so okay uh oh I will talk about I was just a few words about what kind of or Techni audio needs in for elbow shading you need to notice the rest API how to post the HTTP request to the engine and how to decode the HD regress and get what you want and for the rest API it's a kind of the active action you will ask the engine to get what you want or do your azure but this actually every exchange has caused the raise limit you can't do it unlimited server you only allow us to do 50 requests per two minutes so if you want to do the real low latency or high frequency trading they're probably not enough for you so you have two ways to solve it first and go to their server if you pass certain constraint line you post 2 000 order per day and I guess it feels 0.01 percent of order and or contribution liquidity to them you can ask them to really increase your waste limit but because I assume you guys may not have too much experience and am I not able to do this kind of the English rest image stuff so and we will use the websocket websocket is a kind of the passive way to get the information basically you can just connect to the engine and the engine will give you the data for example when you subscribe the chase Channel you will receive every Chase message then you it will just pass to your machines and after you utilize the organizing the code it and guess like or maybe or you can find why I ever go to analysis you can know how to process the data and post your order to do your angle shading so basically you you have to note the webs API stuff and the websockets so now we can start the first chaining oh oh I forgot one thing I should demonstrate how to get the API key so can you see oh that metal okay so please be careful you should go to this test net retain those response if you do it in the main light okay so go to the Past net I asked I assume you guys have the test testing account already and you set up the tofa stuff so we at this moment we can create our new key and is this demonstration actually you have to raise the permission for the key and for this Workshop I think you can just click the permit all permissions and disable the wallet free actually you can include it but you have to be well it's not really useful in this Workshop so you should create a key and at least you can you should paste the order and we will use the spots as the example so and after oh it's a demo and okay I will create a key I think everyone can create key here so an API of indicator so after you enter your 2fa pass it you will get your key information so in this case it will show your API key and the secret please remember is your secrets will not able to access or you can't see get the secrets again after you kept this understood so and for the security you don't let anyone to know your secret that's why it's different right okay so light so we can copy here uh okay maybe we can place oh can you assess the code here so um after you get your API keys please go to this uh con West condenser under the SAR file here so and when you enter here please pass your key here oh sorry but actually I have to warm you never do this thing in your real Shader and your real code it's our very best example actually because but it's easy to do and actually you should place your key to other places like uh environment variable or something else and never do this code and write your key and sequence in your code here it is just a demo and test now so I just do it here because when or maybe you you have to put push your code to a kid or something the other guys can get your key and secret and do and use your accounts whatever they want it's so never do it in the real code but these are worship so yeah so at this moment you create your own API key and you can start to the especially at this moment you can just really post your order by virus or something and because I'm not sure do you guys understand the rust so I will have a very brief introduction about some basic syntax that you might need in this Workshop so and okay so for us when you when we want to add we will use the keyword latch and X and Russ is just like I mentioned before Ross is a types safe language so you you you should raise your ad the type for your variable here for example is 32 u32 is means the unsized integer with 32 bits and what is really care about the type so actually it supports like u32 u64 and ux quantity a130x so you have to choose your uh the type wisely and also the rust is say I really care about the type so you can do something like this for example I want to do a flow 32 F32 so I want to do something like this it will it will have the error for you because Russ will never convert your variable in this case one is an integer it wouldn't confirm to the flow point to you so you have to do like 1.0 or just one thousand something and the last thing you might need to know is about the string and what is inconveniencing when you do the coding but you will after you go through this whole learning curve you will have very good understanding or you're very familiar how to work with it so it's actually it will improve your coding skill in other language every village so here is something that we will use in raw errors for and Define available with the string called the string and from It's Kind it's a bit similar in the C plus so I guess we have included some basic information for the rust scene test and the remaining effect if you want to learn more here is a web that I really suggest recommend for you it actually includes everything and it's really well called well right here it's called the rust spot you can just go go rosberg and you can get it so we can really go to start the how we can assess the thing to the Barbie server so please go to here the example our first example HTTP get request so uh I already write some basic stuff for you so you don't need to worry about it and so we will go to the part one the simple get request s anymore okay so before you start uh we have to start to talk so please go to the uh so please go to the GitHub uh each other anyway just go to the GitHub report and then at the last section there was a uh a line that uh said during that uh workshops something like that and there is a sample code that asks you to start the docker and he started within the directory and then uh you can you will be able to run the code something like this sorry for a moment s excuse me over here safe and close your language available possible India okay yeah or just disable the wallet stuff okay just copy this line the docker run blah blah blah and run it in the terminal within your directory and then you will be able later on when we compile the code then you'll be able to run it and this line also means that uh we attach your file system uh within the source the source code that you download early on into the docker so when you edit the code in the in the your current PC or Mac and then all the code will be updated within the docker so we don't have to worry to send the all the stuff back to the docker and I'll let uh if everyone is good then maybe we can go forward so any everything is okay okay then then we move on okay okay so let's get back to here the code here so and now I will teach you how to use rust to connect the Barbie server and get the API you want so the first thing you have to do is go to the Barbie API dot of course and for example when I let me see where I want to get the some take 24 hours for example when we want to get some API here then we should find this path and the method here then actually I Rise the temp pay for you so you can just simply input the path here and let's check this and here you can see is the uh the requirement or the thing you want to filter out and after that you will receive the response from the Bible server so I already wrote some here's a template and when we want to use this kind of template to get other requests you can just for example like go to the another request you want for example maybe I want to go to the audible then I will check this path it's like also I get and this is the you are at the platform then you can just replace here or it's just for example in this case a chrome dev then you should paste growth def in your here and check the the parameter maybe you want to filter out for example when I wanted to get the Bitcoin usdt uh audible then I noticed that the symbol is uh required so we have to in SD symbol here so what would we get after we run the code oh maybe I can introduce this for you for us we will use the cargo for in the keyword in the terminal and when you want to run the course and because I wrote this source with as a library or package okay whatever you want you name it so we will run this kind of code in the example directory here so here is what we will use cargo run okay one example and the file name okay cargo rum at oh oh yeah oh yeah yeah oh sorry then the compiler will and we run your course here for example I use I want to guess the tech 24 hours data in F40 Bitcoins usdt products and after I get and you will receive the data and how do we understand the data you can go to the uh there are API dots to find it out it will have a favorite details data for you and you can test the data here to compare for example for this moment uh I'm not sure what is L here so you can check here is the lower price in this techa and actually we can do a a almost all get this keyword get for this kind of method so maybe we can try another language or any other API for you for example when you want to cut the other books then we know it's a public Pro Def and we can call PM paste in the cup or this time I wonder if you then we can compile it so now we can get the if we are multiple now so oops okay I guess we can know how to use the Gap method in the rust now and you can just use this kind of the template to do it the next thing and when we do the Ergo shadings sequential regress is we don't want to do it because it's really slow what does it means like because the method is sequential is when you finish a and then we start B and then step C is and when we use the HTTP request you have to wait a lot of time you send the request to their server and need to weigh back until they receive the message usually it may take at least 10 or 100 and milliseconds and in the low latency or the high frequency tradings it's really very bad you you are just waiting with your time and can't really slow your thing so I had actually this kind of template is implies the concurrency idea concurrency means that you you just select the example I just told you you start a after you finish a then you stop B after you've got the B you will start C what does alcoholism means I start a and I will automatically stop B until I get the response from a then we will process the a stuff so I can ask the for example when I want to assess some data from the Bible server I would like for example send 10 requests to the puppy server I don't need to raise every database to do the next request I will send 10 at the same time and after I receive all 10 then we can do the other thing else so actually at this example we will you will see this kind of the keyword update and the Tokyo Tokyo is the package I mentioned before it's about uh implies the a synchronized idea or the concurrency idea for this kind of code so you can see the follow example we also want to get to requests but this time I will don't raise the first request or the second request like the first example I will send the request and then raise and decode the data but in reality when we use the concurrency idea we will just send the data we don't need to raise it we will ask the us to join this request together then we will wait until we got everything else and in practice it will at least fast few times so actually I think it's something that you must know when you do your Echo shading so yeah so let's try it or just maybe I can comment out the first part I'm sorry let's go yeah oh cow foreign state actually connect that way because if I'm always falling [Music] what do you mean you mean this variable Wi-Fi let me doctor oh yeah yeah this uh because yesterday we don't notice the Malaysia is it's hard to assess the 5B server so we might have some manifest issues here yeah okay so I I wrote it before it is so uh I hope you guys have found your own way to assess it okay okay whatever so actually it's kind of saying earlier we will use the async method in the following cook so so let's just let me go so at this moment we know how to use the address to get the data from the server but the key thing we want to do is actually spacing the order to the Barbie to get your real Ergo shading not just receive the data right and I already do this the authentication part for you in this source code here so if you are interested then you can check here how to how to handle the authentication part for Rusty and but in this Workshop I think we don't have too much time to cover all the thing to how to reprocess the your how to handle your uh use your API key and SQL to generate the signature for authentication so you just can use it and so the next bank here is we will use go to the Post order so I I have raised the function for you so it's easy to use I suggest you can if you want to build your own really reuse air conditioning you should Implement by yourself and but you can like use it use micro as an example here so for example in this moment we I want to post an order for the beacons and some oh here's something I have to tell you this some stuff and I hope all you know what is the limit order at Market order limit order is you you in input the price for the limit order and it will face at that price the market order is just gets uh you match in the audible to get the best price so for the market order you don't need the I need to input the price for us it as I mentioned before it don't it we don't have the null idea in this case so how can we choose to sometimes we will pass the price in the code but sometimes we don't we'll use something called sum stuff when when you have the price here it will tell the machine hey this you can find the price in this stuff but what if this no then it will not pass it for example as the sale mobile keyword no no I haven't forgot Stan foreign for example we can run this example see how it is I post all the and we can go to the spot Market I post I and we use the sport as the example we have some Network problem here let me try to record it go out of high connection so terminal cup now you can see the order is entered the Barbie server you can just it's a really limited by side the price and the thing you want so at this moment congratulations you can already post order and get the information from the Ross API server and for the similar things I will I have Rose to cancel order with without some like the uh or disk with kind of similar to the uh the get apis hard but it's kind of the post stuff so um Wi-Fi so and when we write a what this kind of costume it will post your order and cancel so you can now how to control your order in your own code and right here or maybe you can CH and this moment you can Choice a bit here so if you have any question maybe you can ask us and maybe you can just try to play some order and play around with it foreign okay I changed uh I did some City thing here and so this is how we paste the market order you just use the type and just are not I confused with something else sorry so can everyone post some Order In The Raw server sorry oh and you can see that cancel all the example here so any question or everyone is good so it is [Music] it's not like uh unless you use and then if you use so also and we can't control everything here so you have to check the API dot to see how much parent power you can as in the regress and you can just do the similar thing here restart the pose order yeah so you can find here the post order stuff and see what you can add and but however you have to modify micro updates my function may not support this and you can you can like change a bit then you can ask the parameter you want yeah so I guess everyone is okay then we can go to the next step uh or maybe just them you so we after that we can apply the concurrency idea also for the Post order and before we at least and in Hong Kong are you staying my own mat connect the big puppy server with and without without the concurrency the late I need like 100 milliseconds to paste an order which is quite slow but after I implies the concurrency like for when I post free order the latest is still 100 milliseconds that we can't do anything but the total time for post free order will decrease from like 300 milliseconds to like 150 or 120. it can drop a little a way more so that's why I call is almost necessary for you and I think I wrote the so yeah in this example we will post like total free order with the other some parameter and your everything can change then so I'm going back top um foreign okay yes and we will use the handle it's kind of how we join all the data and in this kind of example and after we prepare the order we want to post and then we will use our Vector to contain all of them we will ask the Russ to do its con concurrency then after this cost and we at the rust we receive all the data here or the file data but actually at this moment the order is already entered by B server and the remaining stuff is how you process or change the data and order status like have you posted or what is the or the ID after you post it so and the third part I I think are small ex comparison between the SQL and sequentials logic and concurrency things I hope I can run this here to show you why we must got the concurrency stuff let's see how can we do it okay you can see I post 10 order for the sequential Parts the it takes about five seconds and for the uh for the concurrency methods I only just takes 60 hundred milliseconds and by the ways I am using vpns I think it's Tokyo yeah it's Tokyo it's and if you can use some I really cover this co-location thing stuff later for how we actually achieve the low latency when you finish everything you can minimize your request time is about like 10 milliseconds if you do everything well you can minimize many seconds yeah so after this at Workshop I believe you can paste your order with like under 10 milliseconds if you want to do a bit better then you have to pay a lot of you have to pay other calls so this is the best way and simplest way to get uh with I think it's almost good enough for you to do the latency stuff so at this moment we cover us how to get the information from the Bible server how to post the order and how to apply the concurrency to minimize the whole time it can Earnest time for you to when you build your own Arrow shading light analysis pass then for example in this case you just save form seconds to you to do some kind of analysis but actually I don't think your ego should be complicated foreign then we can go to the next step is about we can apply the web socket here so for the websockets we can here's some ideas for you to how to do your display advice you see and similarly you should apply and add your key and sequence here so you can connect to your private websockets half and I think it happens to most of exchange there you have two kinds of the websockets one is private one is popular for the Public's websocket you will usually get the data from others like for example for example Chase if we have a ticket or a Chase message and enter your machine and in this case sometimes we only care about what we did in the exchange line have my money entered the exchange have my orders match I have my order entered the puppy Circle so in these times we will miss the private websocket stuff and here we I will teach you how to use this package and how to inject your key and sequence to stop your restocket and in the following example here we will use uh uh how I say oh because when we in the real case when we use the websocket it might have tons of different kinds of message that I mentioned it might be about you I can or change or something and you might want to do different action to different message so I I wrote an example for you it's really dumb example but it can either change what I want to say when this example it will mention that when you receive a some kind of private message then you will just post another order here and when we when the websocket received like the paying message and Paul message or some accounts informations and just pins it out so and after that we will start before we enter these steps you just construct your websocket but you haven't applied it then when we do this looping stuff it will continue to run your websockets program and it will follow this kind of rule when we when the website can received on the first thing execution message it will post a thumb uh Stupid order here and it will and we receive the ticket it's just pinned out and you can start to build your own Ergo or your own strategy here and so let's try something here okay I have to impose my foreign hello message sure foreign and I already run these examples you can see that it will display the websocket message you need and and for the detail about the message you can just test the API talk and like here we can go to the websocket part you will notice what kind of message you can get and what which channel do you need here so you can receive your websocket message and you can find your own strategy about how to handle it like for example I also write a post simple Ergo here I I can promise you it will lose all your money if you really use it uh it's for the similar idea like it will receive the public message here and when it received like it will compare let me see when the last part is larger than your the previous price just you will mark it or the price is going up and when it receives five continuous up message reports another order when you receive five decreasing uh sorry you will post another sign of order a momentum shading idea but with a very stable implementation actually we can do something like this and at this moment you can you already can able to build your own Ergo trading stuff and let me do some conclusion about at this moment first and you know how to use your get or the restful API stuff by get and post order and then because the every exchange has the raise limit you can't always get what you want at a unlimited so we will apply the websocket to receive the message passively and we will use this kind of the idea to handle how when the surf websocket how we process the different kinds of message like the example this one is when we when it receives the execution message it was an order and after we have this websocket stuff we can start build your own elbow shading machine okay any question here or housing yeah yes so oh and actually Air Force actually is a part also to the public at the restful API perfect message or perfect stuff is about your own account for example when you post all the private yeah yeah oh okay okay sorry private message or private API it's all about your own account for example you post an order you will receive it in the private restaurant cap when someone someone else posts order and mesh then we will receive a message from public websocket so yeah depends on your strategy you might probably use the public websocket to receive external information and do the analysis and after that you can use your private API to control for example it's my order well paste and it's kind of the monitor stuff okay yeah or any question about how to build your own uh elbow shading spot so if no then we can move on it's amazing then we can start talking about uh sorry low latency shading before we start here we just I just kind of the normal and stuff like how can we us or just or just simple it's quite slow like I mentioned I when I post an order like in the Tokyo to the uh the Barbie server it could take about 500 milliseconds and when we all know that's the The Exchange is there's tons of order and you change up very much if almost every second or every 100 seconds milliseconds when you receive your information and when you really after you do the processed data do your own analysis and post your own well-designed order it already passed some time and the market or maybe already changed then you your analysis may be not really meaningful at this moment so that's why we want to do the low latency and after you read you achieve the low latency and the or the major strategy for the low residency trading is called RB charm and average oh sorry what does avisha means if Force the two products have some or we uh we can use survive it as an example and for the pipe here spot Market you can see the PTC usdt price is about 90 0.5 K and when you can check slice the oh thank you thank you my man got harder so when you maybe I'll go to the special contract the price is about small division but remember this kind of deviation is not it's positive correlated but not necessary uh it doesn't apply you or in this way this price difference is including many different factors so you can't just say oh these are participant then I can do the RP chart this is not guarantee you win the money but it will have a very strong correlation between dams so when you find this the price difference maybe is large and you have checked other factors like the funding stuff you you show us the price difference is larger than other fatter then you can start to your arbit shot so basically your script is kind of like we use the websocket monitor to price and the price difference is larger than a certain amount and you after you consider other Factor you can add a coefficient or variable here and each Checker is then it will automatically Post in arbit charge order in other size then and when for some good arbit charge scripts the risk can really minimize so the only question is about address your speed if you're fast enough there's a more opportunity for you to do the RP shop uh okay and the second thing is about the limit order stuff we know the order fee have have a very difference between the limit order and Market order and when you think the price is going up and you won't really get some orders then if you use the market order you may need to pay more fee but if your machine is fast enough and your observes are growing at hand you may Pace can uh limit authors a bit better than best price then you or because your order is fast than others your other have a relative higher chance to get match before others other guys order which means that your limit order may have a a bit higher chance to get matched in other ways you are paying lower fee for it and I know there are other kind of strategy you can apologize a momentum trading or something it's about some liquidity stuff but you have to check some kind of the policy or the stuff about the defense exchange yeah so we noticed the low latency trading has its own advantage so how can we do it and basically it's about some free stuff and the hardware stuff is I believe how rare can cost you the most and it's hard to improve at the fair at in a short time you have to pay some a course or to do it but if the other stuff is maybe uh cheaper or easier for you to achieve the first thing is or the majority cause for the latency has come from the network and because of speed of light is no way to minimize to zero if your machine has some distance to the RB server there must some latency for example my machine is Tokyo now so my VPN is okay also you have to pass the few thousands distance to get into the battery saver so if I did everything well I can't minimize the request to like 400 milliseconds it's some geological limitation and you have to achieve this and we will use the concept of the collocations I think Wilson will if you send me us more about it later and the second thing is about the programming if you choose your some slow language like the python uh I I did some EX experiments feel these echoes and the python actually is at least were slow like at least 20 or 30 percent of two rods because some the feature about the language you should choose a fast language and that's why we need Ross and we have taught tons of other Advantage about us is really fast is this memory safe so you campaign is really stable and it's fresh safe so you can do some remote parallel or concurrency and anything step so when you use rust congratulations you already do your first chorus answer and then you should sympathize your Ergo trading strategy for example when I receive the data I I'm super intelligent I have a very good strategy I but I have to take like do some AI or something that's it costs like one hours every opportunity is gone the price is changed and your analysis is almost useless so when we applies The High Frequency or the low latency stuff you must make sure your elbow is not too complicated you can already guess favors like the Concordia co-location stuff it can minimize your speed light to few milliseconds but you you use like two seconds to announce data it's totally meaningless so make your elbow your elbow simple that's why the most of the people will do the RP chart the Army shot person requires too much difficult strategy or analysis or other ways you just make the your elbow simple and efficiency with the communication you can build a good Ergo shading so I might okay now Wilson will explain more about the co-location stuff okay so before that I I want to add few words on on the python experiment that our team run so what one he mentioned about the 20 of 30 percent lower it means for post tank owner only it doesn't include any calculation if you're running statistic in Python you know it takes agents to compare so if you are doing the same algo analysis or like statistic Arbitrage then it may go up to 10 times slower so that's why we highly recommend you use like very strong type or like uh language Library if you are very good you someone use four charges people makes money with it yeah I'm serious I like Investment Banking in traditional Finance they use this sort of stuff uh but anyway uh so let's talk about qualification so communication is just meaning how close can you put your server next to the training platform uh unlike uh traditional Finance like NASDAQ you have to rent a space uh surface space it costs a million plus USD a year but in crypto risk it's very fair uh everyone most likely uh some exchange put build their own servers but that that's another story but most of the major exchange are on AWS so you just have to check where they are and it's very nice that by bit give out their location is at apse1-e-a-z3 I will explain a bit uh so so APS E1 is a region called maybe yeah if you forgot this one you can just get it here in the private API bar and I think it's like the FAQ so after this workshop and you want to find you can get into the API button uh this stuff okay so apse1 mean is a region code that means uh it's in Singapore uh so for example uh binary server is in Tokyo right now uh fkas I believe they are in Tokyo uh so uh for some reason why we put a re service in Singapore and big mess I believe is in somewhere in Europe so this depends and the a is set free means that uh availability is on free So within our region such as Singapore there are multiple data centers located at different places so that means you you have to pay the the correct one so let us give some okay okay so this is just a simple diagram saying okay so within a region there is uh sub uh region that please make sure uh you pick the correct one and actually even within our valuation you can break into even lower scale but uh that that part is quite complicated and I I will not cover it right now so just some simple testing uh so this is a field service replaced uh at 1a1b and one c one C is where uh by be at and one a and one B is uh the other zone so just by even within Singapore within a live Field Box away you already get 40 plus increase in in time so this is huge uh just imagine uh the the latency you are getting is a normal distribution so the normally the the standard deviation of that distribution is around 1 ms so 40 away means that you are like uh for four standard division away meaning you you you will lose yeah basically you cannot get fast enough so why why we always mention about why why we need speed is because in high frequency or low latency stuff your facing a small amount of order you just do it multiple times 100 000 of times an hour and you're just shaving a little bit a little bit of profit but you are accumulated a lot like over time then you you can make a lot of money and just that's that's why speed is it's so important but but we cannot run the Benchmark here because of the networking issue sorry about that uh uh yeah she knows Tokyo is about 500 milliseconds so no no the 500 is from here to Tokyo and back yeah Special Singapore best Singapore and pass the whole step back so if you use this camera you must have yeah unless you do statistical options I mean that you guess what will happen in in maybe five minutes later then uh then that's kind of trade and then is allows you you have more uh computational time and but for that kind of strategy you you have to take more risks because Market changes and you have to switch alcohol but for high high frequency stuff uh low latency high frequency is also means you you take a train in a few minutes uh that that kind of matter or some sometimes people do a few days but but no latency I mean just just in a millisecond range for that kind of stuff uh you you really have to wait very very fast yep so I guess this conclude our presentation or maybe we can open up the four for Q a yes sorry [Music] if you mean how much we pay when we okay so maybe we can open the price instruction Okay so good morning so this is a simple fee structure that you get it depends on volume how much you trade the more you trade the cheaper you get uh for what team mentioned about America and texasai it means uh if you're putting order on the order waiting someone to match you then this is a micro order that means you put liquidity and exchanges actually encourage you I'll go Trader to do so that's why they put a much lower fee on on record side and like on the Perpetual trading is like almost six times difference so one basis point versus six spaces point you get a lot cheaper if you are doing uh when you use the elbow shading we suggest you almost use the limit order it's it's really hard to complete the price when you like to just like recent mentioned you will post like thousands all that a day it's really hard Compares so you should place an order and probably you will keep holding so a lot of losses that's why I include the cancer orders caught in the demonstration yeah for example if you are doing an arbit charge that means each trade you are maybe earning one one tag that means if for example in BTC test is there's one one cents per attack or one one or 10 cents per attack that means uh the the fee is really important so just be aware of that yep Yes Yes actually I use Tokyo I only use the Tokyo sorry I can't see after this sorry Oh you mean in real world ideally yeah in crypto or in traffic okay then uh okay so I can show something that's just a good question so let's take the power on what AWS can offer uh for the machine instant type yep okay actually AWS offer like uh almost more than 100 type of instances are married there's t40 T3 t3a T2 blah blah blah um so just okay so one keyword you should look at is Network optimized so it will label at something something n if it has a n in it that means it has a much more stable Network equipment attached to the machine so for example uh m5n and M5 and the inside stand for you you get a much more powerful CPU this is also something you should aim for um because we right now we're talking about speed uh and and you you don't mind paying a little is like 20 higher in your your AWS course but you gain much more speed and so this is something you should look for and as well as uh if you need to run some some sort of uh elbows like like very complicated one you may need a GPU accelerated processor then you should go for like GPU optimized device uh like some okay yep as I read a computer and then you you get if I if you know fpga stuff you can you can also run fpga stuff there but that is for Life very high high loading computer uh yeah oh okay for for AWS uh machine just remember as long as you are not branding something called metal uh let's see okay so in in a one class of machine there is still different breakdown so uh large means that okay let us look at metal which is a metal meaning you you you're renting the whole machine you're getting all the uh you don't have to share with anyone and if you are willing to pay this is the best option uh yeah but but it's quite expensive when you start uh yeah and for metal uh okay sorry I will score so for metal machine uh you don't you even skip the hypervisor you just directly accessing the the hardware a level above that is uh something starting with thought some are number x large or large that you get a different CPU and and even for for this one you got all the whole machine but you you are bought by the hypervisor which means a virtual machine that kind of stuff uh starting from there uh every step you divide it by two that means uh this is right now we are sharing with one person and that is three person and then uh you got uh how much sales and then all the way down the problem is that sometimes you don't know what is your neighbor is doing if someone is calling a loss of network that that will cause objective and Etc is a term when you measure in latency is the variation of latency just like our standard device or some sort of stuff and and then that will be maybe our concern for you so my advice is if your wish just vote for the Allah the best one yeah you guys actually run metal together with three four or five contractors who are you sharing with if someone they are competing with latency yeah I think it's nasty stuff they had to if you keep that full control of your machine yeah um right and anything else I should talk about other than machine uh ah okay so so there is additional step up you can tune uh for for a machine if you are okay industry is that serious um I let me go deeper how how CPU works so when Amazon is buying the CPU one of their courses are is power right how much energy they use so by default they turn their CPU clock speed by default to sleeping mode that's called who I see stay or P State I forgot uh so for that if you are starting to do calculation the CPU have went up the clock speed first before you get the full optimize so uh if you are using an inset type machine that have like you said label here you should check uh you should and you should able to place a script you can run to make sure all your CPU calls are running at the faster speed at by default then then you get a different shaping few percent latency so it's after this is like how to optimize how to do uh kernel tuning and other stuff just to make sure you get every squeeze of power you can get faster it's actually starting to say there's a way to like in a safe position or whether it be easier yeah yeah yeah and and there is also one way uh you can do instead uh within a available song There are maybe 1000 or 10 000 rack of servers but you don't know which and where I buy preserve actually is so one way you can do is try because it's really cheap to start a machine they charge per million seconds they don't charge per second right now so you can start thousands of machines and try to see which machine get the best pen then you can ah okay somewhere here and after you locate that you can set up something called a customer in your AWS icon then you can tell AWS okay just put all the server within this region then you get best performance sorry uh okay let's check uh price and price foreign for example Singapore other machine type ah here you go uh let's for example a M5 Set uh that that's the one I'm currently talking about uh so is the On Demand is the highest you can pay is almost 4 USD per hour uh so let's convert into how much are you paying per month uh [Music] Chinese food yeah almost 3K 2.

8k but this is only the computer that you still have to pay for the network yeah so whatever they charge something some 10 or 100 cents per gigabyte uh yeah it's it's really depends how much you use a but but since they are they they put the server here basically you force it to push over there yeah uh I don't know I don't work with 5B I don't know what the other way so yeah let's say if the provider themself yeah actually uh we have to do it on off work yeah we can talk about it later yeah yeah you don't care how much the more they move it's better for you because the market mode is okay like for example uh uh like if the market certainly is a jump stop or go down and and that means uh the sport market and the day is very high chance the small market and the professional Market is okay then you make money and the more they deals okay the more money you make so that's why I asked like compared to statistical operations it really depends on the market type it which is like trading within a region then you do terms of if this is not like the uh for example the volatility contract and they expand then then you do other stuff but for our average charge like with which we how we charge then you don't care yeah because you know me like you convert the currency to multiple different varieties uh yeah that is called relative value this that means you compare four or five assets like you have some sort of ratio say for example uh uh in Freon bits always are one tenth of Bitcoin price then if sometimes it's jumped then you you start trading value yeah but what I'm talking about uh is just Bitcoin to bitcoin Arbitrage like big Bitcoin sport to bitcoin perpetual there's two markets currently trading on on bitcoin on buy Bitcoin do you think of US exchange difference yeah yeah you can do that you can do that then you will test you add additional capacity yeah especially on the professional side because different exchange offer different Perpetual uh funding rate uh the structure is different the ticket size is different difference is different so you have to do a lot more work but of course a lot more work that means you can make more money yeah yeah yeah something like that so let's see we have three exchanges so you need to optimize for the three exit yes so that so that you will actually optimize your mind yeah yeah yeah uh right now for example uh since uh finance and ftsa is in Tokyo right now so you basically if you set up then you do this situations and you don't have to do any additional stuff if you add piping in then the problem become uh yeah yeah and where should you put yourself in Hong Kong should you put in somewhere else yeah and then after yourself then okay big match pop-up in Europe and then you will start to fight out should we put in Dubai or should we put in some yeah cool cool all right then I guess if no more question then we can conclude this section um [Music] what do you mean by performance changes the examples here you can do it financially just stand there API I just use kind of why You Stand The Bike yeah or and also another thing is that I'm more primarily a Trader on the stock system and have this this does this actually I mean can we also apply this month um yeah I think you can but the thing is the cost you're paying is much higher because the data fit in traffic also Finance they charge a lot and and the latency you get uh you have to pay really high amount of money per yeah it's a different game yeah yeah like for example like uh jump trade and they they run their own course course uh Atlantic fiber like like but this kind of infrastructure you cannot compete like in my opinion unless you get a better alcohol then you are not competing in the in the time regime you're jumping in other Trading [Music] um so you mean your question is how how we might draw the line uh it's hard to say it's hard to say uh just trying two people one is good at optimize Hardware when it's good and automatic software yeah let them do the job yeah software is more cheap yeah you can do you have very good or fast enough but if you want to go to extreme it's very very good at it like that but it's the same for halfway yeah but but the thing is since everyone is in AWS the hardware it doesn't have much uh option for you uh but then it becomes kernels when that kind of stuff do you only do okay yes you do on channel oh no right now we don't we are not doing mu mmev is another store Mev is just to pay the the best uh bribe to The Miner to get their orders on this yeah but similar right now just like a traffic you pay everyone like have good infrastructure then it's really is you're paying the fiber company or you're paying the minor yeah is faster rather than quotation of you sorry what was your question [Music] sorry I don't understand yeah um yeah [Music] okay oh okay uh yeah I guess there is way uh there's also a photo about that I skipped TCP you can do no no we haven't tried that that may be a good idea okay so so after the trading part maybe we can also show The Exchange folder we build so team will give a brief demo of of our beta Network so just to show what are we building currently okay so okay yeah of course it's okay okay so we are running as uh cross chain staff so yeah so here is our URL beta.sat.is We call we are settings so we are provides are cost changed uh depth so for example here and for your new accounts we already launched the beta test and now please you can go to this the four sets and you can text the guests and some testing token in many change here some change that we support in the data the port the Arbitron polycon CK is saying and real support safe Network so basically when you enter our newspaper you can just maybe I can change to another account oh this connection so we are using the polygon and Network right now so we can just paste an order and we don't need you to deposit to the account and do the wallet you can just enter our reps and post your order directly and you will transfers your balance from your for example like the metamask accounts and directly to our exchange then you will get a match here and the most important thing for our death is we support the cost chain solution so you can just change to other network and you will use the same address to do your chaining the narrow is not here so you will got the same thing then you can do the uh you can share your position your orders cross-changing so you can still see the the position here and what is it we'll go okay Yeah so basically it's the first question I mean you can change anything you want and you can very we are suggest you can play around and get the test token there's some gas from default set here so our first link is the four set hyphen beta.sat.is so yeah foreign [Applause]

Automatic transcript — names and jargon may be misspelled.