Coding a HyperLiquid DEX Arbitrage Bot with Claude AI — Transcript
Full transcript
- 0:06Hello everyone. So yeah, nice to be back
- 0:09and uh I hope everybody had a great
- 0:11weekend. So today we're going to code an
- 0:16arbitrage bot between Hyperlquid and
- 0:20MT5.
- 0:22So please give us or give me like a few
- 0:25more minutes. So the live stream will
- 0:27start at 1300. So, we still have uh like
- 0:31two or 3 minutes before the official
- 0:34start of the live stream. And in the
- 0:37meantime, I will just prepare a few
- 0:38things so we can have a smooth start.
- 0:56So I hope that everybody's doing well
- 0:58and I see that you know some of you are
- 0:59already on the live stream. So thank you
- 1:01for coming early and yeah today's um
- 1:06very exciting topic because finally um I
- 1:10can show you like the strategy that I'm
- 1:13trading on a day-to-day basis. So right
- 1:17now like this is my specialty and uh
- 1:21yeah excited to show you you know some
- 1:26good training strategies. Hey bro, nice
- 1:29to see you. This one build will be nice
- 1:30to see. Yes. So I'm also very excited.
- 1:35All right so we have one minute to go
- 1:37and then I guess we can uh officially
- 1:40start.
- 1:42And so guys, uh before I forget, um so
- 1:46I've also added a project description
- 1:49for all of you here. So if you come late
- 1:51to the live stream or you just want to
- 1:53review what we're trying to build or
- 1:56review,
- 1:57uh I'm going to add this link here. And
- 2:01in this link, you will find exactly the
- 2:04goal of our project. And you can also
- 2:06find it in the description uh below.
- 2:22This will be the same strategy you use
- 2:24in your gold strategy. Yes, it is quite
- 2:26similar. So, uh, when I showed you the
- 2:28gold strategy, we were trading, uh, GC
- 2:32futures on Interactive Brokers and we
- 2:34were hedging that with XUSD MT5. And,
- 2:38uh, so in today's video, we're going to
- 2:41do the same concept. So, for example,
- 2:44let me show you an example here. It
- 2:45doesn't have to be gold, but it can be
- 2:49uh, it can be gold, right? So, here, if
- 2:51we go to hyperlquid, and now it's like
- 2:541300. So I can like do an official start
- 2:58for everybody. Uh so just to answer that
- 3:01question on hyperlquid you can trade
- 3:03perpetual futures on real world assets
- 3:07which means that you can speculate on
- 3:09the price of u you know real world uh
- 3:13commodities for example such as gold.
- 3:15And so here what you see is you have
- 3:18gold USDC. So this uh crypto you know
- 3:23asset
- 3:25is basically mirroring the price of gold
- 3:28and so you can speculate on the price
- 3:30here and what you'll find is that uh
- 3:32there will be some pricing discrepancies
- 3:35between hyperlquid and the real price of
- 3:38gold and that's what we're going to you
- 3:40know try to capitalize on and create an
- 3:42arbitrage trigger uh strategy and so the
- 3:48concept that I'm going to show doesn't
- 3:49only apply to gold but it will be
- 3:51applied on anything that is tradable
- 3:55right so if we look at the different you
- 3:58know assets on hyperlquid so
- 4:02the amount of assets you can trade
- 4:04hyperlit is humongous right so you have
- 4:07perpetual futures offered directly by
- 4:08hyperlquid and then you also have this
- 4:11hip 3 protocols where you know you have
- 4:14like various deployers who can deploy
- 4:16their own exchange or like their own
- 4:18assets and they're built on top of the
- 4:21hyperlquid technology, right? So you can
- 4:24have like silver, WTI, SP, brand oil,
- 4:27XYZ gold and all of these assets in
- 4:30theory can be arbitrageed. And so what I
- 4:35mean by humongous like offering is that
- 4:37this is like the XYZ deployer and on
- 4:40Hyperlid we have multiple deployers who
- 4:42can deploy the same asset. So for
- 4:43example, gold on hyperlquid can mean a
- 4:46lot of things. Gold can mean like gold
- 4:48USDC offered by the deployer XYZ. It can
- 4:52also mean it's gold offered by FLX,
- 4:57right? It can also mean that we're
- 4:59trading
- 5:01um
- 5:03not this one. Some of them don't offer
- 5:04it, right? But uh some of them do. I
- 5:07think we have gold by the deployer
- 5:10cache, right? So we have a lot a lot of
- 5:12deployers and we also have like um Paxg,
- 5:16right? So PEXG is like a crypto token
- 5:18that uh
- 5:21uh you know it's basically sort of like
- 5:23a stable coin or like a stable gold
- 5:25right. So uh Paxg can be considered like
- 5:28something similar. So you can also like
- 5:30trade Paxg. So all of these things uh
- 5:33we're going to have a look at. And so
- 5:35what I'm going to show you on the live
- 5:36stream today is like not how to create a
- 5:39specific arbitrage strategy for this
- 5:41symbol and this symbol. We're going to
- 5:43create a framework that where we can
- 5:45apply many many strategies where we try
- 5:48to you know find the uh pricing
- 5:52discrepancies between assets and then
- 5:54write a script that will hedge all those
- 5:56things. So yeah so um officially we can
- 6:00start now. So I actually you know took a
- 6:02lot of time to answer that question but
- 6:04so again let me just officially inform
- 6:06everybody who just arrived to the
- 6:07stream. Thank you for coming and uh so
- 6:11in the descriptions or in the comments I
- 6:13added an article what we're going to
- 6:15build and let me go through that article
- 6:18so you guys uh will understand what I
- 6:20mean by that and like I explained it in
- 6:22the you know uh a few minutes ago but
- 6:26let me show it on this article.
- 6:29So in this project I will attempt to
- 6:30code a dex arbitrage bot on hyperlquid
- 6:33which is this platform here. And so the
- 6:36goal is to identify arbitrage
- 6:37opportunities and to create a train bot
- 6:39that capitalize on such opportunities.
- 6:42I'm going to look at price discrepancies
- 6:44on hyperlquid and hedge the price
- 6:46difference with the underlying CFD
- 6:48assets, thus making money on the spread.
- 6:51And so on this chart here, what you'll
- 6:53find is the historical price data on the
- 6:57S&P 500 index. And what I've done here
- 7:00is I've exported the historical data
- 7:02from Hyperlquid and Metatrader 5. So
- 7:06these are one minute snapshots. Uh I
- 7:08assume these are one minute snapshots.
- 7:10And you see that uh the hyperlquid price
- 7:13MT5 price look sort of the same, right?
- 7:17But the important note here is sort of
- 7:21it's not the same. So we see that for
- 7:24example right now MT5 price is above the
- 7:27hyperlquid price which means that if we
- 7:30take the difference between the two
- 7:31curves we will calculate the spread
- 7:34between these two assets and so
- 7:39the spread is basically just a price
- 7:41difference and so what we can do for
- 7:43example is when the price difference is
- 7:45low let's say like here in this example
- 7:48the difference between hyperlquid and
- 7:50MT5 on S&P 500 was -6 $6, right? So, we
- 7:54could in theory buy at -6, which means
- 7:57buying hyperlquid, selling MT5 at the
- 7:59same time, and then, for example, try to
- 8:01exit at -3 or minus 2. And so, we would
- 8:06make money on the spread here. And so,
- 8:08this is the main goal of the strategy.
- 8:12And we have one question. Taking margin
- 8:14into account, what do you think would be
- 8:15the minimum for something like this? Um
- 8:18so the great uh news for uh this type of
- 8:22strategy is that compared to futures
- 8:24where you have like a minimum contract
- 8:26size right in futures for example one
- 8:27MGC contract is 10 units of gold which
- 8:30is quite a lot uh on hyperlquid
- 8:34uh there is no minimum contract size so
- 8:36you can trade like any small amount that
- 8:38you want like the minimum like size you
- 8:40can open is $10 right and uh on MT5 for
- 8:44example if you look at gold for example
- 8:46today I'm going to show you an example
- 8:48uh with the broker Capital Point
- 8:50Trading. Uh it's basically IC Markets
- 8:52Offshore. So the minimum contract size
- 8:55on MT5 is 0.01 which is one unit of
- 8:59gold. So right now uh I've tried to
- 9:03teach uh like one of my fan members this
- 9:05strategy and uh so it's my brother and
- 9:09he start basically start with $500 and
- 9:12$500. So, I would say a minimum amount
- 9:14you can start with in theory is let's
- 9:16say $1,000 US to trade his strategy. And
- 9:19like he's been doing like quite good
- 9:21returns. Um,
- 9:24and
- 9:26he's making a few dollars like like
- 9:28every week uh for the past few weeks.
- 9:30So, uh, so yeah, I think like around
- 9:33$1,000 in total should be enough to like
- 9:36get started with the strategy. Uh so
- 9:40like back to uh our uh yeah to our post
- 9:45here. So uh again the two things you
- 9:48will need you will need a hyperlquid
- 9:49platform and you will need an MT5
- 9:52platform and we're also going to code
- 9:55the script in our PyCharm ID with the
- 9:57help of cloth right and so these are the
- 10:01three things that we will need and also
- 10:03to connect to you know hyperlquid we
- 10:06will also need to create something like
- 10:08uh API keys so because this is a bit
- 10:11sensitive right I've already done it
- 10:13ahead of time so uh to
- 10:17uh let me just close this. Right. So my
- 10:20API keys are saved in API
- 10:22credentials.py.
- 10:24And so when I work with those, it's
- 10:26basically me just copying the secret
- 10:28keys from the API key from Hyperlquid,
- 10:30right? And then uh like maybe sometime
- 10:33later, right, if people like actually
- 10:35want to deploy the strategy themselves,
- 10:36I will maybe like release a very short
- 10:38course or short video tutorial how to
- 10:40exactly set up the API keys. But
- 10:42basically when you for example I'm going
- 10:45to write like API test right here you
- 10:48generate some key for your wallet agent.
- 10:51So basically it's an agent that is able
- 10:53to place trades on your hypo account.
- 10:55You click on authorize wallet and here
- 10:57you will have like this secret code that
- 10:59will be your API key and you will use
- 11:02that code like to access your hyperquate
- 11:05account. So with this you can like place
- 11:07orders, get market data and so I did
- 11:10that already. So then once you close it
- 11:14and save the key uh
- 11:17it will then you know be active. So in
- 11:19this case I didn't like activate the key
- 11:21because then you guys would have access
- 11:23to my account right so
- 11:27um yeah so these are the requirements
- 11:30and then for MT5 Python right I will use
- 11:33the normal uh Python library. So we'll
- 11:35just use Python to connect this to this
- 11:38MT5 platform to create our you know
- 11:41hedge between those exchanges. And so
- 11:43why am I using MT5 right? MT5 is
- 11:47actually you know quite costefficient
- 11:48because they're CFDs. They provide
- 11:50leverage. They're also relatively cheap
- 11:52for intraday trading. So I believe that
- 11:54MT5 like is quite suitable for this type
- 11:56of strategy. You could in theory use
- 11:58futures or interactive brokers but for
- 12:00simplicity reasons I just decide you
- 12:02know to use these platforms. And this is
- 12:03what I've been using like for the past
- 12:06uh past one or two years. So I always
- 12:09use like MT5 as you know my platform
- 12:12where I h the positions but you could
- 12:14use other uh accounts as I've mentioned.
- 12:16So basically uh this is it. And so for
- 12:19my members you know you know who are
- 12:21watching uh I will also upload the code
- 12:23when it's tested and ready. So you guys
- 12:25can also you know try the strategy
- 12:27yourselves uh once it is ready. So uh I
- 12:31guess this is it for like the
- 12:33introductional project and let's now
- 12:36start coding right. So let's begin and I
- 12:40guess it will take a few hours to have
- 12:41like some results but it's better to
- 12:44start now.
- 12:51Okay. So now how do we start?
- 12:55I think to start we first need like to
- 12:58create
- 13:00um
- 13:01like a connector to hyperquent 5 so you
- 13:03can extract data. So before we can
- 13:05research analyze or write an algorithm
- 13:08we first need the ability to connect to
- 13:12the exchange right and test all the
- 13:14various um endpoints such as get
- 13:17historic data, get the order book data,
- 13:20submit trades and all of these things.
- 13:22And for MT5, we already know how to do
- 13:24that because, you know, I've done a lot
- 13:25of content on this. But here, let's go
- 13:29to our folder here. And here I've
- 13:33created a folder called Exchange
- 13:36Connectors. So in exchange connectors,
- 13:38we'll create our Python classes that
- 13:40will be able to communicate with the
- 13:43exchange. So here, let's start with
- 13:47uh Hyperlquid.
- 13:50And so in hyperlquid I'm going to create
- 13:52init.py
- 13:56and I'm going to now start uh writing
- 13:59you know some some skeleton what this
- 14:02class should do and then I will tell
- 14:05clot like to you know finish filling out
- 14:08those functions. So
- 14:11I'm going to create a class called
- 14:13hyperlquid client. And so I'm going to
- 14:18uh define
- 14:21in itself and um
- 14:29so this is going to be our hyperlquid
- 14:31client class.
- 14:34Um
- 14:36will the created code perform back test
- 14:37or will it only be for actual execution?
- 14:40uh I will also show you how to perform
- 14:42back test uh historically so we can like
- 14:44extract historical data but today we
- 14:47will be mainly focused on actual trading
- 14:50and execution right so hopefully I'll
- 14:53also try to find some actual trading
- 14:55opportunities today and open a hedge
- 14:58because because it's an arbitrage uh the
- 15:03it is an almost like risk-free trade if
- 15:06we capture the a good price so today
- 15:08it's more about just trying to capture
- 15:10real-time opportunities and then once
- 15:13this bot is running then in another live
- 15:15stream we can for example look at the
- 15:16historical data and see how a strategy
- 15:19performed uh in the past and then we can
- 15:21try to optimize the parameters to get
- 15:24the optimum results.
- 15:27So uh
- 15:36uh
- 15:38here I'm going to uh
- 15:42write a function called get account data
- 15:48and then I will just you know document
- 15:50this function and um tell like give
- 15:55cloud some instructions what I expect
- 15:57from this class. So here I want an
- 16:00output to be a dictionary
- 16:03and then I will write this function will
- 16:06return
- 16:09data from the account such as
- 16:19so here return example.
- 16:24So what I want when what do I want like
- 16:26when I um get accounted I want to know
- 16:31uh if you look at our hyperlink account
- 16:34I want to know things like uh what is
- 16:37how much money do I have right so what
- 16:39are my balances what's the portfolio
- 16:41value right so how much do I have on my
- 16:43account basically so here I will write
- 16:47balance
- 16:52let's say we have 10,000
- 16:54Right. we then I want to know the equity
- 16:56which is the you know floating uh amount
- 17:00our equity which is for 11,000 and then
- 17:04free margin right so our available money
- 17:08uh on our account which for example is
- 17:11let's say like 2,000 right and so now uh
- 17:17I will also
- 17:19write a quick description above
- 17:24the Following
- 17:29class
- 17:31uses
- 17:33hyperlquid
- 17:37websockets
- 17:41to communicate
- 17:45with the hyperlquid exchange
- 17:50API.
- 17:53The API credentials
- 17:56uh can be found in config
- 18:01slash
- 18:03API credentials.py.
- 18:10So this is just a quick description and
- 18:12let's try to prompt cloud now to create
- 18:15us you know the first function to get
- 18:17the account data from hyperlquid.
- 18:20Uh,
- 18:33please uh
- 18:41implement the function
- 18:44get account data. Uh
- 18:56please use the details that are
- 19:00specified in the file. So let's try to
- 19:04prompt cloud. We'll see what happens and
- 19:08um hopefully we'll have a very fast
- 19:11function, you know, that will connect to
- 19:13our exchange.
- 19:15So right now uh for today's like uh
- 19:19trading and testing uh right now there
- 19:22is about $1,040 US uh like in live funds
- 19:26on my HyperL account and I also have
- 19:29like 1,000 euro on my MT5 account.
- 19:32Right. So we're going to test like small
- 19:34positions on our live accounts
- 19:38because personally I just you know like
- 19:40to do live trading, right? because you
- 19:41get live market data, real execution
- 19:44testing, right? Because when you test
- 19:45something on the demo account, you never
- 19:47know what the real execution uh like uh
- 19:52result is, right? Because the liquidity
- 19:54is all simulated. So that's why I prefer
- 19:57to test like on small accounts.
- 20:20So, one second. I'm just getting
- 20:21something out of my bag.
- 20:25My lips are a bit dry, so I'm just going
- 20:27to use some lip balm. Apologies.
- 20:32All right.
- 20:48So now uh Claude has created a draft to
- 20:51create uh a hyperlquid uh class that
- 20:55uses websockets to connect to
- 20:57hyperlquid. So by the way just so you
- 20:59guys know what we're actually like
- 21:00working with. If we go to the
- 21:02documentation, right? So we were to do
- 21:04it without AI. If you go to the AI sorry
- 21:07API section here, you will find the
- 21:10documentation for the Hyperlquid API.
- 21:14And so Hyperlquid for example has some
- 21:17Python uh Python like uh library
- 21:21implemented which is the Hyperlink
- 21:22Python SDK. Uh but what we're going to
- 21:25use is the following websocket uh
- 21:29documentation here. So we're going to
- 21:31create our own websocket client uh using
- 21:34cloud AI.
- 21:42So now I'm just reading through this and
- 21:45uh
- 21:49let's override this part here.
- 22:02And so what I'm also going to do is uh
- 22:12I'm going to add another file called
- 22:14test endpoints. And in this file I'm
- 22:16just going to work with this hyperlquid
- 22:18class to you know test the output of you
- 22:23know the new implement function. So here
- 22:25I told Claude to you know get account
- 22:27data from uh
- 22:31yeah to get account data from my uh
- 22:34account. And so let's just try to run
- 22:37it.
- 22:48So when we initialize our hyperquid
- 22:51sorry hyperlquid uh websocket client all
- 22:53you need to provide is like your
- 22:55hyperlquid wallet account which is your
- 22:56wallet and it uh basically tells um our
- 23:02bot like please look at like this wallet
- 23:06address here right um so now let me run
- 23:11this
- 23:14so from
- 23:17uh
- 23:23from the current folder import uh
- 23:28hyperlquid
- 23:30client
- 23:35and so I'm going to instantiate this
- 23:38class HL client is equal to hyperlquid
- 23:40client and then I'm going to do while
- 23:43true
- 23:45print
- 23:48HLC client dot get account data
- 23:54and then
- 23:59I'm going to sleep one second. Right. So
- 24:03let me try this if it works.
- 24:16Uh attempted.
- 24:19Okay.
- 24:25Actually, what I'm going to do instead
- 24:27is add some import error. I'm just going
- 24:30to run this script in in here. So here
- 24:33I'm going to from time import sleep
- 24:37and let's just try to run the script
- 24:39here. I just want to make sure that it
- 24:41works. And
- 24:43so right now um I'm getting error like
- 24:47state margin summary uh there's a key
- 24:50error. So it seems that probably we have
- 24:52connected but the dictionary that we've
- 24:55uh got returned does not work. So here
- 25:08let me print
- 25:11the margin summary
- 25:18and
- 25:20let's see
- 25:26actual state and let's see if we
- 25:28actually get any type of output. Right?
- 25:30So this is actually what I'm interested
- 25:32in.
- 25:35So as you can see uh our websocket class
- 25:38uh is working. Right? So here uh we
- 25:41receive a dictionary
- 25:45right. So this entire line here receive
- 25:47like a response with all the data that's
- 25:50available on our hyperlook platform. And
- 25:53so right now we're actually receiving
- 25:560000. So I have to investigate that but
- 26:00we are receiving data now. So now I
- 26:04think I need to modify
- 26:07some changes.
- 26:11Also what I see that this class is doing
- 26:13right it only like uh opens a websocket
- 26:16connection right it sends some data it
- 26:18waits for some response and then it
- 26:22closes the connection. But what I want
- 26:24to create instead I think is like to
- 26:26have a persistent websocket connection
- 26:29that always streams the data and saves
- 26:32the data inside uh
- 26:36uh you know our inside like our class.
- 26:39So for example
- 26:47I can say like self account data is is
- 26:50none right and I can also like self dot
- 26:52open orders.
- 26:56So I can also say like self dot
- 26:59possessions is equal to none and then
- 27:02like self dot uh
- 27:10market data is equal to not. So here for
- 27:13example I want to save all the data that
- 27:15I return from the websocket client into
- 27:18this data here. And so instead of just
- 27:21calling this function open and closing
- 27:23the websocket connection, I want to have
- 27:26like a persistent class.
- 27:29So here I'm going to provide like extra
- 27:31information for cloud
- 27:34uh
- 27:40make the websocket uh connection
- 27:45persistent.
- 27:46Subscribe to
- 27:49account data, open
- 27:53or orders, positions,
- 27:55market data,
- 28:01etc. and save them.
- 28:04And save
- 28:07the
- 28:10output to
- 28:16self.count data.
- 28:21So self do open orders
- 28:25etc. Right? So uh I want to create like
- 28:27a persistent connection with our
- 28:28websocket client and receive data all
- 28:31the time and then so when we run this
- 28:34loop here so we have while true and we
- 28:35sleep uh once per second we will then
- 28:38have like a constant stream of data
- 28:40coming to our site.
- 28:42So now uh
- 28:47I tell clot
- 28:52make the websocket uh connection
- 28:58persistent.
- 29:02I've added new
- 29:06or I'm just going to copy this actually.
- 29:17So in hyper liquid client
- 29:23make the connection persistent. So I'm
- 29:25prompting claude like to implement like
- 29:27this new type of logic.
- 29:29Hello thank you for content. Thank you
- 29:31Mr. Bessmer and welcome to live stream.
- 29:43So now we're prompting cloth and um
- 29:47basically we're trying you know to wait
- 29:50for this new output.
- 29:52So guys, as you can see like
- 29:54implementing the class like in my
- 29:56opinion like working initially with the
- 29:58APIs, right? And trying to figure out
- 30:00where I find what data and how to send
- 30:02like the transactions for me is the most
- 30:05uh like difficult task like or not
- 30:08difficult takes the most time because
- 30:09you have to like test the inputs and
- 30:11outputs make sure that all uh the data
- 30:14formats formats are like synchronized
- 30:16with other exchanges. But then once we
- 30:19are done with implementing the hyper
- 30:20client and MT5 then the actual
- 30:23implementation of train strategy and the
- 30:25back test is pretty easy.
- 30:30Just wanted to give you a small hint.
- 30:31Writing hints in file comments may not
- 30:33be that efficient while working II
- 30:34coding agents. All right. Um
- 30:40do you have like any uh suggestion or
- 30:42like some uh articles how to do it
- 30:44efficiently? Because uh so far what I've
- 30:48done is I've just you know structured my
- 30:50clients like into like the skeletons and
- 30:52then like I've documented every function
- 30:54like step by step and so far like I've
- 30:57seen like not many like issues on my
- 31:00side or so far like I haven't been
- 31:02complaining with the results but I'm
- 31:05like open to like any more uh optimized
- 31:08suggestions.
- 31:14So now we've we are using threading. So
- 31:16maybe I should have implemented or given
- 31:20the information I want to use the
- 31:21threading uh part. So now we are using
- 31:25threading and then we're just listening
- 31:27and then saving all the data and keeping
- 31:30a persistent connection. So everything
- 31:33that I actually wanted
- 31:36is actually done.
- 31:39Is this latence arbitrage? Oh, we're
- 31:41just actually arbitrageing prices
- 31:43between exchanges.
- 31:51Keeping your files really small,
- 31:52emitting separate dogs, usually NFD
- 31:54files, and asking direct do
- 31:57better.
- 32:04Interesting. Um,
- 32:06I would have to like um like try it
- 32:09maybe off stream and see how that works.
- 32:11But I'll take your uh advice into
- 32:14consideration and maybe in the next
- 32:16stream I'll try, you know, to implement
- 32:19some of your suggestions.
- 32:21Um,
- 32:23so thanks anyways.
- 32:29So basically
- 32:31what I need here now is done. So thank
- 32:34you cloth and let's try to run this
- 32:38script again. So now instead of uh like
- 32:42calling the function right we are just
- 32:44calling the subscriptions on everything
- 32:46that we want.
- 32:48And so now instead of uh like calling
- 32:52the function we can just call the
- 32:55individual
- 32:57like attributes right of the class. So
- 32:59we can just call account data open
- 33:00orders and positions.
- 33:02So here I can for example print
- 33:07account data
- 33:10and then
- 33:14I will just print this
- 33:19and then I can just try to also get
- 33:24positions
- 33:26and then I can try to get open orders.
- 33:36Okay. So now let me try to run this.
- 33:39Something's telling me that there might
- 33:40be some error
- 33:45or there's none. But the thing is here
- 33:46in account data receiving balance your
- 33:48zero equity zero free margin zero. So
- 33:50probably it's not taking like the
- 33:52correct account or it just returning
- 33:54none values. But we are connecting.
- 33:57Uh [sighs] how has this year been for
- 33:58the bots? So this year actually pretty
- 34:00great. So you know I've been trading
- 34:02Hyperlquid since start of new year. So
- 34:04in December I decided you know to
- 34:06explore crypto exchanges and was like a
- 34:08really nice project because I fully
- 34:10migrated uh my trading mainly to
- 34:12hyperlquid.
- 34:14So everything's been doing quite great.
- 34:17And so another question I thought the
- 34:18main issue with cross HR was you can't
- 34:20have the same wallet in different
- 34:21exchanges. How do you uh account for
- 34:24transaction costs? So there's no one to
- 34:27tell you, you know, that you can't have
- 34:29multiple accounts on multiple exchanges,
- 34:31right? Um so if you're allowed to have
- 34:35different accounts on multiple
- 34:37exchanges, then that's fine because then
- 34:40if then if you actually have those two
- 34:43accounts and you see price
- 34:44discrepancies, then it's like pretty
- 34:48good. And to answer a question regarding
- 34:51the transaction costs uh on hyperlquid
- 34:55like uh if you trade crypto right uh it
- 34:58can be a bit expensive to try arbitrage
- 35:00but the beauty with uh like the RWA real
- 35:05world assets is that for example if you
- 35:07look at silver for example right if you
- 35:11look at the
- 35:13uh fee structure here the fee structure
- 35:15is 0.003%.
- 35:18which is very very low actually right so
- 35:22if if we look at uh like the calculator
- 35:25right and we compute the current price
- 35:27of silver which is 78 time 0.3
- 35:34uh the commission per one unit of silver
- 35:38is
- 35:4002
- 35:42it's almost nothing basically right
- 35:44compared to my MT5 broker if I write X
- 35:47AGUSD here the spread is actually 10
- 35:51times larger
- 35:54uh
- 35:55than the commission on on this platform.
- 35:58So it's it's it's actually really cheap
- 36:00and that's why I love it. And so on
- 36:02hyperlquid right you have these cheaps
- 36:04assets. If you look at other exchanges,
- 36:06right? Um for example, lighter, now that
- 36:09we talk about um
- 36:14like commission fees, right? So this is
- 36:16for example another deck and I want to
- 36:17create like another video in the future
- 36:19on lighter. The commission is actually
- 36:22zero, right, for uh the normal retail
- 36:25account. So here, as you can see, taker
- 36:28and maker have 0% commission, which is
- 36:31actually amazing.
- 36:36So what are exchanges do you look at for
- 36:37mispricing? How do you take profits? Uh
- 36:41so in my in the descriptions uh I've
- 36:44already provided a brief strategy
- 36:46description how strategy works. So if
- 36:47you want to learn more like about how
- 36:50like in detail how strategy works,
- 36:52please check out the descriptions and
- 36:53you'll find exactly you know the
- 36:55mechanism how we're going to trade.
- 36:58And so another question for a spread
- 37:00calculation will you only use uh
- 37:03hyperlquid MT5 or will you or HPMT5 or
- 37:07will you normalize the value and
- 37:09regardless of spread will you not use
- 37:10that score to measure it.
- 37:12So uh there is actually no need to
- 37:16normalize the values because uh in a
- 37:18like classic statistical arbitrage uh
- 37:22you have actually the same underlying
- 37:23assets. So the pricing is basically uh
- 37:28the same right. So if we trade silver on
- 37:30hyperlquid the price is 78 and we also
- 37:33have silver on MT5 which is 78 right. So
- 37:36what we can use here is for example use
- 37:39standard deviation to like enter and
- 37:42exit the price or you can just set a
- 37:46fixed absolute amount right and then
- 37:48also try to run it in the back test. So
- 37:51there are many like uh approaches in
- 37:54today's live stream. I'm going to use a
- 37:56static fixed amount right. So I'm just
- 37:58going to look at the historical spread.
- 38:01Then I'm going to you know eyeball the
- 38:04potential entry and exit levels and this
- 38:06is going to be used um for the first
- 38:09version of training strategy and then we
- 38:11come to next topic which is back testing
- 38:13optimization. uh I think using Bowlinger
- 38:16bands or Z scores is the way to go to
- 38:20you know optimize a training strategy.
- 38:22So this is uh like my plan for this
- 38:25arbitrage project.
- 38:30So now uh
- 38:35let's have a look at uh
- 38:40this part here.
- 38:43So now our function get account data is
- 38:46no longer necessary because uh
- 38:52now we are just keeping persistent
- 38:54connection and all the data is being
- 38:57saved inside
- 38:59our variables here right so we can just
- 39:03just check out the value and they should
- 39:06be fine
- 39:09and another question and the sense that
- 39:11if the price reaches the spread
- 39:12threshold fault and continues to
- 39:14fluctuate, move in or out of the
- 39:15threshold, will map entries be made or
- 39:17just one at a time. So, right now again,
- 39:20uh we're going to use just a single
- 39:23entry level. Um
- 39:26but uh
- 39:29it's definitely like a good idea to
- 39:31implement like multiple entry levels,
- 39:32right? So, you can have like a very
- 39:34close one and one further away. So again
- 39:37maybe in future iterations uh or
- 39:41revisional strategy we can also try to
- 39:42implement like multiple entry levels and
- 39:45I do support multiple entry levels. Uh I
- 39:48believe that uh like when we look at the
- 39:50back test later uh this approach should
- 39:53be more profitable.
- 40:04Um,
- 40:06okay. So, let's look at the subscription
- 40:10section here. So, here we're subscribing
- 40:12to web data 2 and all mids.
- 40:16Let me look at the API documentation.
- 40:18So, uh here if you see like the
- 40:20websockets, right? You can subscribe to
- 40:24all of these
- 40:26uh endpoints here. And so, they will all
- 40:30return you some data that you can use.
- 40:34And so I'm just checking what we're
- 40:36using right now
- 40:38just to confirm what hyperlquid is
- 40:40doing.
- 40:42So here web two that aggregate
- 40:44information about user use primary for a
- 40:46front end format.
- 40:48So uh
- 40:52I guess this is fine.
- 41:11So what I'm going to do here is like
- 41:14here we have our handle function handle
- 41:17which is here and uh
- 41:22what I can do is I can in theory like uh
- 41:27print the websocket message
- 41:31and here we will have our message. So we
- 41:35can actually check for the exact values
- 41:37that our hyperlquid client is returning.
- 41:40And so hopefully uh so now as you can
- 41:44see hyperlquid is actually returning all
- 41:47this data to us which we can like
- 41:50investigate right and like the format of
- 41:52the data can also be found in the return
- 41:56values. Right? So are the data type
- 41:58definitions and here we see the data
- 42:01type which um is being returned.
- 42:22So assume
- 42:24that um
- 42:31I just need to go through the
- 42:33information here one by one and see
- 42:39if I'll find
- 42:41what I need. So here there's a
- 42:42cumulative ledger which is 10 1.2
- 42:59And if you look at our hyperate account,
- 43:01there is 141.21.
- 43:05So, uh
- 43:09give it also,41.
- 43:17So I think I have found the value that
- 43:20we need.
- 43:22So here we have
- 43:27I think that we need so our balance
- 43:31or equity is actually this value here
- 43:34and that's why I think that's the
- 43:37mistake here. So, uh,
- 43:47so what I'm going to do is I'm actually
- 43:52going to copy that value
- 43:55and we're going to use that one.
- 44:02So, the channel is actually web two
- 44:04data.
- 44:07So actually I'm going to print it in
- 44:10this section here. Let's rerun this.
- 44:19And so it's actually a lot and a lot of
- 44:22data.
- 44:30So the thing is I'm asking myself if
- 44:33like instead of using web data 3 to get
- 44:36uh
- 44:38the account data if there is actually
- 44:42a different way to get the balances but
- 44:44I think this is it
- 44:47unless we also check just the clearing
- 44:50house state which in theory can has data
- 44:55in regards to our free margin and like
- 44:58the balance and equity
- 45:15So let me also have a look at the
- 45:17clearing house state.
- 45:22Let's uh I'm just looking. So we're
- 45:25going to subscribe also to
- 45:36I'm going to cl
- 45:39instead of
- 45:46web data too.
- 45:49Can you use clearing house state to
- 45:53scrape account
- 45:56information?
- 46:21All right. So
- 46:25hopefully this will be done like within
- 46:26like 30 minutes or what hour because as
- 46:28you see it is a lot of data and it's
- 46:31like a bit different compared like to
- 46:33let's say MT5 or interactive brokers uh
- 46:36but it's just you know understanding the
- 46:39output of the data and so in my previous
- 46:42project I actually have my own like
- 46:44hyperlquid client class implemented
- 46:46using the hyper python SDK but I also
- 46:49had to edit this you know class myself
- 46:52And like it took me like a week actually
- 46:54to implement this class. So assuming we
- 46:56finish just the hyper client
- 46:58implementation with cloud within let's
- 47:01say half a day. Um
- 47:04it saves me about like five times the
- 47:07amount and like we'll see you know how
- 47:09it goes. So
- 47:12now I've asked uh cloth to like use
- 47:16clearing house state instead of
- 47:21the web two data.
- 47:23And so let me try to run this thing
- 47:26again.
- 47:31Okay.
- 47:35Right,
- 47:45let me open the window here. It's quite
- 47:47a warm summer day now.
- 47:50So,
- 47:53see, we have like how hot is it today?
- 47:58It's like 26 degrees today and we have
- 48:01no AC. So, it's quite hot, I would say.
- 48:14So I need to get the channel
- 48:17and I need to get the clearing house
- 48:19state. So we have subscription response.
- 48:31So I think like right now I'm a little
- 48:33bit stuck with the hyperlquid client and
- 48:37that is that um
- 48:40I'm trying to hand or I told clot to
- 48:43handle the data but uh it is not using
- 48:47the data that I need. So instead uh of
- 48:50um
- 48:52like telling clot to already consume the
- 48:54data, I'm just going to subscribe to all
- 48:57the various uh channels that I need and
- 48:59then I'm going to review dictionary by
- 49:01dictionary what outputs I want in my
- 49:04hyperlquid class.
- 49:10So I think I'm going to do that instead.
- 49:16So what uh do we actually need here? So
- 49:19we will need.
- 49:34So we will need a clearing house state.
- 49:35Let's start with the clearing house
- 49:38state. I think that's the best thing to
- 49:40start with. So instead of subscribing to
- 49:44web to data, let's subscribe to the
- 49:47clearing house state and uh try to run
- 49:50this.
- 49:56For love of God, get your mic off access
- 49:58so we don't hear disgusting saliva
- 49:59noises every other second. Apologies
- 50:02wearing that.
- 50:04Tell me if it's better.
- 50:18All right. So
- 50:28now we have the
- 50:34clearing house state.
- 50:44And let's print.
- 50:46So here
- 50:48we have
- 50:51the user.
- 50:55That's fine here.
- 51:06And let's also add the web two data. Now
- 51:48So
- 51:54well actually CL suggested some changes
- 51:57and they didn't write. So I was actually
- 51:58trying to edit some stuff here.
- 53:05Okay, it seems like we still have an
- 53:07issue with the account data, but let's
- 53:09just actually skip that. So I have to
- 53:12you know investigate that. Uh there was
- 53:14like this value that I checked but let's
- 53:16just try to you know subscribe to
- 53:18positions instead. So right now in
- 53:20hyperlquid what I'm going to do now is
- 53:23I'm going to open the position on silver
- 53:26let's say and I'm going to scrape the
- 53:28data from the positions.
- 53:31And so now to open a position on silver.
- 53:39Let's say I want to so I'm just going to
- 53:42create a test position.
- 53:46And let's say I just want to short. So
- 53:49here I'm going to short one silver at
- 53:54the current mid price.
- 53:57And so let's add liquid adding orders.
- 53:59So, we're just adding an order to the
- 54:01order book for the midpric and then
- 54:04we're going to place the order. Mic is
- 54:07better. Thank you. All right. Thanks a
- 54:09lot.
- 54:12So, now I just need to add my two factor
- 54:15authentication to, you know, submit this
- 54:18order.
- 54:20And here we do 597. It's 21.
- 54:34Okay. So, let's check.
- 54:39Let's submit again.
- 54:55And now we are at top of book here and
- 54:58we're just trying to get filled.
- 55:09Okay, let's update our order again.
- 55:14Actually,
- 55:22just cancel this. Try to set another
- 55:27trade at a mid price and hopefully we'll
- 55:30get filled here.
- 56:02So now uh yeah, our open position is
- 56:05still open at 78099.
- 56:09It's quite difficult to get filled
- 56:12like always when you want to place an
- 56:13order, you never get filled at special
- 56:15limits. So hopefully
- 56:25Okay, so now we've created a position
- 56:28and so we are
- 56:31one silver uh short on on Hyperlquid.
- 56:36Let's check our liquidation price. So it
- 56:39shouldn't be that far.
- 56:45And so our liquidation price is at 1,97
- 56:50which is which is fine. So now
- 56:54uh
- 56:57we can actually try to get the data from
- 57:00our silver position in the clearing
- 57:02house.
- 57:08So let's try to go to the clearing house
- 57:11section. Uh,
- 57:20hey man, I just joined membership. Glad
- 57:21to be here. Thank you very much for
- 57:23subscribing and hopefully you can learn
- 57:26a lot of new things and you can like
- 57:28follow me on my arbitrage trading live
- 57:31streams and yeah, hopefully
- 57:34uh yeah, we'll make lots of money
- 57:36together.
- 57:40So here we need to get the channel
- 57:42clearing house state.
- 57:45I just tell CL to do it. So
- 57:49let's just see. So we're subscribing.
- 57:54Uh, can you uh
- 57:58please send uh subscribe
- 58:03request for the clearing house state and
- 58:09save
- 58:11open positions
- 58:16in the handle function.
- 58:54nebulizing.
- 59:11Okay,
- 59:12let's update the changes.
- 59:54So let's see at the clearing house
- 59:57channel. So in this channel what we're
- 59:59doing is we're subscribing to you know
- 1:00:02um the clearing house which contains
- 1:00:05data about our open position. Uh it also
- 1:00:08calculates the free margins and
- 1:00:09liquidation prices. So maybe if we run
- 1:00:12this
- 1:00:14we will then save the data in positions
- 1:00:17which we do. So self.position
- 1:00:19positions is equal state get asset
- 1:00:21positions. So let's try to get this.
- 1:00:32And so let's also see.
- 1:00:39So in this section here, let's print out
- 1:00:41the message for a clearing house.
- 1:01:03So now if we look at this message,
- 1:01:08oh I forgot to add one very important
- 1:01:10thing and that's my mistake. The reason
- 1:01:12why I'm receiving zero all the time also
- 1:01:14in positions is actually I am connecting
- 1:01:17to the wrong decks.
- 1:01:19So maybe to explain what's happening
- 1:01:21here is like we have perpetual futures
- 1:01:23on hyperlquid but if we go to hip 3
- 1:01:25deployments I need to subscribe to the
- 1:01:28xyz uh
- 1:01:32uh hip 3 deployment right. So uh
- 1:01:42so in hyper
- 1:01:45liquid client
- 1:01:50I want to connect to the DEXYZ.
- 1:01:55Can you add this
- 1:02:02Z and subscribe to XYZ positions?
- 1:02:08Can you add this?
- 1:02:32Yes, correct.
- 1:02:55So, we're adding our like separate DEX
- 1:02:58environment which is XYZ because now
- 1:03:01we're trading silver on XYZ and right
- 1:03:04now we are 8 cents in profit which is
- 1:03:06nice considering it's just a
- 1:03:22and so yeah, let's do this.
- 1:03:36Okay, so the changes have been applied.
- 1:03:39Let's run it again.
- 1:03:43And now it seems that it is actually
- 1:03:47working. So if you look at this line
- 1:03:49here guys, right? So here we have
- 1:03:51specified the DEX to be XYZ.
- 1:03:54Here we have our value from the open
- 1:03:57position.
- 1:04:00Right? And so so far
- 1:04:05we have all the data that we need.
- 1:04:11So here here's our XYZ position. We are
- 1:04:14one short and
- 1:04:24this is all we need. So now what I'm
- 1:04:26going to do is instead of printing out
- 1:04:28all the states right here in our uh
- 1:04:33terminal, what I'm going to do is I'm
- 1:04:34just going to dump out the files in a
- 1:04:36JSON file so I can also review the
- 1:04:39output of the data separately. So
- 1:04:46uh down here I'm going to create a
- 1:04:49function called define generate snapshot
- 1:04:55and then here I can tell uh clots to
- 1:04:59dump uh
- 1:05:04current class
- 1:05:07attributes
- 1:05:09into a JSON. and file.
- 1:05:19So now uh I go back to cloth and then I
- 1:05:23tell clot
- 1:05:25uh
- 1:05:27can you implement generate
- 1:05:30snapshot
- 1:05:33uh function and dump uh class data into
- 1:05:41a JSON file. when the function is
- 1:05:45called.
- 1:05:52Hello there. Which clause subs
- 1:05:53subscription do you have? What's your
- 1:05:55usage looking like? Do you mind showing?
- 1:05:57Uh,
- 1:05:59sure. Uh, let me open my cloud desktop.
- 1:06:02So it's all
- 1:06:04uh synchronized or like I'm using like
- 1:06:09the same subscription for uh the
- 1:06:11browser, the desktop and so on. So right
- 1:06:14now I'm using the max uh which it cost
- 1:06:18me like $100 uh per month
- 1:06:21and uh let me also look at the current
- 1:06:27usage and consumption.
- 1:06:36So right here for a current session I
- 1:06:38only use 10% and it resets in 3 hours.
- 1:06:40So actually I have a lot of time to
- 1:06:45yeah to still work with it which is
- 1:06:47great. So I I believe that within 3
- 1:06:49hours I will not use this entire limit.
- 1:06:52And I think there's also like a weekly
- 1:06:55limit or a monthly limit and I'm not
- 1:06:57like not like close. So everything is
- 1:06:59like really good for this subscription.
- 1:07:02Maybe I should actually downgrade now
- 1:07:04that I think about it. But I believe
- 1:07:05that I'll be coding a lot with AI. So
- 1:07:08let's see how much I can stretch it.
- 1:07:14So use it a lot. Have you ever hit
- 1:07:16limits? So far no.
- 1:07:19But I have a friend who use it a lot a
- 1:07:21lot in a corporate environment. So in a
- 1:07:24company and like he used up I don't know
- 1:07:26what he said. Maybe I'm making up, but
- 1:07:28over 50% of the entire team's uh tokens,
- 1:07:31right? So, uh he told me that he uses it
- 1:07:34a lot and I still have a lot to learn
- 1:07:37from him.
- 1:07:40I think of getting 100 or 200, but can't
- 1:07:42decide. Uh I think the best approach is
- 1:07:44to like like start with a lower tier and
- 1:07:46if you reach a limit, you can always
- 1:07:48upgrade, right? So uh maybe I would
- 1:07:51suggest you to just try you know small
- 1:07:54and if you need it more you'll you'll
- 1:07:56like realize very soon right
- 1:08:07I have 20 and I hit the limits quite
- 1:08:09fast. So in that case if you hit the
- 1:08:11limits uh then probably you know if it's
- 1:08:15worth it then you can uh always like
- 1:08:18increase I guess
- 1:08:25then I guess uh if you don't know if you
- 1:08:27go 200 or 200 just just try the 100
- 1:08:30right and then you'll find out if you
- 1:08:31need more I think just use as much as
- 1:08:34you need.
- 1:08:38Okay. So now we've created uh the
- 1:08:41generate snapshot uh which will dump the
- 1:08:45data into a JSON file. So now I can
- 1:08:48print the data uh or output the data in
- 1:08:50my JSON file uh which is
- 1:09:03okay. I also want to tell CL in generate
- 1:09:08generate snapshot. I want you to
- 1:09:12overwrite the old file and not create
- 1:09:18new JSON files.
- 1:09:46Okay. Uh so let's run this script now.
- 1:09:53And so if I refresh this
- 1:10:09Which was the first strategy you built?
- 1:10:11Or are you like asking what I'm building
- 1:10:12right now? Uh, I'm building like an
- 1:10:14arbitrage bot between Hyperlquid and MT5
- 1:10:17right now. We're still stuck with the
- 1:10:20implementation of the Hyperlink
- 1:10:21websocket client, but in the
- 1:10:23descriptions, you can read more about
- 1:10:24the strategy if you're interested to
- 1:10:26find out more.
- 1:10:38Okay. So here, let me open this in
- 1:10:41explorer. Oh, I forgot one thing like
- 1:10:44I'm trying to script, but I still need
- 1:10:46to
- 1:10:48uh
- 1:10:50generate the snapshot.
- 1:10:52So here I'm generating the snapshot.
- 1:10:58Let me run this again.
- 1:11:05And here what you can see is
- 1:11:08uh
- 1:11:12here we have some data on the balance
- 1:11:14equity and free margin. I don't think
- 1:11:16that this looks correct but I'll review
- 1:11:18it later. But what we can see here is
- 1:11:21that we can see our silver position.
- 1:11:24Right. So now I can actually review
- 1:11:27the things here and here we have the
- 1:11:31market data. Okay. So positions have
- 1:11:34been implemented. Now we need to get uh
- 1:11:38market data on on silver let's say
- 1:11:42right. So let's say how do we get the
- 1:11:44current bid and ask for silver USDC. And
- 1:11:48also if you want to use other symbols we
- 1:11:50can also try to use other symbols.
- 1:11:55And so if you look at the API docs uh in
- 1:11:58subscriptions uh
- 1:12:11there should be a message
- 1:12:16called BBO which stands for best bid
- 1:12:19offer. So this gives us the top of book
- 1:12:21prices for a certain asset.
- 1:12:26So um
- 1:12:38so I'm going to tell clot to uh
- 1:12:48I'm going to create a function called
- 1:12:50define
- 1:12:52uh subscribe
- 1:12:54best bit offer. So in this function uh I
- 1:12:58have a symbol and uh I will say this
- 1:13:03function
- 1:13:04will subscribe
- 1:13:10to the best bit offer
- 1:13:14for
- 1:13:16the specified
- 1:13:20asset.
- 1:13:27And here the type the subscription is
- 1:13:32basically
- 1:13:34type
- 1:13:37uh
- 1:13:40so this is the format of our
- 1:13:42subscription.
- 1:13:43So now I can tell cloud uh please
- 1:13:47implement
- 1:13:48subscribe
- 1:13:51BBO function
- 1:13:54and handle
- 1:13:57uh the BBO messages and save them
- 1:14:05in market data as a dictionary.
- 1:14:16So now we like uh are able to subscribe
- 1:14:20to the uh
- 1:14:23to the open trades, right? So right now
- 1:14:24we're 26 cents in profit. And so now
- 1:14:28we're trying to get the current market
- 1:14:31market data. Then what we have to do is
- 1:14:33we also need to get to the open order.
- 1:14:35So check our open orders. And then this
- 1:14:37is all we need like to extract like data
- 1:14:40from our hybrid client. And then after
- 1:14:42that we will test some trading
- 1:14:44endpoints. So we'll send market limit
- 1:14:46orders and so on. And once that is done
- 1:14:50we can then you know try to compare the
- 1:14:53price data with Metatrader 5.
- 1:15:05Please make a video on C++ algorithm. Uh
- 1:15:07I'm sorry I don't code in C++ so I can't
- 1:15:10like help you with that unfortunately.
- 1:16:04Okay. So now
- 1:16:11this should be implemented and we should
- 1:16:12be able to uh get data
- 1:16:16from hyperlquid
- 1:16:18and hopefully we can subscribe to
- 1:16:20something like Bitcoin. then I will uh
- 1:16:22specify
- 1:16:23uh the XYZ silver that you want to
- 1:16:27implement. So let's look at the changes.
- 1:16:32So here in subscribbo we provide the
- 1:16:36symbol and hopefully that will then
- 1:16:40subscribe to the top of book of our
- 1:16:42asset. So when we go down here and we
- 1:16:46create our hyperlquid class, we can try
- 1:16:49to subscribe to the market data.
- 1:17:00So you buy in hyperlquid and compare
- 1:17:02with NT5 like we can transfer with each
- 1:17:04other platforms. No, you cannot transfer
- 1:17:06funds from these platforms because these
- 1:17:08are not spot assets. These are both
- 1:17:10derivatives. But when you see, you know,
- 1:17:12some price discrepancies, you can buy
- 1:17:14and sell on the initial platform. And
- 1:17:16then when the prices like balance out
- 1:17:19over time, you can then close both
- 1:17:21positions for uh net profit. So this is
- 1:17:24what we're doing.
- 1:17:33[cough]
- 1:17:40So here we're subscribing to our best
- 1:17:42bit offer and now I need to
- 1:17:45get the list of tradable symbols.
- 1:17:50So right now I don't know exactly what
- 1:17:53the symbol name
- 1:17:55on hyperlquid is. I think it's called
- 1:17:57XYZ silver.
- 1:18:24So here I'll print uh market data which
- 1:18:27will have the current data for a market.
- 1:18:30Here I can remove my print statements
- 1:18:33above here. So I need to save clearing
- 1:18:35house messages anymore because I dumped
- 1:18:37the data inside a JSON file which I can
- 1:18:40review later.
- 1:18:43And uh
- 1:18:46oh here's the
- 1:18:48here's a coin. So let me try to use XYZ
- 1:18:51silver. So this is what it's called. So
- 1:18:54here our symbol
- 1:18:57is called XYZ silver.
- 1:19:06And now I can try to run this like that.
- 1:19:12And so what we can see now here is if
- 1:19:14you look at the market data, right? So
- 1:19:16we got the market data printed out and
- 1:19:20we look at our snapshot.
- 1:19:23So here you see the market data. So we
- 1:19:25have the current bid price and also size
- 1:19:29of the bid and also we have the ask
- 1:19:31price as well as the size of the ask. So
- 1:19:33right now we're able to uh monitor the
- 1:19:38life prices of XYZ silver
- 1:19:45and so now what we also need to do is we
- 1:19:49need to uh subscribe to let's say open
- 1:19:53orders and then I believe uh we can then
- 1:19:56move on to the trading endpoint. So then
- 1:19:58we will try to open close uh modify uh
- 1:20:02positions for our hyperlquid class and
- 1:20:05then this will be like the minimum
- 1:20:09requirement implementation to you know
- 1:20:12run our arbitrage strategy and then
- 1:20:15so now let me also try to like implement
- 1:20:18open orders and then eventually I'll get
- 1:20:20the account data running but for the
- 1:20:22arbitrage bots to work we just need
- 1:20:24these three things and also like how to
- 1:20:27extract the historical OHLC data which
- 1:20:30we can also like check.
- 1:20:38Okay. So to get the open orders.
- 1:20:54So here what hyperlquid is saying open
- 1:20:56orders is an info input not a
- 1:20:58subscription. So pull via post
- 1:21:01uh
- 1:21:04which is kind of weird
- 1:21:07uh because
- 1:21:15uh in documentation we can actually
- 1:21:17subscribe to open orders like this.
- 1:21:22So let me like discuss this with Claude
- 1:21:34states that open orders cannot be
- 1:21:39subscribed
- 1:21:42to. But according to the documentation,
- 1:21:47you can subscribe with
- 1:21:53Can you review this?
- 1:21:58What about swaps? I'm trading gold MT4,
- 1:22:00but swaps either profits a lot. Uh yeah,
- 1:22:04so swaps and funding rates is one of the
- 1:22:06strategies that like we can deploy,
- 1:22:08right? that will be a funding rate
- 1:22:09arbitrage. But
- 1:22:13but yeah, so right now we're just mainly
- 1:22:15focusing on the price discrepancies, but
- 1:22:17to some extent uh this arbitrage bot
- 1:22:20could be considered as a funding rate
- 1:22:22arbitrage bot because we're also like
- 1:22:24going to make money on the funding
- 1:22:26rates. So this is also quite possible.
- 1:22:40Okay, I told Claude to fix this and it
- 1:22:43seems that Claude understands that we
- 1:22:46can actually like fix that.
- 1:23:03Do you want to make this edit to edit
- 1:23:06thepy? Uh, yes.
- 1:24:05So now the open orders have been
- 1:24:06implemented. So we can try to check if
- 1:24:09you're also like receiving uh data for
- 1:24:12open orders.
- 1:24:16So now if I rerun this script here and
- 1:24:19let's try to do that.
- 1:24:23So right now uh
- 1:24:26we have zero open orders as you can see.
- 1:24:29Let me also print some type of separator
- 1:24:32here.
- 1:24:42You could also ask cloth something like
- 1:24:44review this whole project. What else is
- 1:24:45missing? What features could I add? Etc.
- 1:24:47I do it from time to time or features.
- 1:24:49Yeah. So the thing about telling cloth
- 1:24:51to like just review my entire project.
- 1:24:54Uh I think it can be a bit dangerous
- 1:24:57because then you like lo lose overview
- 1:25:00of your entire project. And like I like
- 1:25:02to be in control and I like to like know
- 1:25:04exactly what I'm building. So more like
- 1:25:07I'm instructing Claude to do a certain
- 1:25:09task, feature, whatever. But something
- 1:25:11like look at my entire project and tell
- 1:25:13me what could be done better. I mean it
- 1:25:16could work, but then you're sort of
- 1:25:19giving up your like own input how to how
- 1:25:22to code that
- 1:25:26is funding rates is kind of fo. Can you
- 1:25:29can you explain that what you mean by
- 1:25:31that?
- 1:25:34Okay. So now uh our script is running.
- 1:25:36So here in HL snapshots uh
- 1:25:40we have our open orders right and right
- 1:25:43now the open orders are empty and that
- 1:25:46is correct because right now we have no
- 1:25:50open orders on our platform.
- 1:25:53And
- 1:25:57so now I can actually place an open
- 1:25:59order. Let's say like I'm going to place
- 1:26:02a cell limit at 100 for example, right?
- 1:26:05It will not get filled but I'm just
- 1:26:08going to place it there. So,
- 1:26:11so we can check if the order will become
- 1:26:15visible.
- 1:26:17So, again it's prompting my 2FA.
- 1:26:21So, let's just add in
- 1:26:24the 2FA verification. So, now my open
- 1:26:27order is here, right? So here in open
- 1:26:29orders we can see silver and so what we
- 1:26:32can then see is that our silver position
- 1:26:35is now visible right. So this is our
- 1:26:38open order
- 1:26:40and so now we have also successfully
- 1:26:43implemented the open order endp point.
- 1:26:51Okay. So now what I'm thinking is let's
- 1:26:54extract the historical OLC data.
- 1:27:02So I think for the OLC data what we can
- 1:27:04do is we don't need to use websockets
- 1:27:06but all that we need is to actually just
- 1:27:09call the info endpoint.
- 1:27:16And in info endpoint we're able to like
- 1:27:20retrieve the OLC data. So maybe we will
- 1:27:24find OLC here or like the history
- 1:27:29historical
- 1:27:32data which is actually here.
- 1:27:44So here I'm going to create a function
- 1:27:47maybe somewhere down here.
- 1:27:53I'm going to call it get OLC history.
- 1:28:06Yeah sure. But just for feature ideas
- 1:28:08then choose one of them take control.
- 1:28:09You know it's not implement it just
- 1:28:11suggest some features if you get me.
- 1:28:14like sort of sort of like right now I'm
- 1:28:17building something and I have like um
- 1:28:20exact idea how I want it to look. So
- 1:28:24right now I'm like
- 1:28:26coding and like more like letting cloud
- 1:28:29assist me with the implementation of
- 1:28:31functions and uh in the classes but
- 1:28:37yeah so this is basically my approach in
- 1:28:40coding and like uh so maybe I don't like
- 1:28:44quite get you uh so probably sorry about
- 1:28:47that if I like didn't really understand
- 1:28:49what you mean by that.
- 1:28:54This function returns historical
- 1:29:01or you shall see data from hyper liquid
- 1:29:05from a specific
- 1:29:09from the
- 1:29:11specific asset. So here uh what we're
- 1:29:15going to do is we're going to provide
- 1:29:17the symbol.
- 1:29:20So it's the asset name. So symbol then
- 1:29:23the start date time then the end date
- 1:29:26time
- 1:29:28and also the time frame.
- 1:29:33So now uh what we can do is uh
- 1:29:43return a dictionary
- 1:29:45with the fields uh
- 1:29:49time, open, high, low, close and volume.
- 1:30:01So please implement get OC history.
- 1:30:32So now that once we get the OSC history
- 1:30:35calculated I can actually show you how I
- 1:30:38created the chart right. Uh so if you
- 1:30:41look at the article right where I
- 1:30:43explained that we're going to arbitrage
- 1:30:46or compare the pricing between multiple
- 1:30:48assets here we can like extract the
- 1:30:51historical data and see the historical
- 1:30:54spread you know how much the prices
- 1:30:55deviate. So once we get like this
- 1:30:58endpoint done then we can for example
- 1:31:01open a quick notebook and I'm going to
- 1:31:02show you how to compare the pricing
- 1:31:05discrepancies.
- 1:31:32Okay, thank you.
- 1:31:35Can we use this on MT5 platform? So
- 1:31:39yeah, the strategy that I'm doing here
- 1:31:40right now is an arbitrage between
- 1:31:42Hyperlquid and MT5. So you will need
- 1:31:45both platforms for a strategy to work,
- 1:31:47right? So in this example, I am using
- 1:31:50MT5.
- 1:31:57Okay. So let's now try to extract the
- 1:32:00historical OHLC data.
- 1:32:38Uh okay. So,
- 1:32:42please write
- 1:32:45a simple test script that exports OHLC
- 1:32:52data and
- 1:32:56uses the get OLC
- 1:33:00history function.
- 1:33:03So I tell cloud now to you know the
- 1:33:05function that I've created the get os
- 1:33:08history uh and this script will call
- 1:33:11this function and then we can review the
- 1:33:14results of this.
- 1:33:37Oh, and also let me check the get OLC
- 1:33:40history function. Uh,
- 1:33:50all right. So here, uh, we have our test
- 1:33:53oc history function. So
- 1:33:57here I'm going to create a new folder.
- 1:33:59I'm going to call it uh maybe our
- 1:34:03analysis folder where we're going to
- 1:34:04analyze uh the data and we're going to
- 1:34:08perform our back test there. So let me
- 1:34:10just put this file here.
- 1:34:13And here I'm going to uh
- 1:34:23test my function.
- 1:34:41So it seems that we've received some
- 1:34:44error here. So client is equal to
- 1:34:46hyperlquid client.
- 1:34:59I've received this error when
- 1:35:04uh using testl.py
- 1:35:43So let's see what claude will now
- 1:35:45suggest that we change here.
- 1:35:50And then here I'm going to create a
- 1:35:51notebook. Uh
- 1:35:54I'm going to call this mode calculate
- 1:35:56historical
- 1:35:59spread. Right? So here we're going to
- 1:36:02import the Metatrader 5 uh platform,
- 1:36:05export the OLC from Metatrader 5 and
- 1:36:08we're going to compare the historical
- 1:36:10spread uh using our client.
- 1:36:19So from exchange connectors hyperlient
- 1:36:23import hyperclient.
- 1:36:33Okay, let's see if Claude found a fix
- 1:36:36for this bug.
- 1:37:02Okay. And let's try to run this and see
- 1:37:04if something
- 1:37:06if this fix up.
- 1:37:11So problem here is that we received zero
- 1:37:15candles for a one minute chart data.
- 1:37:16Maybe the history is too long. I'm not
- 1:37:18sure if Hyperliquid
- 1:37:20saves this much into the past. No.
- 1:37:39uh test oc.py
- 1:37:43still returns an empty oc data frame.
- 1:37:56So what we can do worst case is try to
- 1:37:58look at the documentation
- 1:38:01and when we go
- 1:38:05to the info endpoint
- 1:38:08uh
- 1:38:13let's see how to retrieve the the
- 1:38:15history
- 1:38:22maybe because using today they tried 245
- 1:38:2526
- 1:38:27uh yeah that could uh be it in theory.
- 1:38:31So let me try to uh run this fix one
- 1:38:35more time and if not I'm going to maybe
- 1:38:38look at the starting and ending dates or
- 1:38:41I can just manually write the date for
- 1:38:44example for
- 1:38:48for that
- 1:39:15All right, let's
- 1:39:18apply the changes
- 1:39:26and also Yeah.
- 1:39:39Okay, so BTC apparently works.
- 1:39:50So, so let's try to do BTC.
- 1:39:54So,
- 1:39:56yeah. So, that's interesting. So the OLC
- 1:39:58data no
- 1:40:02raw payload
- 1:40:07actually this is quite interesting.
- 1:40:11So we actually receive data here.
- 1:40:18So actually it works but then when we
- 1:40:20save the output guys you see like here's
- 1:40:23the raw payload right? So we receive the
- 1:40:26open high low close data but they're
- 1:40:28just not getting saved properly.
- 1:40:32So anyways I'm going to take a quick
- 1:40:35bathroom breaks. I'll be back like in a
- 1:40:37few minutes and then we can continue
- 1:40:39from there. So just one Good.
- 1:44:39All right, guys. Uh, I'm back now and
- 1:44:44yeah, let's continue with uh
- 1:44:52exporting the historical HLC data. So
- 1:44:56um
- 1:45:04so in both cases we're receiving the
- 1:45:07payload here.
- 1:45:13Let's see fetching symbol get OC history
- 1:45:21and here we get the data.
- 1:45:42Bro, I have a serious question. Why most
- 1:45:44strategies and bots only get like max uh
- 1:45:47ROI annually?
- 1:45:54Uh 50 crazy is like super crazy. I don't
- 1:45:57know what exactly what are you talking
- 1:45:59about. Uh
- 1:46:01and I I don't think most bots make 50%
- 1:46:04in the in the first place. So
- 1:46:08they have like some reference you know
- 1:46:10or something like that because to be
- 1:46:14honest 50% is is like great right when
- 1:46:16you if you make that per year.
- 1:46:22Okay. So, I think uh
- 1:46:31so let's uh
- 1:46:40so if you make 7% ROI monthly that's
- 1:46:43great too. So I don't know like uh yeah
- 1:46:46there's
- 1:46:47not much to discuss to discuss in the
- 1:46:51like in this case
- 1:46:547% is great even 1% per month is great u
- 1:46:58I think it's all about setting the
- 1:47:00correct expectations S.
- 1:47:23So here we have get OS history. Uh
- 1:47:30so here we have the payload and then
- 1:47:32here we return
- 1:47:34the the data.
- 1:47:41It should be fine.
- 1:47:44And so in this
- 1:48:05So in both cases we're receiving
- 1:48:10the data. So I it's just about how we
- 1:48:12save them or format them.
- 1:48:28Okay, so this is interesting. So the
- 1:48:30return function returns none. But when I
- 1:48:32call get OS history, I get a payload
- 1:48:36with the data. So the problem is
- 1:48:39actually
- 1:48:46uh with the return I tested the
- 1:48:50output
- 1:48:52of get OLC
- 1:48:57history.
- 1:48:59I see that data is
- 1:49:04returned but the output is not. I assume
- 1:49:09that it is an issue with the return
- 1:49:17of the hyper liquid client class.
- 1:49:41So
- 1:49:46there's a better than CSV. It's called
- 1:49:48tune or something. I forgot about it.
- 1:49:49Handles that better. Yeah. So right now
- 1:49:52just in CSV file just to you know save
- 1:49:55the data and verify it myself. If you
- 1:49:57have a large you know data sample or you
- 1:49:59know data set of course a database is
- 1:50:02better. But this is just a very fast way
- 1:50:05to debug and verify the data or use for
- 1:50:08like local development. So it should be
- 1:50:12okay in such cases.
- 1:50:30Great. So
- 1:50:34cloth suggested some fix. So let's try
- 1:50:37to apply that.
- 1:50:54And so now let me run this. So now we
- 1:50:58see that we have some output
- 1:51:01here in OLC data. So this is the output
- 1:51:06for
- 1:51:08yeah.
- 1:51:11So this is data frame that's
- 1:51:13successfully saved. And
- 1:51:17so now instead of like I can try to
- 1:51:20query let me try to query one minute
- 1:51:23data for the past 24 * 7 days and see if
- 1:51:28we get some output.
- 1:51:37Okay. So here we have our OLC data and
- 1:51:40we try to export as much as we can. It
- 1:51:43seems like it hyperlquid only returns
- 1:51:45data for the past three days for the one
- 1:51:48minute uh data frame. If I want longer
- 1:51:50history then probably I would have to
- 1:51:52look at some different data feed
- 1:51:55providers. But for now uh let's just uh
- 1:51:58use uh what we have. So finally at least
- 1:52:04we're able to extract the data. And so
- 1:52:09what I can do now is
- 1:52:11in the analysis section uh I can tell
- 1:52:15claude
- 1:52:17and calculate uh
- 1:52:23historical
- 1:52:25spread
- 1:52:27and b
- 1:52:30compute the spread between
- 1:52:34uh
- 1:52:37XYZ silver
- 1:52:40and XA XY silver on Hyper Liquid and X
- 1:52:46AG USD on Meta Trader 5. Use one minute
- 1:52:54historical
- 1:52:57HLC data for the
- 1:53:02to run the analysis.
- 1:53:06So now I tell clot to you know go to
- 1:53:08this file calculate historical spread to
- 1:53:11uh yeah use our uh function that we've
- 1:53:16created in hyperlquid so it can extract
- 1:53:19historical OLC data and then I'm
- 1:53:21connecting to my Metatrader 5 account
- 1:53:24and so on this platform what I can do is
- 1:53:26I can like extract OSC data from this
- 1:53:29provider and so what I'm going to do now
- 1:53:31is I'm going to combine these two data
- 1:53:33frames and then comput the historical
- 1:53:35spread and then you guys mentioned like
- 1:53:38can we compute a Z score and like
- 1:53:39compute the levels. Yes, now we can
- 1:53:41actually do that and then uh we can like
- 1:53:44try to you know set the entry and exit
- 1:53:46levels for our strategy.
- 1:54:23So now we're just uh waiting for clots
- 1:54:26to compute a spread uh in our Jupyter
- 1:54:28notebook and uh
- 1:54:32hopefully
- 1:54:34there will be no errors.
- 1:54:48Okay. So now it's suggested to you know
- 1:54:53suggested some code in our notebook. So
- 1:54:55we can try to run this now and uh let's
- 1:55:00see what the output is. AB1212 hello
- 1:55:03nice to be on stream. Hi.
- 1:55:06So far CL everything's fine.
- 1:55:17And so here now we have our
- 1:55:27things that we need. So,
- 1:55:35so let's let's run this notebook and see
- 1:55:39if
- 1:55:43it is able to extract the historical
- 1:55:45data. So, again, we're taking the
- 1:55:47historical OLC data, so the price on
- 1:55:50Hyperlquid, and we're comparing that
- 1:55:53with XAGUSD on FD5. And like we can run
- 1:55:56that for any symbol between hyperlquid
- 1:55:59MT5. So it doesn't have to be silver.
- 1:56:01And then so if that works we can also
- 1:56:05have a look at other assets and then
- 1:56:07once that is done we can then try to you
- 1:56:09know look for assets that have a high
- 1:56:12standard deviation which means we can
- 1:56:13try to make money on the price
- 1:56:15discrepancies. And um let's see. I think
- 1:56:20one problem I have right now is that uh
- 1:56:23we still need to install Jupiter server
- 1:56:25which I don't have in this project right
- 1:56:27now. So let's just uh wait until it's
- 1:56:30installed and then uh we can then try to
- 1:56:35uh run our Jupyter notebook.
- 1:57:04Okay. So now our packages have been
- 1:57:08installed. So uh I think we can try to
- 1:57:12run this now hopefully.
- 1:57:34Okay, everything works. It just seems
- 1:57:36that our initialized function for MT5
- 1:57:39doesn't work. Uh let me try
- 1:57:45uh
- 1:57:49to ignore the MT5 path for now and just
- 1:57:52uh
- 1:57:54call normal initialize without any
- 1:57:57parameters.
- 1:58:01So that should start up our platform
- 1:58:03which now we see that it works and here
- 1:58:06we are now joining
- 1:58:10the data.
- 1:58:15Okay, it seems that maybe there is
- 1:58:21let's have a look at price. I think
- 1:58:22something's a bit wrong. So
- 1:58:26you have XYZ sell from X and X AG USD.
- 1:58:30Let's try like 72 hours maybe.
- 1:58:40I think maybe there is like some uh time
- 1:58:43offset probably
- 1:58:46that uh
- 1:58:50could be it.
- 1:58:55Right.
- 1:59:02I feel like yes, this is 1018 and this
- 1:59:05is 7. Uh MT5 is 3 hours ahead of
- 1:59:09hyperlquid.
- 1:59:11Uh
- 1:59:15MT5 OLC price is 3 hours ahead of
- 1:59:21Hyperlid.
- 1:59:22Can you adjust the time zone offset?
- 1:59:35It's an unre question, boss, but how
- 1:59:36much do you think the average trader
- 1:59:37needs to retire and live comfortably? I
- 1:59:39know it depends on the person. So, uh,
- 1:59:42what about you?
- 1:59:45So I think in trading you have you know
- 1:59:49your
- 1:59:51like everyday spending right so you need
- 1:59:53to pay rent food entertainment stuff
- 1:59:55like that so if you for example spend
- 1:59:59between 1 or 2,000 euro per month right
- 2:00:02which u in the western world most people
- 2:00:05do and earn per month then I think in
- 2:00:08trading it's
- 2:00:10like safe to at least
- 2:00:14have at least like double the amount,
- 2:00:16right? So, if you you know spend 2,000,
- 2:00:19maybe you want to like make 4,000 per
- 2:00:21month, which means that you your annual
- 2:00:24like uh income from trading should be
- 2:00:27around 50 or 60,000 uh euro. And
- 2:00:31in trading, it's also not guaranteed,
- 2:00:33right? There's the risk factor that your
- 2:00:35strategies will not working, especially
- 2:00:36for like a manual trader or like a swing
- 2:00:39trader. when it comes like to arbitrage
- 2:00:41trading the profits are a little bit
- 2:00:43more consistent but then again like the
- 2:00:45liquidity on exchanges or or the
- 2:00:47competition may like change over time.
- 2:00:50So I think uh in trading I would say you
- 2:00:53need to make at least like double the
- 2:00:55amount of what you spend because then
- 2:00:57you can like reinvest your profits make
- 2:00:59make your account grow because in
- 2:01:00trading it's also like tough to trade if
- 2:01:02you're always like break even every
- 2:01:04month after all your expenses. So I
- 2:01:09think that's my answer and uh how much
- 2:01:12money you need to make is then like
- 2:01:14relative to the size because then you
- 2:01:16cannot you know afford to overleverage
- 2:01:19right because when your capital is low
- 2:01:21and your expenses are high then you are
- 2:01:24more inclined to you know risk a lot
- 2:01:26which then is better your psychology
- 2:01:27because then when you have a draw down
- 2:01:29or a bad period it actually is going
- 2:01:32quite against you. So yeah, that's my
- 2:01:35answer to this to this question.
- 2:01:39Okay. Um
- 2:01:41let's apply these changes.
- 2:01:47any preference strats look at in crypto
- 2:01:49trading with small capital like 10 or
- 2:01:5120k like personally uh I think having a
- 2:01:55small capital can be a big advantage in
- 2:01:57trading when it comes like to market
- 2:01:59making right or arbitrage trading
- 2:02:02because uh for example the big players
- 2:02:04the banks the big hedge funds
- 2:02:06institutions they have lots of money so
- 2:02:09uh their strategies with a big capital
- 2:02:12might not be that viable on assets where
- 2:02:16liquidity is Oh, because if you add
- 2:02:18liquidity to a market where there are
- 2:02:20not many traders, you are not maximizing
- 2:02:23your capital. But luckily on hyperlquid
- 2:02:27what you have is for example very low
- 2:02:29liquidity assets. Let's go for example
- 2:02:32to the deployer Felix and for example
- 2:02:34here if you look at let's say silver
- 2:02:37USDH right here the current funding rate
- 2:02:41is minus 58%. Which is amazing. You
- 2:02:44could buy silver USDH right now
- 2:02:47and sell silver on MT5 and make a
- 2:02:51profit. You know what guys? I'm going to
- 2:02:52do this. I'm going to place a manual
- 2:02:54trade and prove to you that I'm going to
- 2:02:56make money by the end of the stream or
- 2:02:58tomorrow.
- 2:02:59Okay? So, watch me. I'm going to uh so
- 2:03:04on silver USD, if you look at the price
- 2:03:06of silver right now, it's 77.6 on
- 2:03:08hyperlquid and on MT5 it's 77.6. 62
- 2:03:1577. Okay, now
- 2:03:19the price is evening out, right? As was
- 2:03:22I was trying to explain something. 77.62
- 2:03:2877.62.
- 2:03:29Right now it's the same. Let's try
- 2:03:31something else. Let's look at
- 2:03:35some of the funny rates. USA 100 USDH.
- 2:03:41This one might work but the spread is
- 2:03:42high.
- 2:03:4675 is a good second venue. Yes, correct.
- 2:03:49So just I want what I want to tell you
- 2:03:52is uh yeah when your capital is low you
- 2:03:55can try to apply strategies on markets
- 2:03:58where the liquidity is also low and so
- 2:04:00your return or your capital efficiency
- 2:04:02is much higher on these markets. So I'm
- 2:04:06now just browsing uh through some
- 2:04:08markets to show you know some good
- 2:04:11examples where we can try to do a manual
- 2:04:13hedge. So we're going to like manually
- 2:04:16trade the arbitrage strategy.
- 2:04:18So here we see GBP USDC has a current
- 2:04:22funding rate of - 59%. Here the price is
- 2:04:251.35
- 2:04:30and if you look at GBP USD on MP5 it's
- 2:04:341.350
- 2:04:371.3
- 2:04:40right so we could
- 2:04:44try to buy like at 1.35
- 2:04:50I would have to add liquidity at the
- 2:04:52order so look at you have like bit at
- 2:04:541.347,
- 2:04:56right? Let me whip out the calculator.
- 2:04:59We have a bit at 1.347
- 2:05:04and the current MT5 price is 1.35.
- 2:05:13So, right now the price difference
- 2:05:16between Hyperliquid and MT5 is 0.003,
- 2:05:18003 which what might not sound like a
- 2:05:21lot but we're talking about forex right
- 2:05:23in forex the contract size is computed
- 2:05:26in lots so for example if you have like
- 2:05:30100,000
- 2:05:32uh in liquidity right because we are
- 2:05:35talking about leverage assets one lot on
- 2:05:38GBPUSD would make you 300 US dollars
- 2:05:41assuming you get filled$100,000 and
- 2:05:43because the leverage is so high on forex
- 2:05:45right you have 50 to1 leverage on
- 2:05:47hyperlquid
- 2:05:48And CFD brokers they give you 1 to 30, 1
- 2:05:51to 50, 1 to 100. You can easily compete
- 2:05:55at this price, right? So here, even
- 2:05:57though liquidity is low, you guys can
- 2:06:00put your bids on top of book here and
- 2:06:02try to increase like improve the
- 2:06:06liquidity by adding the orders here and
- 2:06:07then you'll get rewarded uh easily. Also
- 2:06:11another thing is that there is this
- 2:06:12funding rate mechanism which means that
- 2:06:16uh when the price is quite low right uh
- 2:06:22we will also make money on the funding
- 2:06:24rate because when the funding rate is
- 2:06:26negative long positions make money and
- 2:06:30so right now uh it's 1.3512
- 2:06:35there is 1,000 GBP available
- 2:06:44and we have 1.35. I'm going to try to
- 2:06:47get filled. So guys, uh the difference
- 2:06:50between like um being a market maker,
- 2:06:53market taker is the one that if I place
- 2:06:56my bid here, it's not guaranteed to get
- 2:06:59filled, right? It's not guaranteed to
- 2:07:01get filled. And so
- 2:07:04in order to like show you right now, I
- 2:07:06would have to like buy at 1.35,
- 2:07:09right? Or I can try to place a limit
- 2:07:11order 1.348,
- 2:07:13for example, compete at top of book, get
- 2:07:15filled, and hedge this position with
- 2:07:17MT5.
- 2:07:19And this is like what I'm trying to
- 2:07:20achieve. I'm trying to create a script
- 2:07:23that takes a current market price,
- 2:07:25quotes the bit price here, then I sell
- 2:07:27on MT5, and then I will make money on
- 2:07:29the spread and the funding rates. So
- 2:07:31this is an example and be and to answer
- 2:07:34your question uh if your capital is low
- 2:07:38then these are strats that you should be
- 2:07:39looking for strats where the market is
- 2:07:43not very competitive because with low
- 2:07:45capital you don't need you know to
- 2:07:48compete with other big market makers and
- 2:07:50this is like what we're going to focus
- 2:07:52on when we try to run the arbitrage
- 2:07:56strategies right so for example if I
- 2:07:58have an account with $100,000 right So,
- 2:08:01it's a basically a big capital. I would
- 2:08:04not be able to trade this strategy in
- 2:08:06GBB USD because a daily volume
- 2:08:10on this symbol is $100,000 uh US
- 2:08:12dollars. I would never get filled,
- 2:08:14right? my 100K account uh would ideally
- 2:08:18want to open a position that's for
- 2:08:20example a million dollars or even like
- 2:08:22$3 million because again the point of
- 2:08:25this arbitrage is to utilize leverage
- 2:08:33so yeah um
- 2:08:41so let's now get back to
- 2:08:47yeah exporting the OC data.
- 2:08:50So I will rerun the code now. So there
- 2:08:54was like this time zone offset and then
- 2:08:57you can continue.
- 2:09:05Be right back.
- 2:09:40All right. Um,
- 2:09:43so great question. So, we're going to
- 2:09:45maybe also look at liquidity, right?
- 2:09:47This is what traders don't look at very
- 2:09:49often. Um, so what strategies are
- 2:09:53suitable for lowly capitalized accounts
- 2:09:55and what strategies are good for highly
- 2:09:57capitalized accounts? And so traders who
- 2:10:00have low amount capital should actually
- 2:10:03have a higher return than traders with a
- 2:10:06bigger capital. And it does make sense,
- 2:10:08right? So you can look for these
- 2:10:10opportunities on those low liquidity
- 2:10:12markets and make good money. So this is
- 2:10:16will actually help you to like kickstart
- 2:10:18a small account into a reasonably sized
- 2:10:21account.
- 2:10:28Okay. So, I reran the script. Uh,
- 2:10:33uh, I think Claude did not adjust time
- 2:10:37zone offset or maybe let me run the
- 2:10:39scripts one more time.
- 2:10:42So, here we're going to export prices
- 2:10:45from
- 2:10:47hyperlquid,
- 2:10:49then from MT5.
- 2:10:54How are you accounting for funding rate,
- 2:10:55spread, slippage, etc.? uh unless you uh
- 2:10:59unless you're a maker.
- 2:11:01So uh again, so we're doing like market
- 2:11:04making on hyperlquid side. So we're
- 2:11:06adding liquidity. So we're going to
- 2:11:08always send maker orders and then we're
- 2:11:10going to hedge the trade on MT5, right?
- 2:11:14And so to account for the funding rates,
- 2:11:17the funding rates in most cases will be
- 2:11:19in our favor because when hyperl prices
- 2:11:22are undervalued relative to you know
- 2:11:26uh the real market price, the funding
- 2:11:29rate for long positions will be in our
- 2:11:31favor. So we will also make not money on
- 2:11:34the spread but we'll make money on the
- 2:11:36funding rates. So in reality the outcome
- 2:11:39of our arbitrage
- 2:11:42will be actually better because we're
- 2:11:44having two types of edge which is a
- 2:11:45funding rate and the spread and as you
- 2:11:48said uh so the spread because we're
- 2:11:50market making it means we're making
- 2:11:52money on the spread on hyperlquid side.
- 2:11:54So the pricing on hyperlquid is in our
- 2:11:57favor and then we're paying the spread
- 2:11:59and the commissions right on MT5 site.
- 2:12:01So one exchange spread would offset the
- 2:12:05spread on another one. So overall we're
- 2:12:09just looking for a good price fill and
- 2:12:10slippage is always like a risk uh for
- 2:12:13us. So we can always um you know have
- 2:12:16slippage, execution risk, uh maybe some
- 2:12:20like connection risk. Sometimes you know
- 2:12:22my broker gave me like a six second
- 2:12:25execution delay. I was like very
- 2:12:27disappointed but it can happen. So there
- 2:12:30is also like risk on the execution side
- 2:12:32on both platforms.
- 2:12:41[clears throat]
- 2:12:42Okay. So it rewrote my I think okay yeah
- 2:12:48this is fine.
- 2:12:54So this is amazing guys. So now we were
- 2:12:56able to extract the historical prices
- 2:12:58from Hyper Hyperlquid NFTt5 and so this
- 2:13:01is the data for today right? So here we
- 2:13:04can see the historical OLC prices on
- 2:13:07hyperl5
- 2:13:09again this is just a one minute snapshot
- 2:13:11so the data is not like fully accurate.
- 2:13:14If you want to have like a fully
- 2:13:15accurate um price monitoring system we
- 2:13:18would for example save one minute
- 2:13:20snapshots of the top of book and then
- 2:13:22compare them. But for like general
- 2:13:25qualitative analysis uh
- 2:13:29we see that uh
- 2:13:33when we look at the spread this is the
- 2:13:35difference right now right so right now
- 2:13:37for example you can see is that the
- 2:13:39spread between hyperlquid and FT5 is
- 2:13:42like between 0.1 and zero so as a rule
- 2:13:47of thumb when
- 2:13:50uh when the price is above zero Right?
- 2:13:53We can look for short opportunities. So
- 2:13:56we would short hyperlquid asset and long
- 2:14:00the MT5 asset. And when the spread is
- 2:14:03below zero, right, this just short
- 2:14:06spike, but maybe we could have trade
- 2:14:07that too. When the spread is below zero,
- 2:14:09we can look for buy opportunities. So we
- 2:14:12could buy uh on Hyperlquid and sell on
- 2:14:16MT5. And then again, what are the
- 2:14:18funding rates? they would be usually in
- 2:14:19our favor because
- 2:14:22the funding rate mechanisms on
- 2:14:24hyperlquid encourage like market
- 2:14:26balance. So we'll also get rewarded for
- 2:14:28that
- 2:14:30free skill strategy like that quickly.
- 2:14:34Well guys, you always like come to my
- 2:14:36stream and tell me like fees kill this,
- 2:14:38it doesn't work. How about we just
- 2:14:41finish this and then let's look at the
- 2:14:43fees if they actually kill the strategy
- 2:14:45or not. Right? Because the assumption
- 2:14:47that something doesn't work because just
- 2:14:49saying fee skill or strategy already
- 2:14:54creates like a wall that you will never
- 2:14:57even attempt to explore it right and
- 2:15:02so again what are the fees right instead
- 2:15:04of saying fees will kill the strategy
- 2:15:07what are the fees on hyperlquid and so
- 2:15:10for example if you look at
- 2:15:12the S&P 500 right US USDC.
- 2:15:18So right now the market price on the
- 2:15:20SP500 USDC index is 7,542.
- 2:15:27What are the fees? They are 0.003%.
- 2:15:31Right? So it's time 0.00
- 2:15:35times
- 2:15:36003 because we're in percentages. And so
- 2:15:40the commission on one side on hyperlquid
- 2:15:44for SB500 is 20 cents. All right. If you
- 2:15:48multiply it by two because it's a round
- 2:15:51turn, we pay 45 cents. Okay. And so
- 2:15:55let's try to run the analysis
- 2:15:58on XYZ SP 500 and US 500.
- 2:16:07So my tip to you guys is don't assume
- 2:16:10that things don't work. And even if
- 2:16:11you're like 99% right, right?
- 2:16:15If you keep digging and keep looking for
- 2:16:17these arbitrage opportunities, one day
- 2:16:18you'll find something that actually
- 2:16:20works. And then
- 2:16:23uh you'll find out, oh maybe I should
- 2:16:26have checked out, right? Because you
- 2:16:27never know what opportunities lie ahead
- 2:16:29of you. And so as I said the spread on
- 2:16:32SP500 hyperlquid right ranges today
- 2:16:36between minus 1.4 and let's say 2.3
- 2:16:40right it's a range of $3 US and so I
- 2:16:44told you on hyperlquid the fee is 45. So
- 2:16:47if you capture $2 you pay4 cents in
- 2:16:51commissions you're left with $1.5
- 2:16:54profit. Maybe also pay something on FT5,
- 2:16:57right? What is the spread on US 500?
- 2:17:02The spread here is 50 cents. Right? So
- 2:17:06even with all the spread commission so
- 2:17:08on by doing simple calculations and
- 2:17:10mathematics uh in theory
- 2:17:13this strategy should profit. So if I
- 2:17:15write a strategy that always enters at
- 2:17:18short 2.0 zero, right? And exits at
- 2:17:20zero, I will pay one, let's say, worst
- 2:17:23case scenario, and I will make $1 on the
- 2:17:27spread. And sometimes the spread can be
- 2:17:29can spike like up to three or four,
- 2:17:31right? This is just today. And for
- 2:17:34example, last weekend the spread was
- 2:17:35even as low as - 6. All right.
- 2:17:40So now we're getting like into more the
- 2:17:42analysis why the strategy works. And now
- 2:17:46all we need to do is for example write a
- 2:17:47script buy at minus 4 or sell at two for
- 2:17:51example. Uh okay let's go to the uh
- 2:17:55other questions. Have you ever used meta
- 2:17:57API? Uh
- 2:18:00no. You mean like Metatrader API? I I'm
- 2:18:03using like the Python integration for
- 2:18:04MetaTrader 5. Um but right now uh so
- 2:18:08right now I'm showing you an example MT5
- 2:18:10but I am uh in communication with a
- 2:18:13brokerage that offers CFD trading. So
- 2:18:15all the assets that use MT5 through a
- 2:18:18websocket uh interface, right? So I will
- 2:18:20also have like a websocket API for CFDs
- 2:18:24where I can run this not on a Windows
- 2:18:27machine but for example in a Linux
- 2:18:29cloud. And in general I prefer
- 2:18:32websockets over over REST or like MT5
- 2:18:37Python integration.
- 2:18:42Also exchanges don't pay out every 1
- 2:18:44hour anymore. I think funding is every
- 2:18:46eight hours
- 2:18:48guys. again like you have not you like
- 2:18:52I'm sorry index fader like um this is
- 2:18:55not trying to hate but more like advice
- 2:18:58don't assume that something is a certain
- 2:19:01way because obviously on hyperlquid the
- 2:19:04funding rate is charged every hour right
- 2:19:08so I think it's all about making good
- 2:19:10research not having assumptions that
- 2:19:12actually block you in creating like
- 2:19:16profitable trading strategies because
- 2:19:17with that mindset it's very difficult to
- 2:19:21actually build something profitable.
- 2:19:24So yeah
- 2:19:27uh yeah hello hello sir hi welcome to
- 2:19:30the stream HFD trading you could be
- 2:19:32slaughtered for sure in fees when big
- 2:19:34capital because you would h risk okay um
- 2:19:40did you try lighter um
- 2:19:43okay
- 2:19:46unfortunately these are not the real
- 2:19:48market making strategies I know he keeps
- 2:19:50saying that but that's not the way it is
- 2:19:52uh maybe we can come to the topic what
- 2:19:54is Market making guys like market making
- 2:19:58is just adding liquidity to the order
- 2:20:02book. It's allowing other participants
- 2:20:05on the exchange to get a price fill at
- 2:20:08any point in time. So what we can do is
- 2:20:11we just add our resting limit orders for
- 2:20:14our participants to buy at a certain
- 2:20:16price and that essentially is market.
- 2:20:20Maybe what index fader is referring to
- 2:20:22market making is like providing a
- 2:20:24constant bided ass spread 24/7
- 2:20:27which is like what most people assume
- 2:20:29but on the most basic level market
- 2:20:32making is just providing liquidity to
- 2:20:35the orbook and that's all and how you do
- 2:20:39it it's like uh you know up to a person
- 2:20:43who who does it.
- 2:20:45So okay. So this was like in our
- 2:20:48discussion round and um
- 2:20:53so finally I was able to show you the
- 2:20:56spread by exporting the history data
- 2:20:59from MT5 and hyperlquid and let's now
- 2:21:04proceed with
- 2:21:07writing the code.
- 2:21:09So let's go back to our hyperlquid
- 2:21:12client and um
- 2:21:18so we have positions, we have orders, we
- 2:21:20have market data. Now we need to
- 2:21:23implement
- 2:21:25uh trading endpoints. So send market
- 2:21:28order, limit order, cancel or amend
- 2:21:30order. So we're going to uh add these
- 2:21:34order types.
- 2:21:52Okay.
- 2:21:55So, let's now continue with uh
- 2:22:03the trading endpoints.
- 2:22:08So in trading there are always uh
- 2:22:13like uh two types for us right there are
- 2:22:16market orders and there are limit
- 2:22:17orders. So market order we are not going
- 2:22:20to be using them because we just want to
- 2:22:22add liquidity to the order book
- 2:22:26and uh
- 2:22:30so that's it. So
- 2:22:33define but I'm still going to implement
- 2:22:35all the functions. So
- 2:22:37uh define send market order, right? Then
- 2:22:43we're going to create define send limit
- 2:22:46order.
- 2:22:51Uh we will also need to provide the
- 2:22:54symbol.
- 2:22:57So the symbol
- 2:23:00uh the side which is buy or sell and
- 2:23:02then we add the volume
- 2:23:04and then we add the time in force right
- 2:23:08time in force means like fill or fill or
- 2:23:10kill immediate or cancel and and so on.
- 2:23:13And for limit orders we add symbol side.
- 2:23:17Oh so like amount right how much we want
- 2:23:19to buy or sell. For limit orders, we
- 2:23:22want to provide the price uh
- 2:23:26and again time and force
- 2:23:32and then next uh I want to add a
- 2:23:35function called uh amend order which
- 2:23:38will update our limit order. So here I
- 2:23:41think we need just need to provide the
- 2:23:43order ID and then the new amount and
- 2:23:46then the new price right to amend our
- 2:23:51existing limit order.
- 2:23:53And then we want to do define cancel
- 2:23:55order
- 2:23:57uh
- 2:23:59which cancels our order. And then the
- 2:24:01last one maybe this is like for a kill
- 2:24:03switch define cancel all orders. Right?
- 2:24:07So here these are our trading endpoints
- 2:24:09that we're going to implement and once
- 2:24:11that is done we can start writing our
- 2:24:15actual trading strategy.
- 2:24:18Uh in a market making strategy you'd be
- 2:24:21hedge also you'd be fulfilling trades at
- 2:24:23near light speed depending okay
- 2:24:26guys I think I'm going to mute index
- 2:24:28fader because it's actually disrupting
- 2:24:30the chat. It's not like I don't want to
- 2:24:32argue with him, but I want, you know, to
- 2:24:35focus on the main power of strategy and
- 2:24:38it's not arguing what marketmaking is.
- 2:24:42Uh the point of today's live stream is
- 2:24:45to create a profitable trading bot
- 2:24:47between hyperlquid MT5 and whether you
- 2:24:50call it market making or not uh you can
- 2:24:53open a Reddit post and discuss it there.
- 2:24:55So,
- 2:24:57so I'm just going to focus on that. So
- 2:25:00index fader sorry if you keep uh talking
- 2:25:04about what market making is uh we can
- 2:25:08create like a separate discussion
- 2:25:09channel for that later.
- 2:25:16Okay. Um
- 2:25:21so let's go back to cloth and uh please
- 2:25:25implement
- 2:25:27trading uh endpoints
- 2:25:31in hyperlquid client
- 2:25:38using websockets.
- 2:25:48Uh
- 2:25:56please uh return the order result
- 2:26:06for each function.
- 2:26:12So here are training endpoints. I'm just
- 2:26:14going to specify exactly what these end
- 2:26:17points are.
- 2:26:19So it's this,
- 2:26:23this,
- 2:26:25this, and that.
- 2:26:47Why don't you use whisper flow to speak
- 2:26:48in the input? Is it um
- 2:26:52like voice to AI interpreter or
- 2:26:55something like
- 2:26:58or Yeah, I've never tried that. So far,
- 2:27:00I'm just prompting with my keyboard. So
- 2:27:02I assume you're mentioning that.
- 2:27:22Okay. So now uh what I told Claude is to
- 2:27:26implement the training functions for all
- 2:27:28of these uh order types. uh they're all
- 2:27:31going to use websockets, you know, for
- 2:27:34uh best latency possible. And then I ask
- 2:27:36clot to return the order result and
- 2:27:38update open orders. Or maybe I didn't
- 2:27:42tell it to update open orders.
- 2:27:45I'll try to
- 2:27:54Okay. So
- 2:28:07we need to use hyper liquidizer for
- 2:28:09signing. Okay, let's use this library
- 2:28:12to so how it works is that uh
- 2:28:17all the data that you see on hyperlquid
- 2:28:20like this one you don't need an API key
- 2:28:24actually right all you need to provide
- 2:28:26is just the uh wallet address so in
- 2:28:29theory because like everything is
- 2:28:31running on the blockchain it's all
- 2:28:33publicly verifiable
- 2:28:35and so if you guys gave me not the
- 2:28:38wallet secret but just the wallet
- 2:28:40address, right? For examp, if I send you
- 2:28:42money with crypto, I would you would
- 2:28:43give me your wallet address. I can look
- 2:28:45up all your trades, transactions, and
- 2:28:48like your entire account uh on the
- 2:28:52blockchain. And so therefore,
- 2:28:55uh what we have here is that when we
- 2:28:57start sending orders, we are now using
- 2:29:00our API key to sign these messages. And
- 2:29:03the signing actually is a security uh
- 2:29:06feature to actually
- 2:29:09prove that we are the owner on holder of
- 2:29:11the account or basically the API key.
- 2:29:26And
- 2:29:31so now uh yeah,
- 2:29:39I'm a bit confused if it's still
- 2:29:42running.
- 2:29:47Right here we have
- 2:29:55Yeah. So Cloud is actually still
- 2:29:57thinking. So right now Cloud's been
- 2:29:59running for over three 3 minutes now and
- 2:30:04it should be fine.
- 2:30:25So while Claude is thinking,
- 2:30:30let's have a look at, you know, maybe
- 2:30:33today we still might have time to find
- 2:30:36some trading opportunities.
- 2:30:38So I will try to like open the hedge
- 2:30:41ideally before the stream ends. So right
- 2:30:44now here the funding rate on surdh is 20
- 2:30:47minus 285% 77.43
- 2:30:55x 77.42.
- 2:31:02So here the spread is like quite high.
- 2:31:04So in theory, we could, you know, maybe
- 2:31:06try to find an opportunity on this asset
- 2:31:10or maybe if you look at XYZ,
- 2:31:18Brent oil
- 2:31:21in theory, you could also like we could
- 2:31:23like try Brent oil.
- 2:31:25So yeah, let's see if cloth is done.
- 2:31:28Nice.
- 2:31:44Hi too. From your experience, how many
- 2:31:46project strategies do you have max at
- 2:31:48the same time? So me personally, I don't
- 2:31:50like to complicate things. I just like
- 2:31:52to focus on like one main strategy. But
- 2:31:55the one main strategy doesn't mean that
- 2:31:57I'm just trading this asset and this
- 2:31:59symbol. So what I mean by that is that I
- 2:32:02would for example put 90% or 80% of my
- 2:32:05entire capital allocation into this one
- 2:32:08strategy and then use the remaining
- 2:32:10funds to play around and research like
- 2:32:12other strategies and markets. So it's
- 2:32:14always like always trying to look at the
- 2:32:16best opportunities
- 2:32:18at the current moment. And
- 2:32:22so another approach you could have is
- 2:32:24like you could split like your
- 2:32:26strategies into three, four, five and
- 2:32:28like distribute all the cap equally. But
- 2:32:31for me that's like more administrative
- 2:32:33stress and like uh like more workload.
- 2:32:36So I was thinking like okay why not just
- 2:32:39focus on one single strategy and try to
- 2:32:42like optimize the results for this
- 2:32:44single strategy.
- 2:32:48So to summarize, I put most of my money
- 2:32:50into one single strategy and like with
- 2:32:53the remaining money I have, I like
- 2:32:55research, experiment and try to find
- 2:32:57like new different strategies more like
- 2:32:59a backup, right? Always try to have a
- 2:33:00backup when your main strategy stops
- 2:33:03performing well.
- 2:33:05Is it possible download historical bit
- 2:33:07ask prices in MT5 terminal? Yes, it is.
- 2:33:10You can extract the tick data that you
- 2:33:12see on MT5
- 2:33:14and you can use them for like more in
- 2:33:17detail analysis. In fact, I can show you
- 2:33:20like right now how to do it because
- 2:33:21right now I have my notebook open. And
- 2:33:24here if you call MT5 copy tick range,
- 2:33:29right? And for example, if you want the
- 2:33:30historic price on silver, you can
- 2:33:33provide um
- 2:33:37for example
- 2:33:38datetime now minus time delta.
- 2:33:45Uh so this is the start um
- 2:33:49this is a start date time and then we
- 2:33:52can take the current date time right and
- 2:33:55then
- 2:33:58you provide a flag copy takes all which
- 2:34:00means I just I want to get all the text
- 2:34:04from MT5. So
- 2:34:07this is just to answer your quick
- 2:34:10question. Uh
- 2:34:14hopefully I wrote it correctly.
- 2:34:19Copy text range. Um
- 2:34:24date from date to.
- 2:34:32Let me also call MT5.initialize
- 2:34:35to make sure that we're initialized.
- 2:34:39So initialize basically means that we're
- 2:34:42connected to MT5
- 2:34:45and like to quickly answer a question.
- 2:34:46Yes, this is how you extract text from
- 2:34:49T5. This is time, this is the bid, this
- 2:34:51is the ask and then you know some other
- 2:34:53data.
- 2:34:58Do the CFD brokers hit you with toxic
- 2:35:00flow penalties with this strategy? Uh it
- 2:35:03depends. Um, I ran some strategies where
- 2:35:07CFD brokers had no issues at all. And
- 2:35:09then I had some strategies, for example,
- 2:35:11when I tried to trade the gold arbitrage
- 2:35:14on Interactive Brokers against MT5, I
- 2:35:16was placing like five lots uh per round
- 2:35:20turn, right? Five lots on gold is 500
- 2:35:23units of gold. And at that time, gold
- 2:35:25was around like 3,000 US. So 500 times
- 2:35:293,000.
- 2:35:31So, my like position size or volume per
- 2:35:35side was $ 1.5 million US dollars,
- 2:35:37right? We're talking about leveraged
- 2:35:39positions and the CFD brokers didn't
- 2:35:42like it. So, what they did is like they
- 2:35:44didn't uh take any profits or anything.
- 2:35:47They actually restricted me with um a
- 2:35:51low leverage account. So, I was not able
- 2:35:54to play such big positions. And maybe on
- 2:35:57their back end, maybe they gave me
- 2:35:58slippages, delays, but I don't know
- 2:36:00because I can't verify what they do with
- 2:36:03their execution engine, right?
- 2:36:06Uh do you have some discord server? Uh
- 2:36:09isolated ask. Uh yes, I do. And I offer
- 2:36:11this discord server uh to my members who
- 2:36:14sub are subscribed to the ATJ research
- 2:36:16membership. So there you can like
- 2:36:18connect with me or ask me questions like
- 2:36:19you do on live chat here and like I'd be
- 2:36:22very happy to help you, you know, set up
- 2:36:24the training strategies that we're doing
- 2:36:25here on live stream or like help you
- 2:36:27with like any general algorithmic
- 2:36:29trading question.
- 2:36:32Okay, let's continue with this.
- 2:36:56Okay. So, I asked Claude to
- 2:36:59[clears throat]
- 2:37:00implement my uh trading
- 2:37:09my training endpoint.
- 2:37:13And so right now I don't see any
- 2:37:15changes. Let's see.
- 2:37:20Okay, let me just close it. Maybe it's
- 2:37:22just an issue with the IDE
- 2:37:31or maybe I have to approve the changes.
- 2:37:57Hyperlid client and it.py
- 2:38:03or actually yeah these uh endpoints have
- 2:38:06been implemented.
- 2:38:08Um
- 2:38:10so here we're get OLC history.
- 2:38:14Uh and here we have send limit order
- 2:38:17right we have send market order cancel
- 2:38:20cancel orders and you return snapshot.
- 2:38:22So these
- 2:38:25so instead of prefilling uh claw decided
- 2:38:28just to write the functions uh in this
- 2:38:31section here.
- 2:38:35So now what we should do is we should
- 2:38:37test them. So now we should be careful,
- 2:38:38right? because now we're going to send
- 2:38:40real orders uh using the API and um
- 2:39:04and so by default I'm going to like send
- 2:39:08limit orders as um uh liquidity adding
- 2:39:12orders. So they will always be added to
- 2:39:14the order book. So instead of GTC I am
- 2:39:16going to provide an AO order which
- 2:39:19stands for add liquidity only.
- 2:39:24And
- 2:39:26so this this is a request this is the
- 2:39:29market order that I'm not going to use
- 2:39:34for today's script. I just want to
- 2:39:35implement it so it's there. And then we
- 2:39:37have cancel cancel all and uh
- 2:39:48and so
- 2:39:52I need to tell clot we are also missing
- 2:39:55one endpoint in hyperlquid
- 2:39:59client uh please also add a meant
- 2:40:06order function
- 2:40:08that will update the
- 2:40:13amount and price of limit orders.
- 2:40:20So we are also missing this last
- 2:40:22function here. So we have cancel cancel
- 2:40:24all send market order and send limit
- 2:40:26order.
- 2:40:30And so now, so once this is done, we're
- 2:40:33going to test it and send uh real market
- 2:40:36data, sorry, real orders to the
- 2:40:38hyperlquid exchange.
- 2:40:45So right now we're 50 cents in profit.
- 2:40:48We can just leave it there.
- 2:41:07I'm working on a project. I was hoping
- 2:41:09if I can get some feedback from you on
- 2:41:11that. Is it possible somehow it's
- 2:41:12related to algo trading? Yes. So again,
- 2:41:15if uh you're like part of the Discord
- 2:41:18community, you can just come to me or
- 2:41:20write uh in the Discord group what your
- 2:41:22project is about and I'll happily like,
- 2:41:25you know, give you some general advice
- 2:41:27how to build that project assuming like
- 2:41:30it's something I specialize in, right?
- 2:41:31So if you tell me to code in C++,
- 2:41:34probably I will not help you. But what
- 2:41:36I'm showing on live stream here uh I
- 2:41:38believe that definitely I can provide
- 2:41:39some input uh when it comes to like
- 2:41:43cross exchange arbitragees.
- 2:41:55Okay. So it seems that our websocket
- 2:41:59client on hyperlquid has for the most
- 2:42:01part been implemented. uh in the
- 2:42:04beginning we had some issues like with
- 2:42:06uh getting the account data but as I've
- 2:42:08mentioned this is actually the least
- 2:42:10important one because again what we need
- 2:42:13uh to run our training bot is just
- 2:42:15having data for open orders positions
- 2:42:19market data and the ability to submit
- 2:42:22orders to the exchange
- 2:42:39Okay. So now um let's play around with
- 2:42:44the orders.
- 2:42:56So, uh
- 2:43:05let me create um
- 2:43:10a quick folder called tests. uh in tests
- 2:43:16folder. Please
- 2:43:18create a simple test script that opens
- 2:43:26that sends a limit order,
- 2:43:33amends that order, and cancels that
- 2:43:38order.
- 2:43:40So, we're going to, you know, try to now
- 2:43:43call these functions that we've created
- 2:43:45uh in our test folder. Uh I want cloth
- 2:43:48to create a simple script that like does
- 2:43:50all all the three things. And
- 2:43:54then we're going to run this. And so
- 2:43:57hopefully it will be the
- 2:44:00like the first time that now our uh
- 2:44:04websocket client websocket client is
- 2:44:06sending orders to the exchange. And then
- 2:44:11the only thing that's left after this is
- 2:44:13to then implement MT5, right? To get MT5
- 2:44:16pricing and look for these arbitrage
- 2:44:20opportunities.
- 2:44:29So now I need to authenticate uh
- 2:44:35this again.
- 2:44:41And so let's see.
- 2:44:48So now we're going to create a file in
- 2:44:50test
- 2:44:52and see what
- 2:44:56if our trading scripts are now working.
- 2:45:16So now let's uh go through a code
- 2:45:18quickly. So here we want to open an
- 2:45:21order on XYZ silver. Uh the size the
- 2:45:26silver size is one. So basically it's
- 2:45:28just one silver which is not that
- 2:45:29expensive. One silver right now is
- 2:45:33worth $77
- 2:45:35uh US. Right. So here we have size one.
- 2:45:41Then we're amending the size to two.
- 2:45:44Uh
- 2:45:48and here uh yeah it wants to set some
- 2:45:53offset below or above a mid price and uh
- 2:45:58then the amended offset. So I want to
- 2:46:00use static levels. Let me climmit
- 2:46:16at 100 and amend that limit to 125.
- 2:46:31So like instead uh so what cloth is
- 2:46:34trying to you know implement is more
- 2:46:36like create a market making script that
- 2:46:39places uh the prices around the mid
- 2:46:42price of this asset. But here I just
- 2:46:44want to test the price levels to just
- 2:46:47send it like at as I said 100 and 125.
- 2:46:50Right? So when we run this script, we
- 2:46:53should have a sell limit at this level
- 2:46:55at 100 and then amend it at 225 and then
- 2:46:59cancel that order.
- 2:47:40Okay. So,
- 2:47:45I'm just reviewing the code, making sure
- 2:47:47that there is no issue.
- 2:47:50And so, now we should I'm just going to
- 2:47:53try to, you know, run this script. And
- 2:47:56so what it's going to do is we're going
- 2:47:57to send a limit order, then going to
- 2:48:00amend it, and then we're going to cancel
- 2:48:03it. And and so what I'm also going to do
- 2:48:05is I'm going to add a sleep function,
- 2:48:08right? So I'm going to wait 5 seconds be
- 2:48:10uh uh after every action so that we can
- 2:48:14like observe uh like slowly if it works
- 2:48:18or not. So here I'm going to also do
- 2:48:20from time import sleep
- 2:48:26Hey, what are you using to code cloud
- 2:48:28code? Yes, I am using PyCharm. I'm
- 2:48:31coding in Python. I'm using cloud code
- 2:48:33to uh you know help me create the the
- 2:48:37scripts here.
- 2:48:41So, I'm like double checking double
- 2:48:44checking side size limit price. I think
- 2:48:47it should be fine.
- 2:48:50So, now we're running our test. uh
- 2:48:54string script and
- 2:49:03when I run test trading.py
- 2:49:11I get this error.
- 2:49:15What's the issue?
- 2:49:46Okay.
- 2:49:49So maybe I can try to run this again.
- 2:49:55So your sent limit order cell.
- 2:49:58Uh so we're in step number one
- 2:50:02training requests SDK. Okay. So it seems
- 2:50:05that cloth imported or like is using
- 2:50:08this uh package but I forgot to install
- 2:50:11it using pip install. So what a simple
- 2:50:15fix is just
- 2:50:17writing pip install
- 2:50:21um hyperlquid python SDK
- 2:50:32and then we call pip install ETH Count.
- 2:51:00So, we're just making sure that all the
- 2:51:02packages are now installed. And so let
- 2:51:05me restart the script.
- 2:51:25And let's just debug using Cloud again.
- 2:51:45what is the bot already doing? So, right
- 2:51:48now, uh I'm testing the trading
- 2:51:51endpoints on my of my script and I'm
- 2:51:53trying to submit orders to Hyperlquid.
- 2:51:57So here I'm trying to send a limit
- 2:52:00order, amend that order and then cancel
- 2:52:02that order which will be used for a
- 2:52:04trade bot to then uh yeah arbitrage the
- 2:52:08prices.
- 2:52:20So in theory we could use like market
- 2:52:21orders when the uh
- 2:52:27one second. So we could in theory use
- 2:52:30market orders like when we see that the
- 2:52:31price is like very far away from the
- 2:52:35current price. We could just use take
- 2:52:36orders but they are more expensive. This
- 2:52:38is one approach or we could add like
- 2:52:40limit orders and try to capture the
- 2:52:42spread for a good price and then hedge
- 2:52:44it with MT5. So there are like two
- 2:52:46approaches. I'm going to use the
- 2:52:48approach that's uh a bit safer and like
- 2:52:51more uh how you call it more consistent.
- 2:52:55But if you want like an actual arbitrage
- 2:52:57strategy that just looks at price
- 2:52:59discrepancies, buys and sells at the
- 2:53:01same time, uh this is also something you
- 2:53:03could do. But then you don't have as
- 2:53:05many opportunities because the fees for
- 2:53:08taker orders are much higher.
- 2:53:15Okay, let's see if Claude
- 2:53:19was able to
- 2:53:22identify the the issue now.
- 2:53:32Yes. Uh I'm trying to enter as a maker
- 2:53:34to avoid a taker fee. That's correct.
- 2:54:06So now um let's just try to run it
- 2:54:10again.
- 2:54:12I think there are some naming issues
- 2:54:14with the asset and the symbol. So,
- 2:54:21coin silver is not found in that
- 2:54:23universe.
- 2:54:25So, if this keeps on with claw, most
- 2:54:27likely I will try to, you know, fix the
- 2:54:30issue myself.
- 2:54:32But I think we're very close. Uh
- 2:54:56so
- 2:55:13Okay,
- 2:55:18most likely the coins list is different
- 2:55:20inside the meta.
- 2:55:22Let me make the air surface what's
- 2:55:24actually there so you can see.
- 2:55:50So I think the problem here is that when
- 2:55:52we call
- 2:55:55uh
- 2:56:10Okay, now we're getting somewhere. So,
- 2:56:11here we have the list of coins that are
- 2:56:14tradable in our DEX universe.
- 2:56:22So, I'm going to do some little
- 2:56:24debugging and fixing.
- 2:56:27Will the bot check indicators to decide
- 2:56:29buy and sell? Uh, yes. We're going to
- 2:56:31well initially we're going to uh
- 2:56:36like compute the indicators ourselves.
- 2:56:38We're going to like set for example a
- 2:56:40manual level. Say we want to sell at two
- 2:56:42and exit at zero. And then eventually we
- 2:56:45can apply uh Ballinger band or Z score
- 2:56:49to have like more autonomous uh logic to
- 2:56:52enter uh into trades.
- 2:56:56Do you think it would be possible to use
- 2:56:58this arbitrage between for example HP
- 2:56:59and Mexir Binance? Well, it depends on
- 2:57:02the exchange uh and their commission
- 2:57:04tiers. If you are like a big market
- 2:57:07maker or or like a big fund, right? Uh
- 2:57:10you will usually get like very good
- 2:57:12training conditions and rebates. Uh on
- 2:57:14Binance, you need to be a very big
- 2:57:16client to do that. So, it's quite
- 2:57:18difficult for retail. But on Max Ci, I
- 2:57:20think they offer zero commissions on
- 2:57:23maker orders on some assets or like if
- 2:57:25you look at the exchange promotions,
- 2:57:27many times they also offer like trading
- 2:57:29for zero fees.
- 2:57:34So many times it just comes down to how
- 2:57:37low are the fees for uh for retail and
- 2:57:41it's always like good to just look at
- 2:57:43exchanges that actually offer the the
- 2:57:46lowest lowest fees.
- 2:58:06When instantiating
- 2:58:08the
- 2:58:10hyper liquid client class,
- 2:58:14can you add
- 2:58:17a text? What is it?
- 2:58:27uh
- 2:58:31argument. So the class knows which text
- 2:58:36to work with
- 2:58:39like HL client is equal to hyperlquid
- 2:58:45uh client
- 2:58:49dex is equal to xyz.
- 2:59:03In that case would your MT5 be the
- 2:59:05spread of broker are using broker that
- 2:59:07only charge commission? Uh in case of
- 2:59:09MT5 it would be the commission plus a
- 2:59:12spread. But in many cases on MT5 uh you
- 2:59:15don't pay any commission. So for example
- 2:59:17if you trade the SP500 index on MT5
- 2:59:20there are no commissions. But if you
- 2:59:22trade for example silver there is a
- 2:59:24commission and a spread. But again they
- 2:59:27are quite cheap uh
- 2:59:30uh like in in comparison for example to
- 2:59:34other exchanges. So
- 2:59:45so now what I did is that because there
- 2:59:47are like many assets and many like
- 2:59:49universes on the hyperl exch exchange.
- 2:59:52So when I create the hyperlquid client
- 2:59:54class, I also want to like specify which
- 2:59:57exchange I want to connect to.
- 3:00:14And so now uh we've performed like this
- 3:00:17change where I can like specify the
- 3:00:18decks for a hyperlink client class. And
- 3:00:23so now if I go to test trading and I
- 3:00:26look at this part here. So I can say
- 3:00:29like Dex is equal to XYZ. Uh I I believe
- 3:00:32that it's still not going to be fixed
- 3:00:34yet, but I applied like this change to
- 3:00:36like isolate the issues for this
- 3:00:38individual exchange.
- 3:00:40And so now
- 3:00:43I'm going to uh
- 3:00:46tell Claw that I'm having this issue
- 3:00:49still.
- 3:01:18and so
- 3:01:24okay let's apply the change.
- 3:01:46And hopefully
- 3:01:55Okay, it seems that status okay
- 3:02:00amendment order status okay
- 3:02:04and cancel order process finished.
- 3:02:08So this is amazing. So uh let me try to
- 3:02:13uh
- 3:02:18run this script uh while showing you the
- 3:02:21hyperlquid uh UI.
- 3:02:28So it seems that here the order did not
- 3:02:30get cancelled. But let me restart the
- 3:02:32script and let's see if the trades are
- 3:02:36being submitted to Hyperlquid.
- 3:02:38So now we've created a short one at 100.
- 3:02:43Then 5 seconds later
- 3:02:46it got amended to two uh with price 125
- 3:02:51and
- 3:02:56then it should get cancelled.
- 3:03:13So here we have response uh order was
- 3:03:16never placed or cancelled or filled. Uh
- 3:03:26so here I am telling clot I'm getting
- 3:03:35in test trading.py
- 3:03:40the order
- 3:03:45has not been cancelled.
- 3:03:48uh correctly.
- 3:03:57So, so
- 3:04:00actually it's great, right? So, our
- 3:04:01script finally opened uh sell at 100.
- 3:04:05Then it amended it at order 225,
- 3:04:08but we just uh had an issue with
- 3:04:12cancelling that order.
- 3:04:24Okay. So now
- 3:04:27clot again suggested
- 3:04:37new change.
- 3:04:40And so now let's again try to run the
- 3:04:43script again. So here I'm going to
- 3:04:45cancel this old order. And guys, so
- 3:04:48so again what we're going to do is
- 3:04:51uh our script will place a sell order at
- 3:04:54100.
- 3:04:56So and now 5 seconds later it will amend
- 3:04:59that order to 125 and then it should
- 3:05:03cancel the order.
- 3:05:08All right. So
- 3:05:10after 3 hours we've been we got quite
- 3:05:12far. So finally we got we also
- 3:05:14implemented the orders which means that
- 3:05:18finally we can start writing our trading
- 3:05:20bot and try to find you know some
- 3:05:23trading opportunity. So the last thing
- 3:05:25that we need to do is we need to create
- 3:05:27like a strategy logic
- 3:05:29compare the pricing with MT5 and then
- 3:05:34maybe today we'll find some trading
- 3:05:37opportunity and try to find you know
- 3:05:39some hedge that for example I can then
- 3:05:41show tomorrow and ideally you know we'll
- 3:05:44make some profit today or tomorrow and
- 3:05:47then yeah once that is done we can then
- 3:05:50try to you know write a fully autonomous
- 3:05:52string bot that for example uses z
- 3:05:54scores
- 3:05:55And uh then it can like run 245 from
- 3:05:58Monday to Friday. So anyways, I'll have
- 3:06:01another toilet break. So I'll be right
- 3:06:02back. So uh
- 3:06:06so please give me a few minutes
- 3:06:13and I'll be back soon again.
- 3:10:17Okay, so I'm [clears throat] back and
- 3:10:20let's
- 3:10:22try to finish our training bot. So now I
- 3:10:25see that a order works
- 3:10:30and so now
- 3:10:33let's write
- 3:10:36our trading strategy.
- 3:10:42So here I'm going to create a file
- 3:10:44called tradingbot.py
- 3:10:47and here I'm going to define like the
- 3:10:50main strategy logic of of the trading
- 3:10:54bot
- 3:10:57and yeah let's see where
- 3:11:00where we'll get. So,
- 3:11:06uh,
- 3:11:16capture spread
- 3:11:24for arbitrage
- 3:11:27price.
- 3:11:35Okay, I'm just going to check what
- 3:11:37symbol I'm going to use. Maybe I will
- 3:11:39find some good asset where I can try to
- 3:11:42open a hedge. And right now I see that
- 3:11:44S&P 500 has a negative funding rate. So
- 3:11:47here we have 7544
- 3:11:50and here we have 7553.
- 3:11:52So maybe we can try to you know open a
- 3:11:54long position on S&P 500 try to capture
- 3:11:58you know this price difference and maybe
- 3:12:02like in the meantime or we can like also
- 3:12:04try to like to find other assets too.
- 3:12:07But I think we can try to test on SP500
- 3:12:11or another thing we can like try to uh
- 3:12:15experiment on is Euro USD. I think that
- 3:12:18could also uh work quite well even
- 3:12:21though the liquidity is not as high
- 3:12:24here. But first let's just finish the
- 3:12:27train script and then um you know
- 3:12:29depending once it's done depending on
- 3:12:31the current market conditions we can
- 3:12:33then try to choose any asset that you
- 3:12:35want.
- 3:12:38So here I'm just going to document the
- 3:12:41strategy logic.
- 3:12:43So all I'm going to do here is uh
- 3:12:56from exchange connect exchange
- 3:12:58connectors hyperlquid client import
- 3:13:01hybrid client. Right now I don't have my
- 3:13:03MT5 client implemented yet. So we're
- 3:13:05going to work directly with the
- 3:13:08Metatrader 5 library. So import
- 3:13:10metatrader 5 as MT5 and then maybe in
- 3:13:15the next live stream we can also like do
- 3:13:17a similar thing that we did like here
- 3:13:21right we've defined all these endpoints
- 3:13:23but MT5 library is quite easy to work
- 3:13:26with so it doesn't need like that much
- 3:13:28work like as you seen we spent like two
- 3:13:30hours or three hours implementing this
- 3:13:32uh client class and I think it's only
- 3:13:34like 50 60% done still requires like a
- 3:13:37lot of like revisions but it in my
- 3:13:39opinion already usable. So we can start
- 3:13:43uh
- 3:13:45yeah so we can start uh writing our
- 3:13:48first trading script.
- 3:13:51So
- 3:13:53here these are the imports. Uh
- 3:14:00so what we can define here in this
- 3:14:03script is we can define some
- 3:14:08like initial parameters of the strategy.
- 3:14:13So I can for example say target spread
- 3:14:17uh cell
- 3:14:18is equal to uh four. Let me explain to
- 3:14:21you again like how these parameters
- 3:14:24would work. So if we go to analysis and
- 3:14:28go to calculate historical spread, uh
- 3:14:30what you see here like right here
- 3:14:36is the historical spread on the S&P 500
- 3:14:40500 index. Right. So here you can see
- 3:14:42here the title is a bit wrong though.
- 3:14:46Oh, it's actually correct. It's fine. We
- 3:14:48could short S&P 500 at let's say two or
- 3:14:52even like three like for testing
- 3:14:54purposes I can like just say one or two
- 3:14:56right and then when we have actual
- 3:14:58profitable signals then I would like
- 3:15:00adjust the levels accordingly but let's
- 3:15:02say we just want to short at two and
- 3:15:05exit at zero right
- 3:15:10for example so uh here in my training
- 3:15:13bot I can say for my target spread cell
- 3:15:16is four. My target spread by is let's
- 3:15:20say minus 4.
- 3:15:23And so these are the levels that I'm
- 3:15:25going to set to define my entry logic.
- 3:15:29Um,
- 3:15:36of course, the symbol
- 3:15:38uh on hyperlquid is going to be uh
- 3:15:44XYZ
- 3:15:46SP500
- 3:15:47and the symbol on MT5 is going to be
- 3:15:51SP500. Right.
- 3:15:54Yes, it's here. It's no it's actually
- 3:15:56called US 500.
- 3:16:03So
- 3:16:06the volume on hyperlquid is uh going to
- 3:16:11be one
- 3:16:16and
- 3:16:18so the thing is like uh you could write
- 3:16:20like the volume MT5 should be one but
- 3:16:23this is something like that I want to
- 3:16:24explain now just because you quote a
- 3:16:26volume of of one on hyperlquid does not
- 3:16:29mean that you're going to get filled
- 3:16:31what right you can get filled 0.1 0.01
- 3:16:34right it depends on the counterparty who
- 3:16:37decides you know to get filled at that
- 3:16:40price so in this case we don't control
- 3:16:43what the volume on MT5 is but we just
- 3:16:46have to check the exposure on hyperlquid
- 3:16:49and then send a market order to MT5 once
- 3:16:52that position is hedged.
- 3:16:57So we actually don't need to use volume
- 3:16:59MT5.
- 3:17:01But what we can do is we can for example
- 3:17:04specify what the contract size on MT5
- 3:17:06is. So the contract uh size on MT5 is
- 3:17:13100. So if we for example go short one
- 3:17:17unit on hyperlquid, we want to buy 0.01
- 3:17:22on D5 because of these contract size
- 3:17:25differences. So this is a difference.
- 3:17:28So that's why I specified contract size
- 3:17:30to be 100.
- 3:17:34And so what other initial parameters uh
- 3:17:37do we need?
- 3:17:44I guess this is actually all we need. So
- 3:17:47for now I think uh
- 3:17:50the target spread is actually not a
- 3:17:52fixed value. So we don't actually need
- 3:17:54to uh create it fixed but we can like
- 3:17:56add it inside a function. So
- 3:18:02let's first initialize
- 3:18:04our hyperut client right. So our hl
- 3:18:07client is equal to hyperquate client
- 3:18:11with our dex being uh xyz
- 3:18:15and then our mt5 client
- 3:18:20or we can collect this. So this is our
- 3:18:22MT5 client.
- 3:18:24Uh
- 3:18:26it's just our MT5 client and we
- 3:18:28initialize it. Right?
- 3:18:31So here in this section we're
- 3:18:33initializing
- 3:18:34Exchange connectors
- 3:18:42and then
- 3:18:49initialize
- 3:18:53And then we can create a very simple
- 3:18:55loop here. So while true we can sleep 1
- 3:18:59second
- 3:19:00uh from time port sleep
- 3:19:07and then we can print
- 3:19:10an empty line here.
- 3:19:14And then
- 3:19:20for now let's just try to run this.
- 3:19:38Okay. So uh
- 3:19:46so now both our uh connectors have been
- 3:19:50initialized. So basically we can like
- 3:19:53access different endpoints just get
- 3:19:55market data and so on and compare the
- 3:19:58prices between those exchanges. So right
- 3:20:01now what we need to do is we need to you
- 3:20:03know compare the price between
- 3:20:06hyperlquid MT5. So to explain what we
- 3:20:10can do is we can first
- 3:20:13subscribe to the best bit offer which
- 3:20:15will then return the uh current price
- 3:20:19for uh XYZ silver. So here I can
- 3:20:24or I mean S&P 500. So here we're
- 3:20:27subscribing to the market data of
- 3:20:29hyperlquid. And so here
- 3:20:34I can write a very simple function
- 3:20:35define uh calculate spread right.
- 3:20:43So uh what we can do here is we can
- 3:20:47extract the pricing from hyperlquid. So
- 3:20:50here uh
- 3:20:55let's call it uh price hyperlquid is
- 3:20:59equal to hyperlquid data client dot
- 3:21:03market data and we want the market data
- 3:21:06for this symbol here I'm going to add
- 3:21:09maybe a sleep function maybe like two
- 3:21:11seconds to initialize the data and then
- 3:21:15in let's print
- 3:21:18price hyperlquid
- 3:21:25And let's call this function with every
- 3:21:28iteration.
- 3:21:40Oh, of course I need to
- 3:21:44also print the data.
- 3:21:53And here you can see that we have the
- 3:21:55the bit price uh and the ask price,
- 3:21:58right? That's all we need to compute the
- 3:22:00prices.
- 3:22:08So now [clears throat]
- 3:22:12I can save the data. For example, in
- 3:22:14bitid hyperlquid is equal to the price
- 3:22:17of hyperlquid
- 3:22:19um
- 3:22:21with the keyword bid and uh price
- 3:22:27and here the ask hyperlquid is equal to
- 3:22:30this value. And guys, you might be
- 3:22:32asking like why I'm not closing cloud
- 3:22:33now. I just the reason I'm doing this is
- 3:22:36like I'm writing like a very simple
- 3:22:38template for cloud like a skeleton to
- 3:22:40provide already like the basic functions
- 3:22:43it needs and then I want it to work from
- 3:22:45there because this type of coding is
- 3:22:47actually like very easy for me. So I
- 3:22:50just like to implement like a very
- 3:22:52simple script that just computes uh the
- 3:22:55spread and then uh cloud can take over
- 3:22:58once we you know go to a more advanced
- 3:23:01task.
- 3:23:03And so this is the price for hyperlquid
- 3:23:05and then price MT5.
- 3:23:09For MT5 we can just do MT5 client dot
- 3:23:13symbol info where we add the MT5 data.
- 3:23:17And so here the bit MT5 is equal to the
- 3:23:22price of MT5
- 3:23:25dot bit. It's much easier on MT5 and the
- 3:23:29ask MT5
- 3:23:31is the ask price. Right? So here we can
- 3:23:33also print
- 3:23:35uh price MT5 and get the price data for
- 3:23:40US 500.
- 3:23:48So we can see guys right. So here we
- 3:23:49have the data for MT5 and so instead of
- 3:23:52printing uh these things here I will
- 3:23:58print it like this. So here I'm going to
- 3:24:01write a bit hyperlquid
- 3:24:11and then I'm going to print it like
- 3:24:14this. So here I'm going to add ask
- 3:24:16hyperlquid and then so for MT5 I'm going
- 3:24:20to do the same format. So bit MT5
- 3:24:26uh
- 3:24:29and then the ask MT5. And then to
- 3:24:31compute the spread, it's actually really
- 3:24:33easy. Just, you know, take uh bit minus
- 3:24:36bit and ask minus ask. And let me
- 3:24:38explain which prices are we going to
- 3:24:40use, you know, for calculation of
- 3:24:42spread. Like what does bit mean? What
- 3:24:44does ask mean for us?
- 3:24:54So here you see that we have the prices
- 3:24:58And so think about this scenario
- 3:25:01when we want to buy on hyperlquid right
- 3:25:04it means we're quoting the bit price
- 3:25:07right so we as market makers are adding
- 3:25:11liquidity uh to the order book we are
- 3:25:14quoting the bit and that's why we can
- 3:25:16actually use the bit price as reference
- 3:25:19on hyperlquid to compute the bit spread
- 3:25:23or the buy spread right so when I'm
- 3:25:26going to compute the bit spread. The bit
- 3:25:30spread is the bit price of hyperlquid
- 3:25:33because we want to buy at this price
- 3:25:36minus
- 3:25:37the
- 3:25:39bit on MT5 because if you want to, you
- 3:25:42know, again long the spread, we need to
- 3:25:45buy at the bit on hyperlquid and we need
- 3:25:48to sell on MT5. And when we sell on MT5,
- 3:25:50because we are market takers, we will
- 3:25:52always sell at the bid price because the
- 3:25:54broker will always quote us a worse
- 3:25:56price for a sales, a lower price. So
- 3:25:59this is the bit bit spread. This is the
- 3:26:03ask uh spread.
- 3:26:11And so these are the values that we're
- 3:26:14going to use to compute the pricing
- 3:26:17discrepancies.
- 3:26:23And here I'm going to return dictionary.
- 3:26:25So here the bit spread is equal.
- 3:26:41And here we see that the hyperlquid
- 3:26:43values uh return a string and not a
- 3:26:48float.
- 3:26:51And there are ways to fix this. I can
- 3:26:52either fix it in the script here, but
- 3:26:54because I know that I'm going to
- 3:26:58uh work with it uh on other projects and
- 3:27:01other scripts also, I'm going to convert
- 3:27:04the data
- 3:27:07inside
- 3:27:08the
- 3:27:13uh hyperlquid client class.
- 3:27:16So I'm going to plot um
- 3:27:20hyperlquid
- 3:27:22client returns strings
- 3:27:26prices
- 3:27:29market prices
- 3:27:31as strings.
- 3:27:34Can you convert them to floats?
- 3:27:54So here we're just going to uh yeah
- 3:27:57change the
- 3:28:00data types and we're going to edit the
- 3:28:03edit.py file. So here as you can see uh
- 3:28:07we're changing these values to floats.
- 3:28:39Okay, so let's try to run our training
- 3:28:41bot and hopefully we now have the spread
- 3:28:44between those two prices computed. So
- 3:28:47now you see that here this is the bit
- 3:28:49spread. So right now the difference
- 3:28:51between hyper 25 is roughly minus1 for a
- 3:28:55bit and minus 1.2 for the ask.
- 3:29:04So this is great. So now we can for
- 3:29:05example write a simple script to buy at
- 3:29:08this bit price and then hedge it with
- 3:29:11MT5 which would then
- 3:29:15uh yeah complete the main task for today
- 3:29:18and it is like to open like this hedge
- 3:29:20position
- 3:29:22and then we want to like to create train
- 3:29:24bot that would like run uh enter time.
- 3:29:28So now I can create a function. So
- 3:29:31actually what I like to do usually is
- 3:29:34like I don't like to
- 3:29:36uh
- 3:29:39how do you say it uh use prices
- 3:29:43there are for example old or like when
- 3:29:45it spikes you know sometimes the market
- 3:29:47can spike one tick I like to for example
- 3:29:49use uh averages so what I can do is I
- 3:29:52can compute like a 5-second average for
- 3:29:54a bit in ask spread to smoon out you
- 3:29:56know the signal to you know filter out
- 3:29:59any like big price spikes and also What
- 3:30:01I can do is I can add like a tick
- 3:30:04timeout check. So if the last tick or
- 3:30:07the price update is too old then I can
- 3:30:11disregard this price. But let's start
- 3:30:14with the first one
- 3:30:22in trading bot.py pi
- 3:30:27I'm computing the bit
- 3:30:31spread and ask spread.
- 3:30:35Can you save these values in a list and
- 3:30:40compute a 5-second
- 3:30:43average of those values
- 3:30:47in the
- 3:30:51main
- 3:30:56in the main strategy loop section.
- 3:31:27So now Claude is working on it.
- 3:31:59And yes, let's
- 3:32:03accept the changes.
- 3:32:43Okay.
- 3:32:47So, yeah, question here. Do you only
- 3:32:49create arbitrage strategies or do you
- 3:32:50have any indicators based uh strats?
- 3:32:52Right now, I'm just focusing on
- 3:32:54arbitrage trading or if you remember my
- 3:32:56USDC USD marketmaking bot, but it is
- 3:32:59basically almost like a risk-free
- 3:33:02strategy because uh the price doesn't
- 3:33:04move anywhere. So I'm more focused just
- 3:33:06on these strategies that can generate
- 3:33:10like almost risk-free uh return.
- 3:33:34Okay. Okay. So this is done.
- 3:33:47Please print the 5second average bit
- 3:33:49spread and the 5-second average spread
- 3:33:53in the main loop.
- 3:34:28Okay, it seems that the price didn't
- 3:34:30initialize correctly.
- 3:34:39So, I'm actually going to add a to-do.
- 3:34:46Check if market data on Hyperlquit is
- 3:34:50available.
- 3:34:59If yes, proceed.
- 3:35:02Beautiful.
- 3:35:08So here uh we have the 5-second
- 3:35:11averages. So here instead of using the
- 3:35:13current bid and ask I'm going to use the
- 3:35:16average values of this as my signal. So
- 3:35:20here I can
- 3:35:22actually return this
- 3:35:24and here I can uh
- 3:35:28yeah display this these average values
- 3:35:35also I'm telling clot to
- 3:35:39Okay.
- 3:36:07Okay. So here we've implemented some
- 3:36:11changes
- 3:36:15and again like uh you see that uh we
- 3:36:18need to check if the market data is
- 3:36:21available
- 3:36:25please uh
- 3:36:29implement this to-do task in
- 3:36:34tradingbot.py
- 3:36:36Hi.
- 3:37:01Do you want to make this edit to
- 3:37:03trainbot.py? pi.
- 3:37:11Okay, let's run this.
- 3:37:37Okay, great. So now we have the average
- 3:37:39bit spread and average ask spread. I can
- 3:37:42actually print these uh side by side so
- 3:37:47we save a bit of space.
- 3:38:02I'm going to
- 3:38:05rename like this so it's not too
- 3:38:07confusing. There's a bit and ask spread,
- 3:38:09right? And there's the bit spread and
- 3:38:11the ask spread. Okay, a bit confusing,
- 3:38:13but
- 3:38:15I think should be fine.
- 3:38:20Okay. So now I think we have all the
- 3:38:23things we need to
- 3:38:26uh
- 3:38:28like try to open like a trade, right? So
- 3:38:30uh now we have like the signals, right?
- 3:38:33So let's see if I can find something
- 3:38:36that we can theoretically trade
- 3:38:41something that's not too expensive and
- 3:38:43like cost efficient on MT5.
- 3:38:53Interesting. The JP uh 225 index has an
- 3:38:57annual funding rate of 94%.
- 3:39:02Yeah, this in theory
- 3:39:04could be very good even though the
- 3:39:05liquidity is quite low. It's just 7
- 3:39:07$760,000
- 3:39:10in the past uh 24 hours.
- 3:39:14But this could theoretically work. The
- 3:39:18only problem is that this asset is coded
- 3:39:21in USD and the JP225
- 3:39:25index on MT5
- 3:39:27might be coded in JPY.
- 3:39:31What are you building, brother? I'm
- 3:39:32building an arbitrage bot within
- 3:39:34Hyperlquid and MT5. I've added the exact
- 3:39:37strategy description and the project
- 3:39:39description in the descriptions uh below
- 3:39:42the live stream. So you can check it
- 3:39:44out. So there's an article on my website
- 3:39:46and you can read more about it there.
- 3:39:52Here we have 65,000
- 3:39:56and here we also have 65,000.
- 3:39:59So instead, if I buy one
- 3:40:03JP225,
- 3:40:06the order value of this position would
- 3:40:09be $65,000
- 3:40:12US
- 3:40:17and that is crazy. Yeah, I didn't
- 3:40:22I didn't price adjust that. So let's not
- 3:40:24focus on GP225 for now. But it would be
- 3:40:26a great trading opportunity,
- 3:40:29but I would like to focus on something
- 3:40:31more simple today.
- 3:40:33Maybe GBP is the that I've mentioned
- 3:40:37here. The funding rates are still quite
- 3:40:39good. So maybe we could try something.
- 3:40:45Have you had any success so far in
- 3:40:47actually making money?
- 3:40:50How about
- 3:40:52I mean I could say yes but you can just
- 3:40:54stay on the live stream and find out for
- 3:40:56yourself.
- 3:40:59Hey, can you make a video about algo
- 3:41:00trading propers like funded algo
- 3:41:02trading? Yeah, that's an interesting
- 3:41:04topic. Maybe I can like create a simple
- 3:41:06script and show you guys how to you know
- 3:41:08implement some risk management
- 3:41:09algorithms but it's not something like I
- 3:41:13want to pursue because
- 3:41:15uh yeah I used to work for a prop firm
- 3:41:17and like I'm over prop firms so this
- 3:41:21strategy that you're looking at is
- 3:41:23something that I like really want to
- 3:41:25focus right now which is just arbitrage
- 3:41:28trading basically but you can also apply
- 3:41:30arbitrage trading propers that's
- 3:41:32definitely possible
- 3:41:35But there's always the risk factor of
- 3:41:37getting denied and those consistency
- 3:41:38rules that I actually don't like at all.
- 3:41:57Do you only do most arbitrage in most of
- 3:42:00strategies and why? Well, the reason why
- 3:42:02is that the risk profile is quite low,
- 3:42:05right? In arbitrage, you aim to capture
- 3:42:08capture almost a risk-free profit. And
- 3:42:11so, for that reason, I like the
- 3:42:13consistency. And so, when arbitrage
- 3:42:16strategies stop working performing, what
- 3:42:18you see is that eventually maybe you
- 3:42:20just get a break even outcome or a
- 3:42:22slight loss, which means you can just
- 3:42:24try to look for different strategies.
- 3:42:27So, I always hated losing in trading.
- 3:42:32So the best way to actually not lose
- 3:42:35is to look for arbitrageing
- 3:42:38opportunities, right? Risk-free setups.
- 3:42:42And that's the main reason.
- 3:42:54Okay, guys. So, I decided let's just
- 3:42:56stick with S&P 500. We're just going to
- 3:42:58place one test trait because SP5 500 is
- 3:43:01quite cheap and actually the most liquid
- 3:43:03asset on hyperlquid. And once the script
- 3:43:06works works, we can then try to apply it
- 3:43:08on a different asset.
- 3:43:14So here I can create a function to quote
- 3:43:17a limit price on hyperlquid and when
- 3:43:19that price gets filled I want it to
- 3:43:22hedge that trade or hedge the exposure
- 3:43:25uh with Metatrader 5.
- 3:43:30I'm also a software engineer with eight
- 3:43:32plus years of experience and work
- 3:43:33nowadays in creating AI agents but have
- 3:43:35any training background except memecoin
- 3:43:36trading. Do you think think I can learn
- 3:43:39this? So if you're a software engineer,
- 3:43:41I think that's a great advantage because
- 3:43:43at least when you code using AI, you can
- 3:43:46like get very good results by having
- 3:43:49like good understanding what the code is
- 3:43:51doing. And in trading if you learn the
- 3:43:54basic concepts which I think you can
- 3:43:56learn them quite easily. Uh I think that
- 3:43:59is quite possible like there's a saying
- 3:44:03I don't know who said it but uh someone
- 3:44:05said it's easier to like teach a
- 3:44:08mathematician or physician trading than
- 3:44:10a trader how to do physics right uh
- 3:44:12maybe some of you guys know the name of
- 3:44:14the guy who said it but I I think that
- 3:44:18is in my opinion true you you can always
- 3:44:23it's easier to learn trading than it is
- 3:44:24to learn physics so uh that's what it
- 3:44:28or coding in this instance.
- 3:44:36So I'm going to create a function called
- 3:44:38quote bid on hyperlquid. So this
- 3:44:41function will quote a bit price on
- 3:44:44hyperlquid and then once that uh
- 3:44:47position gets filled it will then try to
- 3:44:49send a market order to MT5 and hedge
- 3:44:52that exposure
- 3:44:55and the arguments of this will be uh
- 3:45:01the target spread so the price we want
- 3:45:04to capture it for and that's basically
- 3:45:07it and then so I'm going to like
- 3:45:09document this function is going to do
- 3:45:11and I'm going to create a same function
- 3:45:13called quote ask on hyperlquid with the
- 3:45:16same things right and so here in this uh
- 3:45:24in this like main strategy loop what I
- 3:45:27can do is 10k enough to start yes
- 3:45:30absolutely even 1k is enough to start
- 3:45:32with the strategy so you can like start
- 3:45:34very small and build up from build it up
- 3:45:38from from here.
- 3:45:42As I said, I I I've been trying to teach
- 3:45:44my brother and he started with $1,000
- 3:45:46and like he's
- 3:45:49he's got very good results over over the
- 3:45:51past few weeks. Actually, I can ask him
- 3:45:53to generate a report and then you know
- 3:45:56share the results with you guys so you
- 3:45:58guys can have a rough understanding how
- 3:46:01you know you know my family and my
- 3:46:03colleagues are also performing the
- 3:46:04office.
- 3:46:20So I think
- 3:46:24here what we can do is uh
- 3:46:31actually here we have this target spread
- 3:46:34by and target spread
- 3:46:37So maybe we can like create
- 3:46:40like these levels. So what I can do is
- 3:46:44this
- 3:46:51if average bit spread is lower equal to
- 3:46:55our target spread by so it's like a now
- 3:46:58we're creating signal right
- 3:47:06we're creating entry signal here if
- 3:47:09average bit spread is less than target
- 3:47:11spread by we want to start quoting
- 3:47:17the the bit on hyperlquid.
- 3:47:24And then here we have like this target
- 3:47:26spread and our target spread we want to
- 3:47:28buy for
- 3:47:30minus one,
- 3:47:32right? And so the same thing for uh
- 3:47:38if average ask spread
- 3:47:43is greater or equal to target spread
- 3:47:46cell you can quote the ask on hyperlquid
- 3:47:50for this price here.
- 3:47:56What do you think is missing for us to
- 3:47:57have a financial super AI technology? Do
- 3:48:00we have enough data, algorithms, process
- 3:48:01data, LLMs, news and so on? I don't know
- 3:48:06unfortunately. Uh so I've always been
- 3:48:09trading like doing manual research, you
- 3:48:12know, I've been working with notebooks,
- 3:48:13writing more algorithms and right now
- 3:48:16I'm at this stage where AI is just
- 3:48:18helping me to write code, right? But it
- 3:48:20doesn't help me with any type of
- 3:48:23analysis or signal generation. All it
- 3:48:26does is just help me write code. And uh
- 3:48:29so far it's been helping me quite a lot.
- 3:48:32But I think AI can like really be used
- 3:48:35to you know create signals, process
- 3:48:38data, news and so on. So I believe
- 3:48:40there's a lot of like use case for this.
- 3:48:42But right now I am not very
- 3:48:44knowledgeable or experienced in this in
- 3:48:47this field.
- 3:48:50So guys right now the ask the bit spread
- 3:48:52is minus 1.9 right. So I can try to buy
- 3:48:55at minus two right and try to capture
- 3:48:57this. So first let me uh
- 3:49:03let me try to do this. So
- 3:49:12so first I'm going to create an input.
- 3:49:16So here I'm going to create a direction
- 3:49:19variable called direction is equal to
- 3:49:21input.
- 3:49:23And here we're going to create a
- 3:49:26direction
- 3:49:32um
- 3:49:44and
- 3:49:46so if direction in
- 3:49:50by
- 3:49:52cell Right. So I I just want to create
- 3:49:55like u tell the bot to either buy or
- 3:49:57sell for a specific price.
- 3:50:01So if not direction
- 3:50:04buy or sell
- 3:50:07uh then I want it to
- 3:50:13like exit the code.
- 3:50:18So and direction is by and direction is
- 3:50:23sell.
- 3:50:25So here we have an input for a
- 3:50:27direction. And now instead of specifying
- 3:50:30the exact string level statically I will
- 3:50:34actually uh define these inputs myself.
- 3:50:37So I decided so uh here are my target
- 3:50:42spread is equal to input
- 3:50:46the target spread and I want to convert
- 3:50:49this to a float.
- 3:51:04And so here
- 3:51:08I can try to do this. And then once this
- 3:51:13uh function has been triggered then I
- 3:51:16can like uh exit the loop like I can
- 3:51:19just write break or I can create a
- 3:51:23running variable.
- 3:51:33I can create like is running is equal to
- 3:51:36true here and then I can just set is
- 3:51:39running to false.
- 3:51:41So I can like also create like this
- 3:51:44control logic where I disable this loop
- 3:51:47here. Um so instead of doing anything I
- 3:51:52I'm just going to like print uh quoting
- 3:51:55bit on hyperlquid
- 3:51:59and then here quoting ask on hyperlquid
- 3:52:04and so let's try to run the script now.
- 3:52:06So for example
- 3:52:09let's say I want to enter a long spread
- 3:52:11position. Uh I miss my script. So I want
- 3:52:14to buy I want to buy at let's say minus
- 3:52:17one. And now it computes the averages
- 3:52:22and then quoting rhythm hyperlquid. And
- 3:52:24that's our signal. So now the last step
- 3:52:27is just to open the position and I think
- 3:52:31uh
- 3:52:33here we have to wait until the length of
- 3:52:37the bit spread history is one. So
- 3:52:44and I think we can do that here also.
- 3:52:54So there are some more questions.
- 3:52:59I build an uh MEV but in crypto but I
- 3:53:01don't seem to win anything at all. Not
- 3:53:03sure if I have that run. Can this same
- 3:53:05approach work with crypto? Yes. So it's
- 3:53:08just trading, right? So if you have any
- 3:53:10asset you know that is priced somehow in
- 3:53:12the exchange you can apply the same
- 3:53:14logic for your strategy too. And so if
- 3:53:19you have a bot and it's not winning at
- 3:53:20all you have to do is just you know
- 3:53:24uh well if it's an arbitrage bot then
- 3:53:26you just have to check the execution if
- 3:53:28you're getting good fills and that's it.
- 3:53:31If you have a bot, you know, that just
- 3:53:33has like some directional risk,
- 3:53:35speculates on the direction, then you
- 3:53:38have, you know, some exposure and you
- 3:53:41kind of like control the outcome every
- 3:53:42time. But maybe what you can check is,
- 3:53:44you know, how much are you paying
- 3:53:45commissions? Are you getting a lot of
- 3:53:47slips or maybe, you know, some leaks
- 3:53:49that uh can be optimized in your
- 3:53:51strategy?
- 3:53:53I don't think AI can predict price
- 3:53:54movements for liquid non-manipulative
- 3:53:56stuff like commodities at least as it is
- 3:53:58purely driven by demand supply. I may be
- 3:54:01wrong but this is what I feel right now.
- 3:54:04uh I mean it's a legitimate like uh
- 3:54:07opinion right that AI cannot predict
- 3:54:09what will happen but AI definitely has
- 3:54:12like some advantages
- 3:54:14uh in comparison to a human right AI can
- 3:54:17like ingest data very fast and analyze
- 3:54:21the data a human right if you look you
- 3:54:24know at news traders and they have like
- 3:54:2620 screens they all watch like Bloomberg
- 3:54:28and BBC news Twitter and so on AI can
- 3:54:31like really uh take all the data and
- 3:54:33like try to you know evaluate or
- 3:54:36generate some signal. So I think there
- 3:54:38is some advantage to AI. Maybe AI can
- 3:54:41like take this data and like inform a
- 3:54:43trader about you know world events and
- 3:54:47provide you know some assisted analysis.
- 3:54:50So maybe that's where we can probably
- 3:54:51use AI.
- 3:54:53We're posting our strategy. Check the
- 3:54:54description uh of the YouTube live
- 3:54:57stream and there you'll find an article
- 3:55:00where I describe what we're doing.
- 3:55:04And then Prabish uh said AI can help
- 3:55:07analyze. Yes, super fast. So yeah, so
- 3:55:09you have probably the same opinion as me
- 3:55:12and but again I don't use AI uh in
- 3:55:15signal generation so I don't really
- 3:55:17know.
- 3:55:18Have you been doing discretion training
- 3:55:20before or when I train directly? Uh I've
- 3:55:22been doing discretion training before.
- 3:55:24So eight years ago I didn't know how to
- 3:55:26code. I learned how to code during my
- 3:55:28employment at a prop trading firm and
- 3:55:31then over time you know I applied my
- 3:55:34coding skills also in trading. So right
- 3:55:37now I'm moved from discretionary trading
- 3:55:40to algor algorithmic trading
- 3:55:56So here what we're going to do is uh
- 3:56:11place limit price on hyper.
- 3:56:20So here I'm going to docu like tell
- 3:56:23cloth exactly what to do. So I'm going
- 3:56:25to tell cloud place
- 3:56:28limit price
- 3:56:30on the on symbol HL
- 3:56:43with the volume
- 3:56:46with volume
- 3:56:50volume HL.
- 3:56:58Um
- 3:57:07so our accurate step place limit price
- 3:57:20uh
- 3:57:22limit Limit
- 3:57:26limit price is defined
- 3:57:30as
- 3:57:31price
- 3:57:36as bit MT5.
- 3:57:40Oh, my ID is running a bit low, but it
- 3:57:42should be fine. As bit MT5 plus
- 3:57:48Whoops. Target spread. So here I want
- 3:57:52you know to use MT5 as a reference price
- 3:57:55to quote my bid prices. So for example
- 3:57:58if M5 price is 10 and my target spread
- 3:58:01is minus one then I want the hyperl
- 3:58:03price to be minus one right
- 3:58:09um
- 3:58:14two
- 3:58:17check that limit price has been
- 3:58:22submitted
- 3:58:25and is active. on Hyperlquid.
- 3:58:35Actually, I think I can do it a bit
- 3:58:37differently actually.
- 3:58:52Okay. So here then uh
- 3:59:04I'm going to create something like u uh
- 3:59:09order timeout
- 3:59:13time until is date time dotn now plus a
- 3:59:18time delta. I'm going to create like uh
- 3:59:21I want to place a limit order but for
- 3:59:23example if after
- 3:59:26let's say 1 minute the order doesn't get
- 3:59:28filled I want to uh cancel the order
- 3:59:32right so here
- 3:59:35I will add time delta
- 3:59:41and so here time out until so while date
- 3:59:44time dot now is less then
- 3:59:49time out until we can then quote you
- 3:59:53know the main the main logic. So here
- 3:59:58what we're going to do is we're going to
- 4:00:01create something like uh uh sleep
- 4:00:05interval. So or maybe like some amend
- 4:00:11interval. So what you could in
- 4:00:13theoretically what you could the
- 4:00:14theoretically do is you could amend the
- 4:00:17order like as fast as you can, right?
- 4:00:18And that way you would uh
- 4:00:22uh ensure that your bid and ask prices
- 4:00:25that you code hyperlquid are always up
- 4:00:27to date and so you will not for example
- 4:00:29get arbitrage by chance. Yes, when you
- 4:00:32build an arbitrage strategy, someone
- 4:00:34could also try to arbitrage you right
- 4:00:36when you're too slow. And so here I'm
- 4:00:39adding this ament interval
- 4:00:42uh
- 4:00:45and uh maybe I can like add this into
- 4:00:49the strategy here. So here a interval
- 4:00:55is equal to let's say let's in the
- 4:00:58beginning I'm going to uh create an
- 4:01:02amend interval of 1 second so we can
- 4:01:04like uh see the limit prices being
- 4:01:07updated on hyperlquid.
- 4:01:12Uh so here I'm going to apply a sleep
- 4:01:14function with a meant interval.
- 4:01:18And
- 4:01:20so here what I want to do next is so
- 4:01:28in this to-do
- 4:01:34I want to
- 4:01:36update
- 4:01:38the
- 4:01:40uh limit price
- 4:01:43with
- 4:01:45um
- 4:01:48with a new updated MT5 price.
- 4:01:55And then we're going to keep doing it
- 4:01:57over and over and over again until our
- 4:02:00order gets filled. Right? So actually
- 4:02:07I actually don't have to do this do it
- 4:02:09like this. I can.
- 4:02:12So here I can do like to-do
- 4:02:22check exposure.
- 4:02:26uh
- 4:02:28check that
- 4:02:31exposure
- 4:02:35on target on hyperlquid does not exceed
- 4:02:40uh the target exposure.
- 4:02:44So what I mean by that is that when we
- 4:02:47place uh a limit order right so I can
- 4:02:50say for for example current uh exposure
- 4:02:54hyperlquid is equal to uh
- 4:03:02define get exposure hyperlquid. So it
- 4:03:05tells us how much silver we are owning
- 4:03:07right now. So get exposure hyperlquid
- 4:03:10uh
- 4:03:15and here I can write uh this uh
- 4:03:19functions function
- 4:03:22returns the
- 4:03:25current exposure on hyperl
- 4:03:33and here I can also add the symbol right
- 4:03:35if I want to the
- 4:03:39expo
- 4:03:41or I can also add for the for symbol HL.
- 4:03:50So here I can tell clot um
- 4:03:57in trading bot.py Pi
- 4:04:02there is a function get exposure
- 4:04:07HL. Can you write code for this
- 4:04:11function? Right. So I want Claude to you
- 4:04:14know write code for this function here.
- 4:04:42So yeah, so this function goes through
- 4:04:45HL client positions. Uh
- 4:04:48and then oh what I should have done is
- 4:04:51uh
- 4:04:56oh yeah also like uh specify the
- 4:05:00specific output but it's already like
- 4:05:02returned the float. So this is exactly
- 4:05:04what I need. So right now what is my
- 4:05:07exposure on hyperlquid right? Right now
- 4:05:10my exposure hyperlquid is one silver
- 4:05:13short. So I can actually test this
- 4:05:15function.
- 4:05:16And I can test this function
- 4:05:19by
- 4:05:21just printing the current exposure here.
- 4:05:24So
- 4:05:30actually let me move this up here. Let's
- 4:05:32leave the train statements down here.
- 4:05:34And current exposure hyperlquid is get
- 4:05:39current exposure. So here I can also
- 4:05:42print uh exposure hyperlquid
- 4:05:47is
- 4:05:50current exposure hyperlquid. Right? So
- 4:05:53this function is important to keep track
- 4:05:56of our exposure to make sure that the
- 4:05:59trading bot does not open uh more trades
- 4:06:02than necessary.
- 4:06:04Uh so right now yeah I'm just going to
- 4:06:07fill the direction I'm going to fill
- 4:06:09anything and so right now the exposure
- 4:06:13on hyperlink is 0.0 which is wrong. So
- 4:06:15we need to check why this is um why this
- 4:06:20is wrong.
- 4:06:23Can you tell me one simple thing if
- 4:06:25people are actually making money using
- 4:06:26this bot why they create a subscription
- 4:06:28right and focus on making money using
- 4:06:30this bot yourself? Well, that's a great
- 4:06:33question. Um, well, to be honest,
- 4:06:3890% of the things are going to scams,
- 4:06:40right? People are just going to sell you
- 4:06:42some type of bots, you know, that
- 4:06:46don't work, right? And that's how they
- 4:06:48make money. And so, how does that make
- 4:06:52me different? And what makes me
- 4:06:55different or I hope makes me different
- 4:06:57is that I'm coding on live stream. I'm
- 4:06:59showing you all, you know, the knowhow
- 4:07:01and you guys can see firsthand what
- 4:07:03we're doing. And mainly what I'm doing
- 4:07:05is I'm sharing the
- 4:07:07results live, right? So once this string
- 4:07:10bot is done, we're going to deploy it
- 4:07:12live. You're going to see the live
- 4:07:13results and you guys can like decide for
- 4:07:16yourself whether these strategies work
- 4:07:17or not, right? So uh I'm not going to
- 4:07:20force anyone to get a subscription. I'm
- 4:07:22just going to let my work speak for
- 4:07:24myself. So uh it is up to you. And the
- 4:07:28question is why I'm not focusing just on
- 4:07:31trading. And the thing is algorithmic
- 4:07:34trading is like if you think about it,
- 4:07:37hi
- 4:07:38like quite boring, right? You just write
- 4:07:40the code, you let it run and then maybe
- 4:07:44a few days later you review the strategy
- 4:07:46and then you'll find something else. But
- 4:07:48basically all I'm doing is press start
- 4:07:51on my training strategy and it's running
- 4:07:53all day. And the second reason, and
- 4:07:56that's the main reason, well, it's even
- 4:08:00though you know you guys know how much
- 4:08:03or those of you who've been with me on
- 4:08:04the live stream know how much money I
- 4:08:06have on my train accounts, right? I am
- 4:08:08like quite highly capitalized over a few
- 4:08:12hundreds of thousand
- 4:08:14over $100,000 US in funding. But the
- 4:08:17reality of trading is that even if I
- 4:08:19have like 200k on my trading account and
- 4:08:22I make like 20% per year, right? That is
- 4:08:25$40,000 US per year, which to some
- 4:08:28people might sound like a lot of money,
- 4:08:31but I still have like a company to feed.
- 4:08:32I have employees. I have my expenses.
- 4:08:34And I also want my money to grow. So the
- 4:08:37reason why I'm doing these memberships
- 4:08:39and teaching you while also trade is
- 4:08:42basically it's an extra opportunity for
- 4:08:44me to actually do something meaningful
- 4:08:47in my free time. So this is my answer to
- 4:08:51your question.
- 4:08:54Hey new year I do crypto arbitrage but
- 4:08:55liquidity for grow has been low lately.
- 4:08:57What other segment would you recommend?
- 4:09:00Well you can well it depends where
- 4:09:03you're trying to do crypto arbitrage
- 4:09:04right. So, uh, did you trade with
- 4:09:07Binance or did you do with BitGet or
- 4:09:10have you tried Dexes, right? Because
- 4:09:11there are a lot of DEXs. I think it's
- 4:09:14good, you know, to explore different
- 4:09:16exchanges because I believe that you
- 4:09:19will find a lot of opportunities if you
- 4:09:21like look deep enough, right? And so
- 4:09:24there are right now a lot of taxes where
- 4:09:26we can try to apply these arbitrage
- 4:09:27strategies and yeah good luck finding
- 4:09:31those is safe IC markets. Yeah sort of
- 4:09:34um if you choose like a broker that has
- 4:09:37like FCA or Cisc regulation uh your
- 4:09:40funds should be safe.
- 4:09:44Hey I know basic programming. I'm pretty
- 4:09:46good with trading. Do you think I will
- 4:09:47able to understand and use your training
- 4:09:48system after gym membership? Uh well
- 4:09:51that uh depends I think uh part of the
- 4:09:55membership so what I do in the
- 4:09:57membership is like I will share the code
- 4:09:58with you right so what you see here is I
- 4:10:00will then share the results with you. So
- 4:10:03in theory once I test the code and then
- 4:10:06upload it on my website or on GitHub you
- 4:10:09can just download it and run it
- 4:10:11yourself.
- 4:10:12But if you like can truly like replicate
- 4:10:15what I do like code prompt AI understand
- 4:10:18what's going on like like line by line
- 4:10:22uh that might be a bit difficult. So I
- 4:10:26would say if you just want to mimic the
- 4:10:28strategy I think yes that's doable. If
- 4:10:31you want to learn like actual like
- 4:10:33coding coding understand everything that
- 4:10:35I'm doing on the live stream here. Uh
- 4:10:37that might like take a few months or
- 4:10:39years, but it's also like probably
- 4:10:42doable.
- 4:10:46Okay, so we're nearly done. So I just
- 4:10:49need to, you know, finish uh
- 4:10:55checking the expert. Oh, actually guys,
- 4:10:58I know this is not an error because
- 4:11:00right now I have a position on silver,
- 4:11:02right? But I'm actually checking the
- 4:11:04exposure on S&P 500. So what I can do
- 4:11:09here is I can
- 4:11:12create a new position on S&P 500. And
- 4:11:16for example, I can try to open
- 4:11:20uh a position with a size of 0.1 S&P.
- 4:11:24And I'm well right now I'm just going to
- 4:11:26speculate.
- 4:11:28There's like no reason behind it.
- 4:11:31price looks a bit low. So, I'm going to
- 4:11:33go buy
- 4:11:37and
- 4:11:38so yes, I'm going to place the order at
- 4:11:40the mid price and hopefully I will get
- 4:11:43filled and I can test my exposure check.
- 4:11:55So, now my limit order has been placed.
- 4:11:57We're waiting to get filled and then
- 4:11:58we're going to check our exposure.
- 4:12:06I'm about to sign up. What other things
- 4:12:07do you get beside codebase in your
- 4:12:09membership? Uh well, I have some courses
- 4:12:11for beginners. So, if you're like an
- 4:12:13actual beginner, uh you can like try
- 4:12:15some simple algorithmic training courses
- 4:12:18and one main benefit is my discord
- 4:12:21server, right? So uh once you you know
- 4:12:25subscribe you can join my discord server
- 4:12:27and if you want to you know ask any
- 4:12:29questions or any you know highle
- 4:12:32consulting with your training project
- 4:12:33you can just let me know in the discord
- 4:12:35group and I will try to help you set it
- 4:12:37up. So for example uh you know last week
- 4:12:41I've done uh my USDC and USD
- 4:12:43marketmaking bot on revolute and this
- 4:12:46week I'm planning to release the code uh
- 4:12:48on GitHub. So just let me know. I'll add
- 4:12:51you to the GitHub project and if you
- 4:12:53want to set it up, I'll gladly help you
- 4:12:55with that. So, you can have your own
- 4:12:57algo running on your end.
- 4:13:01Uh, have you ever had a training bot
- 4:13:03with a high return? Like 100%. Uh, no.
- 4:13:07Like a 100% trading bot. Like I've never
- 4:13:10done 100%. Like if by the end of the
- 4:13:12year I make 20 to 30% I am actually more
- 4:13:17than happy.
- 4:13:21I think was my question. Sorry AV. Uh I
- 4:13:23will repeat here. What instruments of
- 4:13:25CFD crypto exchange broke would you
- 4:13:26suggest to algo trade with small budget
- 4:13:27like 5K euro?
- 4:13:29So uh
- 4:13:33assuming you want to apply the exact
- 4:13:35strategy that I'm showing you here right
- 4:13:37now, right? So I would focus on low
- 4:13:40liquidity assets where the arbitrage
- 4:13:42opportunities, you know, are much
- 4:13:44better. Right? So I wouldn't focus on
- 4:13:46these high volume assets. But maybe if
- 4:13:48you go to Felix and uh I look at these
- 4:13:53other assets like silver and gold USDH
- 4:13:55here the volume is like 306,000 per day
- 4:13:58or 87,000 per day. So here the pricing
- 4:14:02is much more inefficient because the
- 4:14:04liquidity is low and you'll have much
- 4:14:06better time uh you know applying the
- 4:14:08strategy on these markets. But if you
- 4:14:10just want to you know write simple
- 4:14:12algorith scripts and not arbitrage
- 4:14:14trading then I can't give you an exact
- 4:14:18symbol because that depends on the
- 4:14:20strategy that you want to trade right
- 4:14:22ideally you want to trade something
- 4:14:23that's cheap right that has like good
- 4:14:26train conditions executions but that
- 4:14:29depends on the broker so I can't like
- 4:14:31really answer that question uh in detail
- 4:14:38okay so Uh let's see if our uh position
- 4:14:42on S&P 500 has been filled. And the
- 4:14:46thing is it has
- 4:14:49not. So let me try to submit a new limit
- 4:14:51price on SP500 hyperlquid.
- 4:15:01Have you tried arbitrage and poly
- 4:15:02market? No, not yet. Uh I've done a bit
- 4:15:04of research and it's something I will
- 4:15:06explore uh in the future. hopefully by
- 4:15:08the end of this year and I also have a
- 4:15:11look at you know some poly markets uh
- 4:15:14opportunities or culture or any
- 4:15:16prediction market also if you look at
- 4:15:18hyperlquid there is also like some
- 4:15:19outcome market so you can also like uh
- 4:15:21speculate predictions so this is also
- 4:15:24something that's new so I'm interested
- 4:15:26in that as well
- 4:15:30okay so our uh SP500 is still not
- 4:15:34getting filled
- 4:15:37Uh let me still try to submit a new
- 4:15:41limit order at limit price.
- 4:15:49And let's try to get filled.
- 4:16:02Amazing guys. So uh our position has
- 4:16:06been filled. So, we are long 0.1 S&P 500
- 4:16:09contracts. And so, if you run our
- 4:16:11trading bot now, hopefully our uh
- 4:16:14exposure.
- 4:16:17Uh
- 4:16:24oh, no.
- 4:16:26So, yeah, our exposure on the hyperlquid
- 4:16:28is 0.1. So, our script to, you know,
- 4:16:31check the exposure is done.
- 4:16:35And
- 4:16:36so now we can actually continue
- 4:16:40uh writing our function.
- 4:16:44So here we have current exposure
- 4:16:46hyperlquid is get current exposure and
- 4:17:03so what we can do here is we want to get
- 4:17:06filled until a certain amount of
- 4:17:08exposure. So the thing with hyperlquid
- 4:17:11is that uh when you amend the order
- 4:17:15right it will not uh amend the original
- 4:17:20volume. So if you get filled and
- 4:17:21amendment the order the volume will stay
- 4:17:24the same. So I need to create like a
- 4:17:26risk check. So our exposure always stays
- 4:17:28below the one that I want to have. So
- 4:17:32current exposure
- 4:17:34hyperlquid
- 4:17:46uh so what I can do here is I can
- 4:17:50specify the maximum exposure uh long
- 4:17:55hyperlquid. So I want to define the
- 4:17:58maximum amount of uh
- 4:18:02uh hyperlquid units I want. So I don't
- 4:18:04want to have more exposure than one,
- 4:18:08right? And maximum exposure short
- 4:18:11hyperlquid
- 4:18:13will be minus one. So I don't want to,
- 4:18:16you know, have more than minus one S&P
- 4:18:20500.
- 4:18:22So this is what I'm going to do.
- 4:18:31And so here this is the current exposure
- 4:18:34or actually I don't need this.
- 4:18:39So what I can do here is I can check the
- 4:18:42exposure. So current exposure is get
- 4:18:46exposure and so if
- 4:18:49my current exposure hyperlquid is
- 4:18:51greater or equal to my maximum exposure
- 4:18:56long
- 4:18:58on hyperlquid then uh I want to cancel
- 4:19:02order
- 4:19:09cancel order and then return
- 4:19:33and so here up the limit price. So,
- 4:19:38and here uh
- 4:19:46this should be fine.
- 4:19:59Okay. Uh
- 4:20:06And also I can add to-do uh
- 4:20:10check order state
- 4:20:13if it is filled then
- 4:20:18exit.
- 4:20:21So yeah so let's try to now implement
- 4:20:25this function and hopefully with this
- 4:20:28function we can now try to open a hedge.
- 4:20:30So we will buy on hyperlquid
- 4:20:32and sell on FT5.
- 4:20:39And so another thing I should do
- 4:20:46check exposure on hyperlquid
- 4:20:49and hedge that exposure with FT5. So
- 4:20:54then I think we need to
- 4:20:57uh
- 4:20:59like check the exposure with the hyper
- 4:21:0225 and then it will send a market order.
- 4:21:04Uh but let's try to implement this
- 4:21:07function now. So
- 4:21:09in trading bot.py Pi.
- 4:21:16Uh, please code
- 4:21:19the function
- 4:21:27for the function
- 4:21:29quote
- 4:21:31bit
- 4:21:34on HL.
- 4:21:36And then I also add maybe some extra uh
- 4:21:40information.
- 4:21:42In this function uh
- 4:21:46or this function
- 4:21:50quotes
- 4:21:52the bit price
- 4:21:54on hyperlquid
- 4:21:57which basically means a buy limit.
- 4:22:00Uh the limit price is defined as MT5
- 4:22:07uh bit price plus the target spread.
- 4:22:13Right? Here I'm just explaining
- 4:22:17step by step what we're doing. Uh
- 4:22:22after the order is placed,
- 4:22:26I want to uh regularly
- 4:22:34update the order uh limit price to
- 4:22:38reflect new MT5 price.
- 4:22:42If MT5 price
- 4:22:45is the same, there is no need to amend
- 4:22:50the order.
- 4:22:52If the order is already filled or
- 4:22:57cancelled,
- 4:23:00exit maybe I should have written like
- 4:23:01this actually. It feels a bit easier to
- 4:23:03do it like this. If MT5 price is saying,
- 4:23:05there's no need
- 4:23:07filled or cancelled. Exit.
- 4:23:13Check that current exposure does not
- 4:23:17exceed
- 4:23:19uh max exposure. Otherwise, cancel
- 4:23:23orders and exit.
- 4:23:32And then if timeout
- 4:23:36if timeout
- 4:23:39is reached then also exit.
- 4:23:45Okay. So let's just try to implement
- 4:23:46this function with cloth and we'll see
- 4:23:48what we get.
- 4:23:53If you type at sign and then type the
- 4:23:55file name, you'll give cloth code the
- 4:23:57direct reference of a file if you want
- 4:23:59to modify. Without that it's better to
- 4:24:01close with okay
- 4:24:04thank you.
- 4:24:14So I'll try it from now on. So in at
- 4:24:16stringb.py
- 4:24:19actually I can cancel it
- 4:24:22and I'll implement your suggestion.
- 4:24:25Thank you for
- 4:24:28Ah, here it is.
- 4:24:39Oh, that's
- 4:24:50line 57.
- 4:24:54Thanks a lot.
- 4:25:25Okay, so now clicking this function is
- 4:25:27like a bit complex. So it might take
- 4:25:29some time, but this is actually the most
- 4:25:32important function, right? It's a
- 4:25:33function that adds the limit orders on
- 4:25:36hyperlquid and then places a h5.
- 4:25:41I think I forgot to add the h there.
- 4:25:59So let's see what Claude is now
- 4:26:00suggesting.
- 4:26:37Okay, let's try to add this change
- 4:26:55and sorry guys. So once this function is
- 4:26:57done, this is basically like 80 or 90%
- 4:27:01of the work done because that is
- 4:27:03actually what allows us to make money
- 4:27:04and the rest is just some risk control
- 4:27:06metrics and then we're going to add like
- 4:27:09you know signals as we said like we can
- 4:27:12compute the Z score and define our entry
- 4:27:15and exit levels uh more dynamically but
- 4:27:19this will be like the foundation or like
- 4:27:22the basis bas you know the basic
- 4:27:24functionality of a train bot. that will
- 4:27:26be used in any type you know of uh
- 4:27:29strategy.
- 4:27:36Okay. Uh
- 4:27:46okay. Here I'm going to create new file.
- 4:27:48Uh I'm going to call it uh
- 4:27:59so here I want to test the script. So I
- 4:28:01I don't want to actually
- 4:28:04um
- 4:28:06use any of these. So actually all I'm
- 4:28:08going to do here is actually I'm just
- 4:28:12going to
- 4:28:14do the quote bit function here. And here
- 4:28:16the target spread I'm going to define
- 4:28:19statically target spread is let's say
- 4:28:22minus one or let's do minus 10 so we can
- 4:28:25actually see uh if the limit prices
- 4:28:30are being updated properly. So we're in
- 4:28:33100.
- 4:28:34So we're going to run this function
- 4:28:41and now we're should be quoting the
- 4:28:46limit on hyperlquid. So place by limit
- 4:28:50and
- 4:28:52now we see that the limit price has been
- 4:28:55set $100 below our MT5 price.
- 4:28:59Um,
- 4:29:02okay. Just a cloth. Uh,
- 4:29:13so I'm going to apply the suggestion
- 4:29:17from Mr. Best Merch. So, thank you for
- 4:29:19suggestion. So, in quote limit prices
- 4:29:24test.py pi.
- 4:29:27Uh, I got this error.
- 4:29:46So now let clo try to find a fix for
- 4:29:49this issue and then we can then try to
- 4:29:52resume. So as you guys can see so now at
- 4:29:55least uh the script is able to you know
- 4:29:58quote the limit prices and so then it
- 4:30:01will quote the prices here and then
- 4:30:03we'll try to get filled on MT5. I think
- 4:30:07for the hedging it's probably better to
- 4:30:10create like a separate like hedging
- 4:30:12script uh that will be independent from
- 4:30:15this script and all cloud will do is
- 4:30:18just check the exposures because I want
- 4:30:20uh you know to have like a non um what
- 4:30:24is it called non-blocking execution when
- 4:30:26we update the limit prices because what
- 4:30:29can happen is that
- 4:30:31uh
- 4:30:33yeah when we're when we're hedging there
- 4:30:35might be some delay on the MT5 site
- 4:30:37which takes extra processing time and
- 4:30:39during this time maybe the quotes might
- 4:30:42be outdated. So we want to make sure
- 4:30:44that we always uh quote the up-to-date
- 4:30:48prices
- 4:31:09Okay. So,
- 4:31:18so now we're quoting bit on hyperlquid
- 4:31:23and here we've embended.
- 4:31:26So, this is great guys. So right now our
- 4:31:29limit price is being amended. There's
- 4:31:32also one order that we've placed. So we
- 4:31:34can cancel that one because that was
- 4:31:37from uh the initial script that failed
- 4:31:45and and now this order is being amended
- 4:31:48right. Um, so I can tell Claude, uh,
- 4:32:06please cancel open orders
- 4:32:10for symbol hyperlquid
- 4:32:14on in it.
- 4:32:17So whenever we have some open um orders
- 4:32:21when we start a script I want cloth to
- 4:32:24um yeah cancel orders
- 4:32:29and so now
- 4:32:31that it actually works we can try to
- 4:32:34actually get filled right so now I'm
- 4:32:36going to place
- 4:32:38uh the target spread let's say to minus
- 4:32:40one right so minus one is not like a
- 4:32:43good price level to to like enter But I
- 4:32:46just want to test you know if it gets
- 4:32:48filled and then if everything is okay.
- 4:33:14Okay. So now we can
- 4:33:25So now we're coding the bit price
- 4:33:29on hyperlquid.
- 4:33:31Now we see that the bit price hovering
- 4:33:33here 39.3
- 4:33:36and
- 4:33:42it's 39.5. So now we see that the limit
- 4:33:45prices are actually being updated
- 4:33:49based on our MT5 price right. So right
- 4:33:52now the logic is that we take MT5 price
- 4:33:56the bit price minus one right. So that
- 4:33:59is the limit price for our algorithm.
- 4:34:06So it's 40.8 here it's 41.8 now it's
- 4:34:0941.5
- 4:34:11it's 40.5. So we see that we are
- 4:34:15actually like trailing the MT5 price
- 4:34:19sort of correctly. And now I just need
- 4:34:20to test if we get filled how the
- 4:34:24training bot acts when we get filled.
- 4:34:27Right.
- 4:34:36And so yeah, we're running a bit out of
- 4:34:38time because I've been streaming for
- 4:34:40over four hours now, which is fine, but
- 4:34:43I have a meeting at 8, so I'll have to
- 4:34:45go in 90 minutes latest. So worst case,
- 4:34:48we can just resume the project tomorrow.
- 4:34:54So now what happened is that timeout
- 4:34:56reach, canceling order, and the script
- 4:34:58exited. So, what if I'm really desperate
- 4:35:01to get filled, right? Really desperate.
- 4:35:03Or let me try to find another symbol.
- 4:35:07Uh maybe we'll [clears throat] find some
- 4:35:10symbol where we can have
- 4:35:15an almost guaranteed fill.
- 4:35:25Or actually, let's just set the target
- 4:35:27spread to zero. We're going to do that.
- 4:35:40So here our order got filled and then we
- 4:35:44exited.
- 4:35:56So right now our exposure of SP500 is
- 4:35:591.1. So this is great. So the last thing
- 4:36:02we need to do is we need to create a
- 4:36:04hedging tool that can hedge this
- 4:36:06exposure with MT5.
- 4:36:11And
- 4:36:13so what I can do now is we can decide to
- 4:36:17put like the hedging script inside like
- 4:36:19this one or we can create like a
- 4:36:22separate script and like how how I would
- 4:36:25start is I would do a separate script so
- 4:36:28the code is much cleaner and we can see
- 4:36:30exactly what we're doing and then
- 4:36:33in the future we can then like merge
- 4:36:35those two scripts together and create
- 4:36:38like a hedging tool. So here I will call
- 4:36:43uh create a script called hedge exposure
- 4:36:47uh with MT5.
- 4:36:53So this script uh listens to
- 4:36:57exposure on MT5 and hedges uh that
- 4:37:02exposure
- 4:37:04uh on hyperlquid
- 4:37:08and hedges.exposure
- 4:37:11on MT5.
- 4:37:15Uh
- 4:37:18whenever we receive a new event in
- 4:37:24positions
- 4:37:26or clearing house
- 4:37:32uh
- 4:37:34hyperlquid for the specific
- 4:37:38position.
- 4:37:40Uh compare the exposure between
- 4:37:46hyper liquid
- 4:37:49and MP5
- 4:37:51and
- 4:37:54HD exposure.
- 4:38:00So we're going to use like again symbol
- 4:38:02hyperlquid then so for example here we
- 4:38:06would do SP 500 and then we would here
- 4:38:09add symbol MT5 which is US 500
- 4:38:16right uh
- 4:38:21so here in
- 4:38:23hedge exposure with MT5 implement a
- 4:38:28hedging logic
- 4:38:30where
- 4:38:39create uh
- 4:38:42an exposure
- 4:38:44hedger that hedges
- 4:38:48exposure between hyperlid and 25.
- 4:38:53Be careful about contract sizes.
- 4:38:58uh one unit on hyperlquid
- 4:39:07could potentially be a different lot
- 4:39:12size on MT5.
- 4:39:17So now we're creating this hedging tool
- 4:39:19and when this is tested then yeah we can
- 4:39:23try to use the last hour to find some
- 4:39:26arbitrage opportunities and then like
- 4:39:29it's about like adding a lot of control
- 4:39:31metrics um and then we can like again
- 4:39:35create like a web UI when we're done but
- 4:39:38we still need to like finish this
- 4:39:41specific thing
- 4:39:44and also we need to implement the same
- 4:39:46function for quote ask on hyperlquid
- 4:39:58and we forgot to add that the time in
- 4:40:00force should be alo because right now we
- 4:40:03have GTC
- 4:40:04and uh
- 4:40:08so we need to add that too. So here I'm
- 4:40:10also going to add another to-do
- 4:40:16order limit should be a
- 4:40:22liquidity only.
- 4:40:56So here actually the MT5 contract size
- 4:40:59is wrong because the contract size for
- 4:41:01US 500
- 4:41:05is one right. So this is actually the
- 4:41:08dangerous part when you do algorith
- 4:41:10here the AI assumes that contract size
- 4:41:13is one on US 500 100 on US 500 but it's
- 4:41:17just one
- 4:41:21and then uh yeah
- 4:41:29so here we're getting the exposure on
- 4:41:32hyperlquid here we're getting the
- 4:41:33exposure on MT5. five and here it uh it
- 4:41:39wrote us a simple market sent market
- 4:41:41order to hedge that exposure on our
- 4:41:43platform. So now we have hedge here
- 4:41:49and that's basically it.
- 4:42:01So I'm just running the script see if it
- 4:42:03works. Right now my algorithmic training
- 4:42:04is disabled. So he can't place any
- 4:42:07trades.
- 4:42:10So here it's trying to sell 1.1 lots on
- 4:42:14US 500. And that makes sense because we
- 4:42:17try to we're long 1.1 right now. And
- 4:42:21right now the script is trying to sell
- 4:42:221.1.
- 4:42:29Uh
- 4:42:39all right so because
- 4:42:41I also want to add you know some check
- 4:42:44so in
- 4:42:47uh
- 4:42:50again Mr. best merch. Thank you for a
- 4:42:51suggestion and hedge
- 4:42:55exposure with MT5.
- 4:42:58Um,
- 4:43:05uh, please add maximum of
- 4:43:10let's say 10 order retries
- 4:43:13if the hedge failed. Otherwise, exit the
- 4:43:19script.
- 4:43:38But so yeah, so I think if I just run
- 4:43:40this code, it will uh place
- 4:43:44an order to met Metatrader 5 and we'll
- 4:43:47have a fully hatched hedged position on
- 4:43:51US 500.
- 4:44:48Okay. So now
- 4:44:55if you look at our function H.
- 4:45:13So let's run this.
- 4:45:22And now it's trying to, you know,
- 4:45:24attempt to hedge the position and then
- 4:45:28it exits.
- 4:45:32So now let's try to
- 4:45:38run the script. I enable algorithm
- 4:45:40trading on my MT5 account. And now you
- 4:45:44see that
- 4:45:48the position has been hedged, right? So
- 4:45:50right now we have actually all we need
- 4:45:53to
- 4:45:55have a fully function arbitrage
- 4:45:56strategy. Of course we have to implement
- 4:45:58like a lot of security features,
- 4:46:00monitoring and like strategy logic. But
- 4:46:04the the code to you know open hedge
- 4:46:07position is now fully running. So in
- 4:46:10theory if I exit the position right if I
- 4:46:14want to exit SM5 position here um
- 4:46:18it should then exit on the MT5 side. So
- 4:46:22here uh I will let hedge exposure MT5
- 4:46:25running because this script edges uh I
- 4:46:28also need to implement quote ask on
- 4:46:31hyperlquid.
- 4:46:38So quote ask means I want to sell. So,
- 4:46:40I'm going to actually put
- 4:46:43the quote ask uh below the quote bit.
- 4:46:55And I'm going to tell Claude
- 4:47:06and quote limit prices uh py
- 4:47:18uh implement the quote
- 4:47:24task
- 4:47:25on HL function
- 4:47:28in line 139.
- 4:47:33The same way
- 4:47:36like quotes
- 4:47:40bit on HL
- 4:47:43but for sell limit orders.
- 4:47:47Also please uh change the limit type to
- 4:47:53alo
- 4:47:55post or post only orders.
- 4:48:10Okay. So now we're
- 4:48:12okay. We're changing that to ALO. That's
- 4:48:15the first thing.
- 4:48:25Code limit prices tested pie. Yes.
- 4:49:17All good.
- 4:49:19Also, I'm a paranoid. So in H exposure
- 4:49:22uh
- 4:49:29in H
- 4:49:32exposure
- 4:49:34with MT5,
- 4:49:36can you add uh a risk check
- 4:49:42for maximum
- 4:49:44volume
- 4:49:46hedged per day
- 4:49:49and also So
- 4:49:55max trades uh place or just maximum
- 4:49:59point per day. So it avoids to create
- 4:50:02like trade too much. So it can happen
- 4:50:04that for example my trading bot goes
- 4:50:07into some kind of loop. It just opens
- 4:50:09and closes opens closes and in such a
- 4:50:11case it can burn my account. Right? And
- 4:50:14if you have like thousands or tens of
- 4:50:16thousands of dollars on your account,
- 4:50:18this can be a disaster. So even though
- 4:50:21the code looks okay to me and I don't
- 4:50:23see any issues, it's always good to add
- 4:50:25like this risk control check.
- 4:50:48So now in hedge exposure, so let's say
- 4:50:50the maximum amount of lots I want to
- 4:50:52open on this strategy would let's say be
- 4:50:5610 right right now. So I wouldn't trade
- 4:50:59more than 10. If something happens, I
- 4:51:01would just notify
- 4:51:03myself. Oh, sorry. This is actually
- 4:51:05already correct. So Claude already
- 4:51:07filled this for me. So it's going to be
- 4:51:0910.
- 4:51:33Nice.
- 4:51:37And then the last thing in code limit
- 4:51:40prices test uh create a function that
- 4:51:46checks exposure
- 4:51:49between
- 4:51:51hyper liquid
- 4:51:53and MT5. And if there is an
- 4:52:00exposure discrepancy,
- 4:52:03uh cancel
- 4:52:07open orders and halt uh
- 4:52:13trading.
- 4:52:26or actually I should do that for the
- 4:52:27main training bot. So I can do it later
- 4:52:30actually. So so now
- 4:52:33uh code ask has been implemented. Uh my
- 4:52:36hedge exposure bot is still running. So
- 4:52:40let's uh restart my H exposure. And here
- 4:52:44we have the risk control check to
- 4:52:52no check the hedges. Uh and so now oh we
- 4:52:57don't need this. Uh let me now quote
- 4:53:04ask and I want to exit at minus one. So
- 4:53:06I'm intentionally creating a loss now,
- 4:53:08right? I just want to see uh if the
- 4:53:11strategy works. So now uh we're coding
- 4:53:16ask on hyperlquid.
- 4:53:21And so here my order got rejected
- 4:53:24because it would have been matched with
- 4:53:26a bet best bid offer on hyperlquid.
- 4:53:31And that makes sense because now I have
- 4:53:33liquidity adding orders only. So I
- 4:53:35should also create a script that uh has
- 4:53:38like a minimum spread offset so I can
- 4:53:41all so you know so the order gets added
- 4:53:43to the order book.
- 4:53:54So in quoting prices test uh
- 4:54:00when quoting bit and ask prices on
- 4:54:05hyperlquid
- 4:54:09please check the current top of book
- 4:54:12price.
- 4:54:15Uh
- 4:54:17if uh
- 4:54:21the price would
- 4:54:24if uh
- 4:54:27the limit if or let's just write if the
- 4:54:31current
- 4:54:32bit price is uh
- 4:54:37greater
- 4:54:49Or let me try to phrase it a different
- 4:54:51way. Um, when coding bid and ask price
- 4:54:54hyper liquid, please check the current
- 4:54:55top of price
- 4:54:59if the order would have
- 4:55:06or add a minimum offset from the best
- 4:55:11top of book price. If the limit price
- 4:55:16would have immediately
- 4:55:20match.
- 4:55:25I think that should enough.
- 4:55:39So right now what we're just doing is uh
- 4:55:44so for example right now this this is
- 4:55:45the bit and ask price and I can't quote
- 4:55:48a bid price that's like above the
- 4:55:50current ask price. You can't add this to
- 4:55:52the order book. You would have to either
- 4:55:54like uh get filled here but because our
- 4:55:58order type is add liquidity only we
- 4:56:01cannot add liquidity at that level.
- 4:56:08And here we have like a minimum top of
- 4:56:09book offset which is set to uh to one.
- 4:56:17Uh so this is actually great.
- 4:56:48So now we're computing new limit prices
- 4:56:50in case we would have been immediately
- 4:56:52matched
- 4:56:53and that would help us you know
- 4:56:57it actually gives us a better price.
- 4:56:59That's what it what's happening.
- 4:57:35Okay. So
- 4:57:39now we've added this change.
- 4:58:14And so now I think
- 4:58:19we can try to sell.
- 4:58:22So let's run this again.
- 4:58:26Our script to H exposure is still
- 4:58:27running.
- 4:58:33So right now we are trying to sell by
- 4:58:36adding liquidity to the order book and
- 4:58:39as you can see now we are exiting our
- 4:58:42position. So as you can see order no
- 4:58:44longer open. Uh it's exiting now and the
- 4:58:48script is finished. So our order got
- 4:58:50filled and it got immediately hedged
- 4:58:52with MT5.
- 4:58:54So now what we need to do is like we
- 4:58:56need to let this script run like over
- 4:58:59and over again, right? So we just got
- 4:59:01one trade executed. So here order no
- 4:59:04longer opened filled or cancelled. So
- 4:59:06it's exiting because it couldn't find
- 4:59:08that order. And
- 4:59:15let's see. So here our volume hyper
- 4:59:17liquid is now one.
- 4:59:36So let's try to run this again. I'm
- 4:59:38going to make sure that everything's
- 4:59:40running correctly. So again what's
- 4:59:43happening here is so on hyperlquid now
- 4:59:45we are quoting uh cell limit right
- 4:59:50because we want to exit our position uh
- 4:59:53this cell limit is set to minus one uh
- 4:59:57like the current MT5 safety price minus
- 4:59:59one
- 5:00:08let's See
- 5:00:11if the pricing can update it.
- 5:00:15It's still 41.8 and here's 41.4
- 5:00:19because we like still
- 5:00:23I guess we're still uh updated because
- 5:00:26of top of book
- 5:00:29and yeah again we're just waiting to get
- 5:00:32filled.
- 5:00:34Here we are at top of book. So someone
- 5:00:37who decides to buy on the exchange will
- 5:00:40buy it from us essentially
- 5:00:54and
- 5:00:56as I can see uh a trade got executed. So
- 5:01:00here I can see that
- 5:01:03oh the timeout has been reached.
- 5:01:06and
- 5:01:09we hatched one. So here also what I can
- 5:01:12do is I can change the volume
- 5:01:18let's say to 0.1
- 5:01:21I want to finish closing this remaining
- 5:01:24order and then let's try to after this
- 5:01:29let's try to find a symbol where we can
- 5:01:32actually try to make money right so this
- 5:01:35is the minimum usable
- 5:01:37like script that we can
- 5:01:40So now we're actually going to try, you
- 5:01:42know, find some profitable opportunities
- 5:01:44and then in the like next live streams
- 5:01:48uh throughout this week, I'm going to
- 5:01:50try, you know, make everything look
- 5:01:52nicer, debug everything and make a
- 5:01:55training bot that can run 24/7.
- 5:02:06So now we're coding 0.1
- 5:02:09at top of book
- 5:02:18and we have exit our position.
- 5:02:24As you can see now we're a bit we're a
- 5:02:25bit short. So this is what I meant like
- 5:02:27when you amend an order uh on hyperlquid
- 5:02:31the original order size uh disappears.
- 5:02:35So I want to actually when I amend the
- 5:02:38order I want to uh include the initial
- 5:02:42order size so we don't open too much
- 5:02:44than intended. So let me actually add
- 5:02:47this to cloth.
- 5:02:56When I amend an order, it does
- 5:03:01not take
- 5:03:12the volume. Uh,
- 5:03:28not causing me to trade more than I
- 5:03:33want. Can you take already filled amount
- 5:03:39into consideration?
- 5:03:43when amending uh limit orders.
- 5:04:07So yeah, but the hedging basically
- 5:04:09works. Uh right now our position on S&P
- 5:04:13500 is 0.02
- 5:04:16but here on MT5 it is 0.01 which means
- 5:04:20we also have an error in hedging
- 5:04:24somewhere here and
- 5:04:28actually here.
- 5:04:35So in hyperl we are minus 0.026 026 and
- 5:04:38on MT5 we have 0.1.
- 5:04:40So our difference is 0.1.
- 5:04:45Let me restart it. Maybe
- 5:04:48it'll fix it. Or maybe there's some bug
- 5:04:51inside the code.
- 5:04:56So it's not a bug. I think there is
- 5:04:58maybe like a minimum uh size discrepancy
- 5:05:03and for that reason does not hedge but
- 5:05:05it's a very very small amount so it's
- 5:05:07it's actually not that bad it's just 0.1
- 5:05:10so I think
- 5:05:13maybe in Hex exposure MT5
- 5:05:17let me check so here uh
- 5:05:22oh yeah we have it
- 5:05:33So I think there's oh there's a h
- 5:05:35threshold unit. So if the exposure
- 5:05:38discrepancy stays below 0.5
- 5:05:42which it is then there is actually no
- 5:05:45issue. But because the price precision
- 5:05:48on MT5
- 5:05:51is 0.01 01. I think we can decrease the
- 5:05:54threshold unit to
- 5:05:570.05. So now if I restart the script
- 5:06:05now the threshold will update and now
- 5:06:08we're zero and hyperlquid our exposure
- 5:06:12is like also basically zero.
- 5:06:16So yeah,
- 5:06:19[sighs]
- 5:06:31so here I still need to you know modify
- 5:06:34using the original size.
- 5:06:38And so now let's have a look. Do we have
- 5:06:42any training opportunities today? If
- 5:06:44not, we can try to look for some
- 5:06:45tomorrow.
- 5:06:47But
- 5:07:05I think maybe we can try to find
- 5:07:08something.
- 5:07:24I mean platinum looks quite interesting
- 5:07:25here. We have like 23% funding rate.
- 5:07:28That could theoretically work
- 5:08:03Um so yeah.
- 5:08:14So now
- 5:08:17let me also
- 5:08:18do something and
- 5:08:28I made a lot of changes in quote limit
- 5:08:33prices test.py.
- 5:08:38Can you synchronize the changes
- 5:08:42in
- 5:08:45tradingbot.py.
- 5:08:54Oh yeah, I forgot to add the tag again
- 5:08:57to specify the files, but I think it
- 5:08:58should be fine.
- 5:09:32Okay, we're going to add that. And then
- 5:09:35what I'm going to do is also I'm going
- 5:09:36to create like a strategy configuration
- 5:09:38file. So as you know like trading bot.py
- 5:09:41PI uh
- 5:09:44code limit price and H exposure they all
- 5:09:47use like shared like same initial like
- 5:09:51variables.
- 5:09:59Oh yeah, I forgot to also add an
- 5:10:02exposure check, but we'll get to that.
- 5:10:28And I think now we can actually like try
- 5:10:30to prompt claude to like create like a
- 5:10:33training board that is now running with
- 5:10:35these like uh
- 5:10:41like specified entry and exit levels. So
- 5:10:58let cloud just, you know, update any
- 5:11:01changes because I've been doing a lot in
- 5:11:02like code limit prices and test.py. So
- 5:11:06I'm just synchronizing the changes
- 5:11:10and yeah. Oh, I have another question.
- 5:11:12Sorry. Uh how many training systems you
- 5:11:14have running advance in your company? As
- 5:11:16I said, I have one main one. Uh and then
- 5:11:21I have like small accounts to like
- 5:11:23research and test and look for like
- 5:11:25backup plans in case the main strategy
- 5:11:27uh stops performing.
- 5:11:30And it's one strategy that I'm running
- 5:11:33on hyperlquid, right? So we're talking
- 5:11:35about hyperl against MT5. Sometimes it
- 5:11:38can also like be lighter, right? Against
- 5:11:40MT5.
- 5:11:41So we have that too.
- 5:11:51It's that a little bit stupid to have a
- 5:11:52single file training strip VIP coding.
- 5:11:54Uh maybe I can clarify some things. Uh
- 5:11:57my strategies that I'm training so far
- 5:11:59are not vioded. I coded all of them
- 5:12:02myself. And the reason why I'm like
- 5:12:05coding with you right now is that uh
- 5:12:10uh like I got into AI like a week or two
- 5:12:12ago and I'm trying like to explore the
- 5:12:14capabilities of AI by implementing my
- 5:12:17own strategies using the help of AI. So,
- 5:12:23and also I wouldn't call this VIPE
- 5:12:25coding necessarily because at the end of
- 5:12:26the day we are still like reviewing the
- 5:12:28code and like we try to you know keep
- 5:12:31track of what's going on in there. So
- 5:12:33it's not like uh I don't understand
- 5:12:36what's going on here but it's a
- 5:12:37legitimate opinion. So uh feel free to
- 5:12:41think that
- 5:12:55Okay.
- 5:13:07So now uh let's create a strategy. So uh
- 5:13:10I want to um let's say my maximum
- 5:13:14exposure
- 5:13:16is two.
- 5:13:18My uh max H for short is minus two.
- 5:13:24This is in my training bot file.
- 5:13:27Actually, instead of adding the
- 5:13:30direction here,
- 5:13:32uh, instead I will now specify the
- 5:13:34static levels and I'll tell CL to do
- 5:13:36like a fully 24/7 strategy. So,
- 5:13:48so we want to enter let's say at minus4
- 5:13:52or let's let's say minus4 is fine.
- 5:13:57Let's just do three. Limit price cell
- 5:14:02entry
- 5:14:03is equal to three. So basically what I'm
- 5:14:06doing right now guys is I'm looking at
- 5:14:08uh
- 5:14:11the historical spread that we computed.
- 5:14:13Actually I can rerun this code again
- 5:14:22and we can look at today's spread.
- 5:14:47and
- 5:14:57all right so
- 5:15:01we are still loading
- 5:15:08So basically I'm taking the levels from
- 5:15:10these right. So we can see like uh
- 5:15:13throughout the day also I can like
- 5:15:15increase the the period. So here in a 1
- 5:15:20minute I can try to extend the period
- 5:15:21maybe use 5 minute uh data and maybe
- 5:15:24compute the spread for past 24 * 7 hours
- 5:15:29right and so let me run this script
- 5:15:32again for the uh 15-minute data frame
- 5:15:36uh time frame sorry
- 5:15:39and we can then have a look at the
- 5:15:41historical spread. So while this is
- 5:15:44loading uh let me continue
- 5:15:48editing the training bot.
- 5:15:52So let's say I want to export
- 5:15:57and here I can do limit uh price by
- 5:16:02exit.
- 5:16:06So for examp I want to exit minus one
- 5:16:11and
- 5:16:13so I want to exit my buy position
- 5:16:22at one.
- 5:16:28So here I have the logic you know to I
- 5:16:32want to enter minus4 and exit at minus
- 5:16:34one which would give me
- 5:16:38uh a profit of $3 if I get perfect
- 5:16:41execution. And same thing for here.
- 5:16:49And so now
- 5:16:53uh
- 5:16:59so if average bit spread is lower than
- 5:17:10limit price
- 5:17:15entry Okay,
- 5:17:19we can try to buy at this price
- 5:17:23here. We can do sell
- 5:17:26and then we can try to sell at this
- 5:17:28price.
- 5:17:32Uh and here and current exposure
- 5:17:35hyperlquid. We want like if we want to
- 5:17:38enter into a trade then we want to make
- 5:17:40sure that our current exposure
- 5:17:42is uh
- 5:17:50less than our max exposure long
- 5:17:53hyperlquid.
- 5:17:55And here we also want to make sure that
- 5:17:57our current exposure hyperlquid is
- 5:18:01greater than the max exposure short on
- 5:18:04hyperlquid.
- 5:18:07And then here we can also add another L
- 5:18:10if block. Uh
- 5:18:14so here
- 5:18:18one second let me check my message
- 5:18:19first.
- 5:18:29And so here we will have our exit
- 5:18:33signals.
- 5:18:38And so if our
- 5:18:46average ask spread is greater equal than
- 5:18:49limit price by exit
- 5:18:53and current exposure
- 5:18:57is
- 5:19:01greater than zero.
- 5:19:07Then we can quote ask on hyperlquid at
- 5:19:10the exit price
- 5:19:16and then to exit our
- 5:19:20other position. Whoops.
- 5:19:23Average
- 5:19:25bit spread is less than equal to limit
- 5:19:30price cell exit and current
- 5:19:37exposure
- 5:19:39is um
- 5:19:47less than zero. So here we have a cell
- 5:19:49posture open which means our exposure is
- 5:19:51negative. So as long as our exposure is
- 5:19:55negative, we can quote the bit price for
- 5:19:59this value here. And now I'm going to
- 5:20:01prompt Claude to, you know,
- 5:20:04like improve the logic. So I'm going to
- 5:20:06exactly explain what Clot should do to
- 5:20:09run this string strategy.
- 5:20:12So in
- 5:20:15trading
- 5:20:17bot.py
- 5:20:22I want the trading bot
- 5:20:26to
- 5:20:30run without any
- 5:20:34interruptions
- 5:20:36unless there is oh I forgot one thing.
- 5:20:42I want you to add an exposure check with
- 5:20:47MT5
- 5:20:49that if uh
- 5:20:54there is an even exposure between
- 5:21:00hyperlquid and MP5. Uh cancel all open
- 5:21:06orders and hold trading.
- 5:21:10And I think here we have the check
- 5:21:14exposure.
- 5:21:20Okay, let's just try to run this.
- 5:21:27Uh
- 5:21:29this exposure check
- 5:21:35should uh
- 5:21:39be compatible with the hedging script
- 5:21:45uh hedge exposure
- 5:21:47identifi.
- 5:21:50So, so I'm adding another like risk
- 5:21:53check to make sure that uh
- 5:21:59that the exposure is correct at any
- 5:22:01point in time. So if for example on MT5
- 5:22:04the exposure is not evenly hedged then
- 5:22:07it will stop trading. So we are actually
- 5:22:10avoiding uh like trades being opened if
- 5:22:14there is something wrong.
- 5:22:23So now let cloth work And
- 5:22:55So now
- 5:23:08Okay, that's fine.
- 5:23:35So maybe what makes sense actually is
- 5:23:37that uh the checking of exposures on
- 5:23:39like uh hedging explor and training bot
- 5:23:43maybe we can create like a file where
- 5:23:45these two scripts are using the same
- 5:23:47function and so that way we can avoid Um
- 5:23:51any discrepancies in the mathematics and
- 5:23:54the calculation.
- 5:24:09Okay. And so now my last prop is going
- 5:24:11to be like finalizing this trading
- 5:24:14script. And uh
- 5:24:19yeah, let's try to implement that.
- 5:24:32I have best strategy. You can code DM
- 5:24:33me. Careful about scammers, guys. People
- 5:24:36who try to sell you something like me
- 5:24:38and telling you to DM you are usually
- 5:24:40very shady. So, I'm actually
- 5:24:44going to hide this user
- 5:24:48because in 99% of all cases, it's a
- 5:24:51scam.
- 5:25:08Okay. So yeah, I wanted to create this
- 5:25:11like fine logic.
- 5:25:15Can you please review
- 5:25:18trading botpy?
- 5:25:23The strategy should
- 5:25:27uh
- 5:25:30go long
- 5:25:37when limit price by entry.
- 5:25:46uh
- 5:25:51should enter
- 5:25:56until max uh exposure long is reached.
- 5:26:11If price
- 5:26:14reaches
- 5:26:18uh limit
- 5:26:24or if long positions to be more exact,
- 5:26:26if long positions
- 5:26:28uh reach limit price by exit,
- 5:26:32please offload all positions until
- 5:26:36exposure is roughly zero.
- 5:26:40or just zero.
- 5:26:43Apply same logic for cells.
- 5:27:31How long it take you for you to develop
- 5:27:32your main strategy? So I think for the
- 5:27:36hyperlquid training strategy it took me
- 5:27:38like like two weeks to have like a first
- 5:27:41uh usable version and it took me like
- 5:27:44one or let's say one or two months to
- 5:27:47have it in a form where I'm actually
- 5:27:49happy for it to run like 245 24/7 and
- 5:27:53but still I have some bugs that I'm
- 5:27:56still like fixing uh on a regular basis.
- 5:27:59So I was hoping that by like coding with
- 5:28:01AI and then comparing the results with
- 5:28:03my own code whether I can like implement
- 5:28:06certain functions or certain like uh
- 5:28:09features. So and like I can see already
- 5:28:12like some features being better than my
- 5:28:14old code. So I'm using my old code more
- 5:28:18like as a reference to code this
- 5:28:19strategy and I'm trying to make like a
- 5:28:21better version of it by you know
- 5:28:24streaming this live with you guys.
- 5:28:39Thank you for the work you're putting
- 5:28:40in. Is your main strategy in arbitrage?
- 5:28:42If yes, what type? Lat statistical. Uh
- 5:28:44main strategy.
- 5:28:46Yes. So my main strategy is an
- 5:28:47arbitrage. It's not latency. uh it's
- 5:28:50more like statistical peer trading and
- 5:28:52like arbitrage of crypto derivatives
- 5:28:55with real world assets in some sense.
- 5:28:58It's also like a funding rate arbitrage
- 5:29:00if you think about it. So it's like a
- 5:29:04you could consider it based on how you
- 5:29:06look at it.
- 5:29:34Two things to consider each quote.
- 5:30:07Okay. So
- 5:30:29a trading bot
- 5:30:32pie. Okay.
- 5:30:56So I just think cloud like if there is
- 5:30:57something else that can be like added
- 5:30:59like just print it here and let's try to
- 5:31:02run it. So this is great. So
- 5:31:07now I create a very simple strategy in
- 5:31:08S&P 500. So we're just you know again
- 5:31:11buying at minus4 selling at four and
- 5:31:13then we have like these exit levels. So
- 5:31:16these levels reflect the analysis that
- 5:31:19we've create in calculate historical
- 5:31:21spread that you can see here and
- 5:31:26now we're just going to let it run and
- 5:31:28hopefully
- 5:31:30this is done. So yeah guys, so I can't
- 5:31:33promise actually that um we'll have
- 5:31:38what do you call it? Um like a profits
- 5:31:41of the day. So I kind of like actually
- 5:31:43chase profits. I was hoping that I would
- 5:31:45find something today because I found
- 5:31:47like temporary opportunities today. But
- 5:31:50what I'm going to do is tomorrow I'm
- 5:31:52going to let this bot run the entire
- 5:31:54day. I'm going to monitor it and then
- 5:31:56maybe on Wednesday I can like then
- 5:31:58provide an a live stream where we update
- 5:32:00on the train results and where we can
- 5:32:02like add extra feature to a training bot
- 5:32:05and so as I've mentioned we can then try
- 5:32:07to apply strategy on multiple markets so
- 5:32:09I will show you a lot of examples and
- 5:32:12once this code is tested you know and
- 5:32:15I'm sure they can like some work I will
- 5:32:18then upload it to git and your um and
- 5:32:21the members can then download it and try
- 5:32:23it for themselves. Oops.
- 5:32:46Okay. So, I let Claude now manage the
- 5:32:50print statements and
- 5:32:52uh
- 5:32:56Can you also dump uh a JSON
- 5:33:02file from
- 5:33:07tradingbot.py
- 5:33:10for debugging purposes if the script
- 5:33:14crashes.
- 5:33:19So I'm also asking cloud like to dump
- 5:33:21out some file. Uh like dumping a simple
- 5:33:24JSON file should not take too many
- 5:33:26resources and so whenever B crashes or
- 5:33:29there's some issue it's good like to
- 5:33:31have some uh something to investigate
- 5:33:33it. Also you can use like a logging
- 5:33:35library right you can log things but me
- 5:33:38personally I just like to access a quick
- 5:33:39JSON file because it's already like
- 5:33:42formatted and you can see all the like
- 5:33:44uh data that are stored.
- 5:33:53will be free for us to download and use
- 5:33:55please. Unfortunately, no. I'm going to
- 5:33:56provide this code and you know the
- 5:34:00things to my members only.
- 5:34:06So, if you're really interested, you
- 5:34:08know, to access the code, you can check
- 5:34:09out my website and um I offer
- 5:34:12memberships to my members there.
- 5:34:38Okay.
- 5:34:40So let us try to run the script now. It
- 5:34:43looks okay to me but you know a lot of
- 5:34:45can screw up.
- 5:34:48Why don't use open code? What is open
- 5:34:51code?
- 5:34:55Is it like some ID
- 5:35:19cloth code alternative? Um, I don't
- 5:35:22know. I've just tried cloth. So far I
- 5:35:24like it. I don't see any issues with it.
- 5:35:27Uh
- 5:35:30so far I've been like very productive
- 5:35:31with cloth. So I don't have any
- 5:35:33experience with open code. So if any of
- 5:35:36you guys have tried it, uh you can let
- 5:35:38like let me know your reviews in the
- 5:35:40chat if it's worth like trying.
- 5:35:43I mean, $5 is of course like great
- 5:36:01cloud limit is very low. Well, yes. Uh I
- 5:36:04would say this
- 5:36:06to many people, but so far if you look
- 5:36:09at my usage limits, right? So, it reset
- 5:36:11like a few hours ago. So right now me
- 5:36:13using cloth only used up like 8% for a
- 5:36:16session which will reset like in 3 hours
- 5:36:18and 46 minutes. So so far I don't feel
- 5:36:21like I'm getting that limited.
- 5:36:34An idea is to have claude create
- 5:36:36comprehensive error code index and to
- 5:36:38have a self test check button built in
- 5:36:40that when pushed will run self test to
- 5:36:42make sure no new features broke other
- 5:36:44code. Yes. Uh so testing definitely will
- 5:36:47help us also.
- 5:36:53All right then. So now uh we are in the
- 5:36:57final stages to run the run the bot.
- 5:37:12And it looks like we have something
- 5:37:17to work with.
- 5:37:37Oh, I also forgot to add one check in
- 5:37:40pi.
- 5:37:42Wait until 5 seconds have elapsed to
- 5:37:48fully compute the spread average.
- 5:37:56Then resume with the
- 5:38:10how do I become member please? Uh in the
- 5:38:12descriptions you'll find a link to my
- 5:38:14website atjresearch.com
- 5:38:16and you can uh find out more on my
- 5:38:18website.
- 5:38:23Why Python? It is so slow for tick trade
- 5:38:25data. Well, it's the first language I've
- 5:38:28learned and so far I've only coded
- 5:38:31Python. So it's actually the only thing
- 5:38:33I know how to use because you know I've
- 5:38:36been also doing a lot with data
- 5:38:37analysis. So yeah, that's uh what I'm
- 5:38:41working with.
- 5:39:07Okay guys, so now it seems that I can
- 5:39:10try to start the training bot. Uh, so
- 5:39:14far my hing script is still running.
- 5:39:22So now
- 5:39:28my training bot is sort of running.
- 5:39:32But I think there is probably a mistake
- 5:39:35because we shouldn't be placing bile
- 5:39:37limit orders because
- 5:39:40uh the thresholds
- 5:39:43have not been met. So bry less than -4
- 5:39:46exit - one sell entry above four and
- 5:39:49less than one.
- 5:39:53And let's see
- 5:39:56what's going on here. So now we're
- 5:39:57actually trying to place a buy limit at
- 5:40:02the top of book. Now where did you get
- 5:40:04this crypto data? It's from Hyperlquid.
- 5:40:06So I'm connected to this exchange and
- 5:40:08I'm getting data directly from this
- 5:40:11exchange.
- 5:40:19So right now my
- 5:40:22uh
- 5:40:24US 559.8 eight.
- 5:40:28And if I want to buy
- 5:40:30then
- 5:40:35it should be like 35.
- 5:40:38So I think it's definitely an error.
- 5:40:52And so I'm going to cancel this order
- 5:40:54and I'm going to try to debug a bit
- 5:40:56more.
- 5:41:09So we're going to cancel this.
- 5:41:12That's fine.
- 5:41:16Is this data free or paid? Yes. Uh this
- 5:41:18data is uh free to use from the
- 5:41:20exchange. So feel free to use it.
- 5:41:23Would work on cloud uh pro subscription
- 5:41:25also how is token consumption like uh so
- 5:41:28right now I'm using uh the cloud max uh
- 5:41:335x and right now the consumption is 9%
- 5:41:36which is pretty good. I think on pro it
- 5:41:38would be pretty usable. Also if you're
- 5:41:40interested just in the trading strategy
- 5:41:42itself I will share a code to my
- 5:41:44members. So you won't need to use AI for
- 5:41:47that. But if you want to use AI to
- 5:41:50develop the strategies uh you know and
- 5:41:52do similar things like I do, I think pro
- 5:41:54should actually be enough for this
- 5:42:18Okay. So I need to now check
- 5:42:30how the limit prices are being computed
- 5:42:33because we had you know quote bit right
- 5:42:36so we're quoting the bit price
- 5:42:45and so it's defined as bitid 5 plus the
- 5:42:49target spread.
- 5:42:51That's how our limit price is defined.
- 5:42:55And so here we go down our target spread
- 5:43:01for buy orders.
- 5:43:07Uh this is prior to exit. So here we are
- 5:43:09entering by we want to enter at limit
- 5:43:13price by entry
- 5:43:15which is
- 5:43:18minus 4.
- 5:43:20And so maybe when we amend the order.
- 5:43:31So in the event section uh
- 5:43:38new bit new limit price uh
- 5:43:43is the new bit MT5 plus the target
- 5:43:47spread.
- 5:44:06Okay, let's try to run it again. I need
- 5:44:08to see exactly what's going on here.
- 5:44:19So, we're placing a limit uh
- 5:44:25on hyperlquid. So the current price is
- 5:44:2739.8
- 5:44:29but on hyperlquid the
- 5:44:33open order price
- 5:44:35is at 39.3.
- 5:44:47So again we can try to cancel it. Uh,
- 5:44:49and I'll let CL know
- 5:45:02prices. I tried to place limit uh by
- 5:45:08on hyperlquid.
- 5:45:22prices. The current
- 5:45:27MT5 price is
- 5:45:33how much?
- 5:45:357540.
- 5:45:39And the limit price
- 5:45:46coded on hyperlquid
- 5:45:49was
- 5:45:547539
- 5:46:00because the limit price by entry is
- 5:46:05minus4.
- 5:46:08The limit price
- 5:46:11should be at least 4 USD lower compared
- 5:46:17to MT5. Can you investigate?
- 5:46:57Okay, so we're very close. Um, so now
- 5:47:00we're actually providing the quot limit
- 5:47:02prices. We just need to make sure that
- 5:47:04the training bot is quoting the limit
- 5:47:06prices at a correct level. And then
- 5:47:11once uh that is checked, then we can
- 5:47:14start the training script again.
- 5:47:22Have you tried DeepSc V4 Pro? No, I
- 5:47:24haven't. Uh right now the only thing I'm
- 5:47:26using is cloth sometimes Gemini because
- 5:47:28it's on my phone and that's all I've
- 5:47:31been using uh so far
- 5:47:59Okay, I'll try out. Uh not sure how good
- 5:48:02it is with coding, but um maybe worth a
- 5:48:06try.
- 5:48:18Sir, it's really hard to code bots like
- 5:48:20this because when you try to fetch data
- 5:48:22frequently, you will get rate limit on
- 5:48:23hyperre if you don't run node. Actually,
- 5:48:26no. I think like
- 5:48:29so far I've like never been rate limited
- 5:48:31using the websocket library using
- 5:48:33strategies I use. So that's not
- 5:48:37something that I've experienced. Also,
- 5:48:40for example, lighter, if you like submit
- 5:48:42a lot of trades and get lots of fills,
- 5:48:44they actually want you, you know, to
- 5:48:46provide the quotes and the liquidity.
- 5:48:48So, you you actually the the rate they
- 5:48:51offer good they offer good rate limits
- 5:48:54as long as you trade on the exchange.
- 5:48:57Could you do live streams implementing
- 5:48:59strats on poly markets in Kalashi? Well,
- 5:49:01personally, I haven't like looked into
- 5:49:04these markets yet. So, I don't even know
- 5:49:06if I'm capable of arbitrageing these
- 5:49:09markets, but I definitely want to
- 5:49:11explore that and see, you know, what I
- 5:49:12can do because I I believe that there is
- 5:49:14lots of money to be made. So eventually,
- 5:49:17you know, I'll have a look at the
- 5:49:18prediction markets too.
- 5:49:37Well, again, uh the question regarding
- 5:49:40Koshi and Poly Market bots, uh I don't
- 5:49:43have any experience yet, but it's going
- 5:49:46to be exciting once I test it out.
- 5:49:55And yeah, Bo, thank you for uh
- 5:49:56explaining the things. So, yes, you are
- 5:49:58correct. And so, with websockets, if you
- 5:50:01keep a persistent connection just uh
- 5:50:03like receive the data, there's of course
- 5:50:05no issue with the right limits.
- 5:50:58Okay, let's try
- 5:51:00to run this.
- 5:51:06So, right now it's 43.3.
- 5:51:13No, this is still not good enough
- 5:51:16for 5.1.
- 5:51:21Um
- 5:51:28actually,
- 5:51:36okay, so we cancel the order. Um,
- 5:51:39let's also add a security feature that
- 5:51:42only one order should be open at any
- 5:51:44point in time. I think that would also
- 5:51:47help
- 5:51:52in trading bot.py
- 5:51:56please.
- 5:51:58uh or just make sure that only
- 5:52:03one order is open at any point in time
- 5:52:08for the specified
- 5:52:11symbol.
- 5:53:21Okay, so we've added a check so only one
- 5:53:23order is open at any point in time. Uh
- 5:53:26to make sure that you know if the bot
- 5:53:28suddenly decides to open many orders uh
- 5:53:31in a sequence that uh that doesn't
- 5:53:35happen.
- 5:53:44And I'm interested how the clamping
- 5:53:46actually works because still the limit
- 5:53:48prices are not exactly being
- 5:53:52updated correctly. Where do you live?
- 5:53:54US? No, I live in Europe. Uh, Czech
- 5:53:57Republic, Prague. It's in central
- 5:54:00Europe.
- 5:54:17So here we compute the limit price
- 5:54:27and here we are computing a safe limit
- 5:54:48It's pretty close to Turkey. Emble
- 5:54:49Turkey. Yeah, that's that's true.
- 5:54:52So, it's not that far.
- 5:55:02Okay, so the new changes have been
- 5:55:04updated. So now if I check open orders,
- 5:55:08there should only be one open order at
- 5:55:11any point in time.
- 5:55:24So, seven, five, four, five.
- 5:55:38So, it seems that 7545
- 5:55:4475
- 5:55:56So we are still having the issue we're
- 5:55:58opening double orders. So I think right
- 5:56:00now what makes sense is actually going
- 5:56:03through manual review because I think AI
- 5:56:06is actually getting a bit
- 5:56:08counterproductive. So it is doing all
- 5:56:10the risk test correctly. I'm really
- 5:56:12happy with the hedge exposure with MT5,
- 5:56:16but I have to like review the logic and
- 5:56:19the pricing of limit prices uh step by
- 5:56:21step now. So I think uh I will review it
- 5:56:26like uh in the evening or tomorrow
- 5:56:28throughout the day. So I guess guys uh
- 5:56:31you know because I've been streaming for
- 5:56:32almost six hours, I think I'll call it
- 5:56:35you know the day for today. So thank you
- 5:56:38guys for joining today's live stream and
- 5:56:41I'll give you an update once I have you
- 5:56:43know some updates on this string
- 5:56:45strategy. So I just need you know to do
- 5:56:47some last fine tetuning bug fixes uh
- 5:56:50basically debugging
- 5:56:53and
- 5:56:55uh then I'll let you know you know once
- 5:56:58I have fixed this. So I think we are
- 5:57:00like very close. So hopefully maybe
- 5:57:03tomorrow on Wednesday I'll have a first
- 5:57:05function version that I can then share
- 5:57:08with you guys. And so while I have still
- 5:57:10some time right I can still spend a few
- 5:57:12minutes for some Q&A session. So guys,
- 5:57:15if you have any questions, you know,
- 5:57:16about this project or, you know, about
- 5:57:18what I'm doing, uh, feel free to ask.
- 5:57:22And, uh,
- 5:57:25yeah, I'm ready to answer any questions.
- 5:57:28And
- 5:57:31so
- 5:57:56I'm new here. Can you give a short
- 5:57:57summary what exactly you're trying to
- 5:57:58build, how it works, what's the goal? Uh
- 5:58:01yeah, so uh if you know check
- 5:58:03descriptions, uh I've added a link to a
- 5:58:06post my website where I describe the
- 5:58:09strategy like more in detail. So what
- 5:58:11we're building here is an arbitrage
- 5:58:14strategy between Hyperlquid and MT5. So
- 5:58:17here on hyperlquid what you see is uh is
- 5:58:20a crypto exchange where you can trade
- 5:58:22perpetual futures and
- 5:58:25uh we're trying to you know arbitrage
- 5:58:27price discrepancies with real world
- 5:58:30price such as on metatrader 5. So
- 5:58:33whenever for example S&P 500 is
- 5:58:35overpriced we want to sell it and we
- 5:58:37want to buy it on MT5 and then when the
- 5:58:40price is even out uh you're then trying
- 5:58:43to buy hyperlquid and then sell MT5 hope
- 5:58:46hoping to make money on the spread. So
- 5:58:51uh here uh you'll find the article where
- 5:58:54I'm describing detail uh what we're
- 5:58:56building and what you need to do it and
- 5:58:58so feel free to read that and maybe in
- 5:59:01the next live stream you can you know
- 5:59:02ask questions uh you know more in detail
- 5:59:06if you don't understand anything.
- 5:59:09What's the process for using this and
- 5:59:11please can someone use ICD concepts? Um
- 5:59:18well
- 5:59:20again the strategy is described in the
- 5:59:22article so uh there's actually not much
- 5:59:26to add and I don't see any relation to
- 5:59:29ICT with this strategy right uh me
- 5:59:32myself I don't believe in ICT I think
- 5:59:35ICT is actually uh scam to teach retail
- 5:59:39traders how to trade without actually
- 5:59:41you know
- 5:59:43providing adding any value to retail
- 5:59:44traders. So, I'm going to say bluntly
- 5:59:46that like ICT is a scam and uh anyone
- 5:59:50who trades ICT should proud move away
- 5:59:52from him. And if I've offended someone,
- 5:59:54I'm very sorry, but this is how I feel.
- 6:00:01Like if you check you know 90 99% of all
- 6:00:05content you know on the internet even
- 6:00:07myself when I try manual trading there
- 6:00:09is so much like trash that you read
- 6:00:12online and people should actually not
- 6:00:16learn from those people right so it's
- 6:00:18very difficult to filter out good and
- 6:00:21bad content and hopefully you know while
- 6:00:24I live stream and code and show you guys
- 6:00:26the things I also want to make like
- 6:00:27money in front of you guys so you see
- 6:00:29that the strategies that I'm teaching
- 6:00:31actually work
- 6:00:33and so hopefully you know I can gain
- 6:00:35your trust actually by live trading and
- 6:00:38showing consistent results over time.
- 6:00:42So yeah.
- 6:00:45All right. So guys, if you don't have
- 6:00:48any other questions, I think I'll give
- 6:00:49it like two more minutes. I'll just
- 6:00:51reply to some of my friends. I have a
- 6:00:53dinner schedule today uh outside, so at
- 6:00:57least I can enjoy the sun. It's quite
- 6:00:59hot today.
- 6:01:03And yeah.
- 6:01:16All right, guys. So, I guess uh
- 6:01:21thank you everyone for joining today's
- 6:01:24live stream. It's been like six hours.
- 6:01:26I've actually never streamed this long
- 6:01:27like before, but it was quite fun and
- 6:01:30we've done lots of work. Unfortunately,
- 6:01:32like the string bot is not working, but
- 6:01:33hopefully like tomorrow or the day after
- 6:01:36I'll, you know, stream again and show
- 6:01:39you, you know, some results with a
- 6:01:40training bot and hopefully like we can
- 6:01:42then or I can then share the results
- 6:01:45with you soon.
- 6:01:48And so again, question, where are you
- 6:01:50based? I'm based in Czech Republic,
- 6:01:52Prague, which is in central Europe.
- 6:01:56Uh, I was asking if I could use this
- 6:01:58algobot using ICT concepts.
- 6:02:02Most likely not because ICD concepts
- 6:02:06and arbitrage trading are two completely
- 6:02:09separate things. Uh,
- 6:02:12where
- 6:02:15yeah, you can't like compare pairs and
- 6:02:18apples. Uh but if you want to code a
- 6:02:21strategy using ICD concepts which I do
- 6:02:24not advise because ICT
- 6:02:28I'm sorry to say it does not work uh you
- 6:02:32can still try you know to try apply ICD
- 6:02:34concepts uh with AI. So feel free to do
- 6:02:38that.
- 6:02:42Okay guys so thank you for the live
- 6:02:44stream and it was a pleasure. I'll I'll
- 6:02:47announce by the way I'll announce the
- 6:02:48next live stream very soon. So tomorrow
- 6:02:50uh if I'm planning to stream on
- 6:02:52Wednesday I will you know then uh
- 6:02:55probably announce a stream on Tuesday.
- 6:02:57So if you want do not want to miss it
- 6:02:59you can always turn on the not
- 6:03:00notification bell icon to not miss any
- 6:03:03live streams. So until then, I'll see
- 6:03:05you guys and enjoy the
About this transcript
This page contains the full transcript of Coding a HyperLiquid DEX Arbitrage Bot with Claude AI by ATJ Research, generated from the public captions YouTube serves with the video. The transcript has 33,131 words across 5,339 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.