YouTube2Text

d5 risk management on hyper liquid — Transcript

by Moon Dev · 4,942 words · 746 segments · language en · Watch on YouTube

Full transcript

  1. 0:00all right so in this video we are going
  2. 0:02to go over risk management but we're
  3. 0:04going to use hyper liquid hyper liquid
  4. 0:06is a different exchange than what you've
  5. 0:08seen before throughout this training I
  6. 0:10go ahead and show you ccxt if you type
  7. 0:13in ccxt exchanges you'll see here
  8. 0:15there's a ton of exchanges that ccxt
  9. 0:18connects to in this training I show fex
  10. 0:21throughout this boot camp I show femex
  11. 0:23connecting through ccxt the cool thing
  12. 0:26is with ccxt is you can connect to like
  13. 0:28K coin or Kraken or binance and so on
  14. 0:31and so on there are just some small
  15. 0:33tweaks and changes but the idea through
  16. 0:35this boot camp is to show you yes ccxt
  17. 0:38through fex but that will all also give
  18. 0:41you access to all of these exchanges
  19. 0:43there're going to be small changes but
  20. 0:44if I can successfully teach you how to
  21. 0:46code and connect to all of these
  22. 0:48exchanges then you'll be able to switch
  23. 0:50exchanges really easily so now here in
  24. 0:53this video I want to show you something
  25. 0:56that's not ccxt ccxt is like uh
  26. 0:59something that connects to all exchanges
  27. 1:01but now I'm going to show you on hyper
  28. 1:03liquid hyper liquid is a decentralized
  29. 1:06Perpetual exchange so a decentralized
  30. 1:09Perpetual exchange is safer in my
  31. 1:12opinion than centralized exchanges so
  32. 1:15I'm moving over to hyper liquid and dydx
  33. 1:18and these other exchanges I still use
  34. 1:20fix I still use ccxt so everything is
  35. 1:22relevant here but the importance came to
  36. 1:25me was when when FTX happened FTX you
  37. 1:28know the s bakman free the the crook who
  38. 1:31stole everybody's money I don't know if
  39. 1:33that's going to happen again you know
  40. 1:34Good Vibes hope it never happens again
  41. 1:36but in case it does then we need to be
  42. 1:38able to switch exchanges really quickly
  43. 1:40right so ccxt allows you to do that but
  44. 1:43if you want to be a little safer I like
  45. 1:46Perpetual decentralized exchanges
  46. 1:48because they allow us to pull our cash
  47. 1:52out really quickly and really easily so
  48. 1:55that's why um I'm showing you I'm
  49. 1:56starting to show more of this is because
  50. 1:58we never know what's going to happen in
  51. 1:59the
  52. 2:01future so what we're going to do here is
  53. 2:04I started a new a nice function file and
  54. 2:07I'll make sure that you have access to
  55. 2:08the nice function file because we're
  56. 2:10going to go over a bunch of code here
  57. 2:12and the nice function file is I actually
  58. 2:14moved a lot of these functions that we
  59. 2:16had earlier uh into the nice function
  60. 2:19file so in order to get them I would say
  61. 2:22uh import nice
  62. 2:27funks as n and you'll see me using this
  63. 2:30quite a bit throughout this boot camp so
  64. 2:33um this is it's just a lot easier it's a
  65. 2:35lot cleaner to have your functions in
  66. 2:38one file and then the uh the bot or
  67. 2:41whatever we're building in the other
  68. 2:43file so we're going to build out a
  69. 2:45couple things here today we're going to
  70. 2:46build out a git position so we're going
  71. 2:48to be able to see what position are we
  72. 2:50actually in right now and then we're
  73. 2:52going to build out a p&l close the Pano
  74. 2:55close is super important this is a risk
  75. 2:57management tool that essentially
  76. 2:59monitors the trading position for the
  77. 3:01profit and loss so it's always going to
  78. 3:04be looking and if my p&l if I want to
  79. 3:06take a Target profit of 5% well the
  80. 3:09bot's always going to be watching and
  81. 3:11when it hits 5% it's going to take us
  82. 3:12out elegantly though not like a market
  83. 3:14order it's going to be limit orders and
  84. 3:16if it hits our Max loss it's going to
  85. 3:18automatically take us out so this is
  86. 3:20super helpful because hand Traders are
  87. 3:22going to try to put stop losses and take
  88. 3:25profits but then usually what happens is
  89. 3:27they get emotional and they they remove
  90. 3:29the stop loss or they remove the
  91. 3:31takeprofit and algorithms don't do that
  92. 3:34so we're going to build that out today
  93. 3:35to really get our risk management
  94. 3:38down now inside that p&l close we have
  95. 3:41we're going to have a function called
  96. 3:42kill switch so kill switch is a function
  97. 3:45that forcefully closes all POS or the
  98. 3:47position that we asked for so you're
  99. 3:49going to see all that here now I'm going
  100. 3:50to write it all out with you and then
  101. 3:52I'll show you how to integrate it and uh
  102. 3:54we'll do everything here um here right
  103. 3:58now so let's go ahead and import the
  104. 4:00things we need we need to import don't
  105. 4:03share as D and now remember don't share
  106. 4:07has my my key my secret key in here as
  107. 4:11something like
  108. 4:13this and then I just import it as
  109. 4:16D okay so let's say from eth
  110. 4:22account signers dolc
  111. 4:26import local account okay import eth
  112. 4:30account okay import Json and time from
  113. 4:34hyper
  114. 4:35liquid. info import info from hyper
  115. 4:42liquid.
  116. 4:44exchange import exchange
  117. 4:48exchange from hyper
  118. 4:51liquid.
  119. 4:53utils import constants okay import ccxt
  120. 5:00import pandas as PD import date
  121. 5:05time import
  122. 5:09schedule import
  123. 5:12requests symbol doesn't
  124. 5:15matter I'm going use
  125. 5:18wi let's go ahead and say Max loss this
  126. 5:21does
  127. 5:23matter5 that's the max will lose ever
  128. 5:26because the bot will take us out at that
  129. 5:28amount for Target get the account
  130. 5:30minimum this is the minimum amount I
  131. 5:31want in my account so let's say
  132. 5:35n and then we'll say time frame here
  133. 5:38equals 4 hours we won't necessarily use
  134. 5:40all this but size equals 10 and we'll
  135. 5:43say coin equals symbol we just reset it
  136. 5:47to the coin secret
  137. 5:49key equals d. private key oops be
  138. 5:54careful with that don't share with
  139. 5:55anybody account
  140. 5:57equals local account equals
  141. 6:00equals eth account. account. from Key
  142. 6:05and then we'll pass in the secret key
  143. 6:07okay and then we'll go ahead and keep
  144. 6:11going so this is going to be our
  145. 6:14essentially our risk
  146. 6:17management so later on we'll build
  147. 6:19actual Bots with risk management so if
  148. 6:22this doesn't make sense with you you're
  149. 6:23going to get repetition so don't worry
  150. 6:25about it but I'm going to say that print
  151. 6:27you know this is our
  152. 6:30bot and then I'm going to print um
  153. 6:34controlling risk with our pnl close Okay
  154. 6:39so that's how I just Notify myself and
  155. 6:42then I can say check p&l close here and
  156. 6:46then we'll say n.
  157. 6:48pnl close here and we can pass in the
  158. 6:52symbol here we can pass in the Target
  159. 6:55here we can pass in the max loss here
  160. 6:59and we can pass in the account here so
  161. 7:02I'm actually not going to do end do yet
  162. 7:05um I actually had to remake this video
  163. 7:06because it paused or something so I'm
  164. 7:09going to keep it at p&l Clos I'm going
  165. 7:11to build it up here so we can go through
  166. 7:12it
  167. 7:13together and then later I'll put it in
  168. 7:16the nice funks file how about that
  169. 7:17because I feel like if you see it uh
  170. 7:20written out it's going to just be better
  171. 7:22so I know this is this is a very very
  172. 7:24important module so I want to make sure
  173. 7:26to write it all out with you I'm going
  174. 7:27to say def piano close
  175. 7:31symbol
  176. 7:32Target Max
  177. 7:35loss account okay pass that
  178. 7:38in this checks if we hit our Target or
  179. 7:44Max loss okay and then let's say print
  180. 7:50entering entering
  181. 7:53entering panl close okay and that will
  182. 7:56say
  183. 7:58positions I'm in
  184. 8:02position position
  185. 8:05size position
  186. 8:08symbol
  187. 8:09entry price p&l
  188. 8:13perk long and then equals get position
  189. 8:17here get position so we need to build
  190. 8:20that and then say symbol and then
  191. 8:23account so let's build that get position
  192. 8:26here but let's first finish all this the
  193. 8:29p&l close because then it will be easier
  194. 8:31so we'll say if p&l perk is greater than
  195. 8:35Target then we want to close this
  196. 8:37position so we say
  197. 8:39print F
  198. 8:42pnl gain is p&l
  199. 8:48perk and Target is
  200. 8:52Target Target Come On Come On Come On
  201. 8:57Target closing
  202. 9:01position as a win okay and then we'll go
  203. 9:05ahead and say kill
  204. 9:07switch equals
  205. 9:10position
  206. 9:12position
  207. 9:15symbol and account
  208. 9:19One account okay and then Al
  209. 9:23if pnl
  210. 9:25perk is under Max loss meaning we're in
  211. 9:28a losing position and we've hit our Max
  212. 9:30loss or it's equal to our Max loss then
  213. 9:33we say p&l loss is p&l
  214. 9:37perk
  215. 9:39okay and Max loss is Max
  216. 9:44loss okay closing position as a a
  217. 9:52loss okay and then we'll say else print
  218. 9:56oopsies click some buttons there
  219. 10:01else
  220. 10:05print I can just copy
  221. 10:10this we also need to put the kill switch
  222. 10:13after we printed that statement because
  223. 10:14we actually need to kill it the kill
  224. 10:16switch is super nice and I'm about to
  225. 10:17show you
  226. 10:21that
  227. 10:22so this is going to be not closing
  228. 10:26position Target
  229. 10:30Target not
  230. 10:32closing okay and then here we'll go
  231. 10:35ahead and say
  232. 10:39finished
  233. 10:42print finished p&l close because it's
  234. 10:46going to go into here first and close
  235. 10:48the position before it's done so let's
  236. 10:50get positions let's actually get
  237. 10:53position get position so let's go build
  238. 10:55that get position
  239. 11:03so this git position function is right
  240. 11:05here we're going to put it right here
  241. 11:06def G position here and we're going to
  242. 11:09say symbol and then account okay and
  243. 11:13then we're going to pass that in this
  244. 11:16gets
  245. 11:19gets
  246. 11:21the position info we
  247. 11:26need super super useful I use it all the
  248. 11:30time it's probably one of my most used
  249. 11:33because you're always looking to see
  250. 11:35what your position is Right skip WS
  251. 11:38equals true okay and then we'll say user
  252. 11:41State here equals info.
  253. 11:47user
  254. 11:49State account. address and then we'll
  255. 11:53say
  256. 11:55print F this is the current
  257. 11:59account value and then the current
  258. 12:02account value is we're going to put it
  259. 12:04in here user State user State and then
  260. 12:07we'll say
  261. 12:11margin margin
  262. 12:15summary and then tap into account
  263. 12:20value got to be super careful everything
  264. 12:22is Spell correctly
  265. 12:25there we'll make an empty list for the
  266. 12:27positions to store them
  267. 12:31we'll print F this is the
  268. 12:35symbol and then pass in
  269. 12:39symbol okay and then we'll go ahead and
  270. 12:42say for position in user state
  271. 12:47of asset
  272. 12:51positions
  273. 12:53if uh
  274. 12:57position position
  275. 13:01of the actual
  276. 13:04coin if that equals the
  277. 13:07symbol and
  278. 13:10Float of that
  279. 13:14position the
  280. 13:17position
  281. 13:18size
  282. 13:21szi make these double quotes just in
  283. 13:25case
  284. 13:27szi does not equal Z that means there's
  285. 13:30a position so we'll say
  286. 13:33positions.
  287. 13:35append
  288. 13:39positions do
  289. 13:41append
  290. 13:48position
  291. 13:50brackets
  292. 13:53position and then in position we set to
  293. 13:56true cuz we are in position and the size
  294. 13:59would equal a float of
  295. 14:03position brackets where
  296. 14:06position where it shows us our
  297. 14:09size here and then we'll say position
  298. 14:13symbol symbol equals
  299. 14:16position where the
  300. 14:21position where it shows the
  301. 14:25coin okay and then we'll test all this
  302. 14:28to make sure works so don't worry if
  303. 14:30you're going fast with me float position
  304. 14:35okay
  305. 14:39position and then here the
  306. 14:43entry PX okay and then
  307. 14:46pnl perk equals
  308. 14:50float of
  309. 14:54position
  310. 14:57position where it
  311. 15:02shows return on
  312. 15:07equity and then we'll multiply that by
  313. 15:09100 to get the actual percentage so we
  314. 15:12got the symbol we got the price we got
  315. 15:14the percentage we got the size we got
  316. 15:16pretty much everything we need and then
  317. 15:18we can say print F this is the p&l perk
  318. 15:23percentage p&l perk here and then we'll
  319. 15:27break cuz we're done we got everything
  320. 15:29we need and then
  321. 15:31here where it says else or
  322. 15:35where here we actually
  323. 15:41go should be here
  324. 15:44else in
  325. 15:56position in position
  326. 16:00equals
  327. 16:02false size equals z
  328. 16:05oops size equals
  329. 16:090
  330. 16:12position
  331. 16:15symbol equals
  332. 16:19none entry
  333. 16:22price equals
  334. 16:25z and pnl perk
  335. 16:29equals z and then here if size is bigger
  336. 16:34than zero long equals
  337. 16:38true L
  338. 16:40if size is less than zero then long
  339. 16:44equals false because that means it's in
  340. 16:46a short position and then
  341. 16:48else long equals none okay and then
  342. 16:53we'll scroll down here and go to there
  343. 16:56and say return position
  344. 17:00all of them in
  345. 17:02position okay and then size okay and
  346. 17:05then position symbol okay and then entry
  347. 17:08price and then p&l
  348. 17:10perk and then long cool so we got our
  349. 17:13position now and now we just need to
  350. 17:15build the kill switch so let's build
  351. 17:16that kill switch say
  352. 17:19def kill switch and then what do we pass
  353. 17:22into this kill switch just a position
  354. 17:24symbol
  355. 17:37so let's get uh def kill
  356. 17:41switch and let's write this out so kill
  357. 17:44switch is symbol
  358. 17:47symbol and account okay this is one of
  359. 17:51my favorite things as
  360. 17:53well I'm actually going to copy this the
  361. 17:56kill switch I use so so much
  362. 18:00he'll switch here and then
  363. 18:03while I'm in
  364. 18:06position we can cancel all orders cancel
  365. 18:12all orders passing the account you can
  366. 18:15see it's another
  367. 18:17function we need to be able to cancel
  368. 18:19all orders at any time get bid ask so
  369. 18:23we're going to say ask bid
  370. 18:25L2 data equals ask bid we got to get
  371. 18:30that as
  372. 18:31well position
  373. 18:34symbol and then we've got all that
  374. 18:37information then we say position size
  375. 18:39equals the absolute of the position
  376. 18:43size then if long equals true we're
  377. 18:48going to close the position limit
  378. 18:51order and
  379. 18:54position
  380. 18:56symbol false position position
  381. 19:00size ask true cuz we're only closing so
  382. 19:04that reduce only is true print F or just
  383. 19:08kill switch kill
  384. 19:10switch sell to close
  385. 19:14submitted okay and then L if remember
  386. 19:17we're we're closing the position so we
  387. 19:18call this we're closing it no matter
  388. 19:20what we're just seeing if it's long or
  389. 19:22short so here we're going to have to get
  390. 19:24the limit order again I think I've
  391. 19:26already shown you how to do the limit
  392. 19:27order so I'll copy and paste that one
  393. 19:29here we got to change this to true
  394. 19:31because it's closed inste this needs to
  395. 19:33be the bid instead the
  396. 19:41ask and
  397. 19:43then we'll print this as
  398. 19:50well and this will be a print buy buy to
  399. 19:54close and then I put a time. sleep here
  400. 19:57just because it's nice
  401. 20:00to pause things a little bit let's copy
  402. 20:03it let's go ahead and paste that in
  403. 20:05there okay and then down here we're
  404. 20:08going to do this again get the positions
  405. 20:10because we have to check we're in a
  406. 20:11while loop so we want to check to make
  407. 20:16sure that we're if we're in position or
  408. 20:18not so we just paste that in and then
  409. 20:21down here if we're not then it will go
  410. 20:23ahead and print out
  411. 20:24position
  412. 20:26successfully successfully
  413. 20:30successfully closed in kill
  414. 20:33switch now since we've already gone over
  415. 20:35the limit order um and we're going to be
  416. 20:38using it so much throughout this I'm
  417. 20:39just going to copy and paste it then you
  418. 20:41can see
  419. 20:44it so here is the limit
  420. 20:47order and you can see it needs this so
  421. 20:49pause it here type this
  422. 20:52out so we need to get SZ get
  423. 20:57SZ symbols
  424. 21:05death okay this is another one this is
  425. 21:08just formatting things that took me a
  426. 21:10long time to figure out I'm glad I'm
  427. 21:11able to give it to
  428. 21:14you okay you can see here I'll zoom out
  429. 21:16a little bit so you can pause it and
  430. 21:18type this
  431. 21:21out there it is so it's just going and
  432. 21:24seeing like what is the actual size we
  433. 21:27need to put in because the the decimal
  434. 21:30places are super weird on hyper liquid
  435. 21:31but I figured it out for you and then we
  436. 21:34get the ask bid and this should be the
  437. 21:35last thing we need in there so let's go
  438. 21:38here and scroll down and this is the ask
  439. 21:41bid so you know I know I didn't type any
  440. 21:43of this out but I'm pretty sure I went
  441. 21:44over all of this already so I want to go
  442. 21:46a little bit faster and don't worry we
  443. 21:48build three full Bots later on using all
  444. 21:51of this information so um that is what I
  445. 21:55wanted to show you here for the risk
  446. 21:58management but if we scroll down let's
  447. 22:00go check out our bot and let's see if we
  448. 22:03can finish this up here there might be a
  449. 22:06couple more things we want to build so
  450. 22:08p&l closed every single time I wanted to
  451. 22:10show you here uh if I run this bot it's
  452. 22:13going to check it every time and later
  453. 22:15on in the boot camp I we build actual
  454. 22:17bots so if this is not making sense
  455. 22:19don't worry you can take it in type it
  456. 22:21out and we will go ahead and build more
  457. 22:24so what I was mentioning about the kill
  458. 22:26switch is really cool is you know the
  459. 22:28p&l close actually calls the kill switch
  460. 22:31right it's up here it calls the kill
  461. 22:32switch but there's other risk controls
  462. 22:34you can have so a couple just really
  463. 22:36quickly I don't want to spend too much
  464. 22:38time on this but a couple risk controls
  465. 22:39you'll see me build later is one if we
  466. 22:47have over X position so for example in
  467. 22:51one of the later Bots I only want one
  468. 22:53position at a time so if we have more
  469. 22:55than one position I want to kill I want
  470. 22:57to kill the positions because something
  471. 22:58went wrong something crazy and you'll
  472. 23:00see this throughout the game throughout
  473. 23:02the game of algo trading is like things
  474. 23:04are going to go weird and you want to
  475. 23:05make sure to have these things like hey
  476. 23:07I only want one position Max and if we
  477. 23:09have more then um get us out of there so
  478. 23:12another way to manage risk is if my
  479. 23:17account size goes under whatever it is
  480. 23:22whatever I want so for example if my
  481. 23:24account size was $100 and I never wanted
  482. 23:26it to go under
  483. 23:2870 I could do something like this I
  484. 23:31could say count value equals a float of
  485. 23:36and uh account Val or
  486. 23:41balance and then pass an account so how
  487. 23:44do we get the account Balan I'll go
  488. 23:46ahead and just give you that function
  489. 23:55here so we'll just go ahead and create
  490. 23:58it right here
  491. 23:59def account balance and then we pass in
  492. 24:03the account okay and then how do we get
  493. 24:05the account balance actually super easy
  494. 24:06we have it somewhere
  495. 24:10here here it is right here so we can
  496. 24:13actually just copy all this
  497. 24:18over paste it in here unmark some of it
  498. 24:22just unmark all of it
  499. 24:37so this is the account balance right
  500. 24:39here so I can just say value what did I
  501. 24:43call it
  502. 24:44before
  503. 24:46value equals that and then
  504. 24:49[Music]
  505. 24:52return return value perfect so that's
  506. 24:56how you get the account value you see
  507. 24:57there's under line on that key it's
  508. 24:59because I need to set it
  509. 25:01up it's called secret key just named
  510. 25:05differently and you know It's Tricky I I
  511. 25:09you know I put these things in here so
  512. 25:10you can see
  513. 25:13everything different ways to do it
  514. 25:15variables are going to be named
  515. 25:16differently and this should return count
  516. 25:18value so I could say something like this
  517. 25:21with my kill switch which is super nice
  518. 25:23you see the p&l close it's going to
  519. 25:25check the uh p&l close risk the take
  520. 25:27profit and Max loss but also I can say
  521. 25:30if account
  522. 25:35value is lower than the account minimum
  523. 25:39and we could have like an account Min
  524. 25:41minimum up top saying hey we don't want
  525. 25:43anything lower than I think there's like
  526. 25:4410 bucks in this account so anything
  527. 25:46lower than seven if that's the truth
  528. 25:49then print F account value is account
  529. 25:53value
  530. 25:58and closing because our low is whatever
  531. 26:02our account minimum is so just another
  532. 26:05way to use the kill switch and I'll just
  533. 26:07pop in the kill switch right here so you
  534. 26:09can see how useful this is right
  535. 26:12position
  536. 26:14symbol or we just called it
  537. 26:17symbol and then count so just like that
  538. 26:20we built out all the wrist stuff for
  539. 26:22hyper liquid pretty easy to do let's go
  540. 26:24ahead and run it make sure there's no
  541. 26:26errors looks like we do have a little
  542. 26:28bit of error in line 28
  543. 26:31here oh and I didn't put the cancel
  544. 26:33orders in there either so we'll finish
  545. 26:39that this needs to be an equal
  546. 26:44sign okay let's see size is referenced
  547. 26:46before so let's check out
  548. 26:4954 size if
  549. 26:56size this should be moved over a little
  550. 26:58a little
  551. 27:04bit in position
  552. 27:1461 this is actually all should be moved
  553. 27:17over this way to the
  554. 27:24left just easy mistakes that everybody
  555. 27:26makes you know so don't worry about it
  556. 27:28you know there's formatting things it's
  557. 27:30hard when you're even I'm deep I'm deep
  558. 27:32in this game multiple years now and um I
  559. 27:35still make these little formatting
  560. 27:36mistakes like I need to move them over
  561. 27:38and by the way I use command bracket to
  562. 27:41move right or
  563. 27:42left let's go ahead and finish this up
  564. 27:45with the cancel orders here because I
  565. 27:46didn't show you that one yet so cancel
  566. 27:49orders so let's make that function
  567. 27:51really
  568. 27:52quickly and we'll say def cancel orders
  569. 27:57and I'll just pop pop it in here and you
  570. 27:58can see it super easy I can walk through
  571. 28:02it as well cancel orders we're connected
  572. 28:03to the exchange we're seeing all the
  573. 28:05orders and then for all orders we're
  574. 28:07canceling orders now what I do typically
  575. 28:11is this is where you see how long this
  576. 28:12is getting this is where I start to
  577. 28:14really just like move the things
  578. 28:17over I move it over to a nice function
  579. 28:20file so my nice function file is already
  580. 28:22built out and you'll have access to this
  581. 28:27but I can then just just move all of
  582. 28:29this stuff over
  583. 28:33here all of the functions just so it's a
  584. 28:35little easier to work with you know I
  585. 28:38can exit and move it all over here and
  586. 28:42it's I think it's already in there so
  587. 28:43I'll just put a line to delete it and
  588. 28:46then here might need to change some
  589. 28:48things like the secret key whatever we
  590. 28:50did up here
  591. 28:58but it's just nice to work with another
  592. 29:01um file
  593. 29:04sometimes so you see I have don't share
  594. 29:07brought in so I might need to bring in
  595. 29:09this secret key thing
  596. 29:13here just like that so you might have to
  597. 29:16do that as well but you can see now it's
  598. 29:17all in here and then how do I access
  599. 29:20those things now I just put n do n dot
  600. 29:23because I have this nice funks here
  601. 29:25imported as n and Sim to how we import
  602. 29:28our don't share so I already showed you
  603. 29:31how to do that but now all these
  604. 29:32functions I just hit end Dot and now
  605. 29:34just my my page is much cleaner my
  606. 29:37script or
  607. 29:39whatever so just like that so I showed
  608. 29:42you three ways to manage risk here the
  609. 29:44p&l close manages your risk upside and
  610. 29:47downside which is hard to do as a human
  611. 29:50and we need this in all of our Bots or I
  612. 29:52do at least pretty much um some Bots
  613. 29:55close on different things like maybe
  614. 29:56it's closing when it gets to the supply
  615. 29:58zone or the demand Zone but a lot of
  616. 30:00bots are also um max loss or take profit
  617. 30:04I talked about how we can close if we
  618. 30:06have more than x positions you can say
  619. 30:08hey if we're over x positions just call
  620. 30:10the kill switch later on in the boot
  621. 30:12camp I show you a bot that does this so
  622. 30:14I'm not going to show you now but then I
  623. 30:16also talked about how to get your
  624. 30:18account value because maybe you never
  625. 30:19want your account value to go lower than
  626. 30:2130% if that's part of the back tested
  627. 30:24strategy then you can build it this way
  628. 30:26if account value is under 30% so just a
  629. 30:29few ways to manage risk here on hyper
  630. 30:31liquid I know I went fast here I know I
  631. 30:33did a lot here and if it's not all
  632. 30:36making sense don't worry because we are
  633. 30:38building three Bots and I'll give you a
  634. 30:40little preview here we're doing a Binger
  635. 30:42band bot a supply and demand Zone bot
  636. 30:45and a vwap bot for hyper liquid along
  637. 30:48with three other Bots for ccxt because I
  638. 30:51truly believe if I can transfer all my
  639. 30:53skills to you you're going to be able to
  640. 30:55work on any exchange no matter if it's
  641. 30:58through ccxt or connecting directly to
  642. 31:00the exchange like we just did here with
  643. 31:02Hyper liquid my goal is to get you to a
  644. 31:05place you're as confident I as I am with
  645. 31:07this stuff and you feel you can build
  646. 31:09any any trading strategy into a back
  647. 31:12test to see if it actually worked in the
  648. 31:14past and if it worked in the past then
  649. 31:16you'll be able to build any bot so we're
  650. 31:18just getting started here I think we're
  651. 31:19on day five or something uh there's a
  652. 31:21ton more uh if you feel lost at any
  653. 31:24point please do ask in the code help
  654. 31:26section but don't let it stop you you
  655. 31:28from moving forward keep moving forward
  656. 31:30I like to say that this is going to take
  657. 31:32a 100 days to really master so you know
  658. 31:35you might watch the boot camp two three
  659. 31:37times uh some the way I learn I I
  660. 31:40usually take on courses like I'll just
  661. 31:41watch the course one time through don't
  662. 31:44do anything the second time through I'm
  663. 31:46going to code everything out with them
  664. 31:48so I'm pausing the videos coding
  665. 31:50everything out and then I'll even
  666. 31:51sometimes watch a third time through and
  667. 31:54if I get stuck anywhere I've shown you
  668. 31:56this I think but like for example this
  669. 31:58didn't make sense to me this part that
  670. 32:00third time through the Boot Camp or the
  671. 32:02course I would go here and I would say
  672. 32:04hey AI I'm learning these topics above
  673. 32:10can you please give me three analogies
  674. 32:14to teach me them and then also five code
  675. 32:20examples of the topics so I can practice
  676. 32:26them so so you know this boot camp is
  677. 32:29showing you literally everything I know
  678. 32:30about algo trading it's just I'm not in
  679. 32:33your head so I don't understand where
  680. 32:34you get stuck if you do get stuck
  681. 32:36somewhere and this doesn't help you
  682. 32:38these examples then please do Post in
  683. 32:41the code help section we're here for you
  684. 32:43the whole time you're not alone just
  685. 32:46know that there's a ton of other amazing
  686. 32:49people that are attacking the same thing
  687. 32:50as you and we can all kind of work
  688. 32:52together so I've got my team in there
  689. 32:55helping you at all times in the clo help
  690. 32:57section we've got AI now which is I
  691. 33:00found it so amazing for really studying
  692. 33:03Concepts because I'm deep into this game
  693. 33:05and I still get stuck I still don't
  694. 33:08understand everything and now we have ai
  695. 33:11and I it's just like I feel like I can
  696. 33:14build anything now I can build anything
  697. 33:17because when I do get stuck on something
  698. 33:18I just ask Ai and I learn it and I do
  699. 33:21this I get analogies I get examples and
  700. 33:24then I type them out and then I just
  701. 33:25Master them and then I know in my mind I
  702. 33:28know in my mind I don't necessarily need
  703. 33:30to memorize all this stuff so don't
  704. 33:32don't put that pressure on yourself if
  705. 33:33you feel like this is a lot you're
  706. 33:35overwhelmed don't worry about it you got
  707. 33:37this number one I know you got this but
  708. 33:40number two you don't have to store all
  709. 33:42of this stuff in your mind there's
  710. 33:44documentation and then there's AI you
  711. 33:46know so um what I found you know I
  712. 33:48learned how to code before AI was here
  713. 33:51which is good that's why I I turned off
  714. 33:54the uh G GitHub co-pilot here for
  715. 33:56teaching you cuz I don't want I wouldn't
  716. 33:58recommend learning with AI but use it as
  717. 34:01like a resource to teach you and give
  718. 34:03you more examples and things like that
  719. 34:05wherever you're stuck I'm trying to
  720. 34:07transfer absolutely everything I know
  721. 34:09about this algo training process to you
  722. 34:11I hope this was very enlightening about
  723. 34:12how to control
  724. 34:15risk and I can't wait to show you how I
  725. 34:18actually control risk in bots in the
  726. 34:20future but remember it's about the RBI
  727. 34:23system so while I am going to show you
  728. 34:24how to build I think six or more Bots
  729. 34:27here uh in the future in the future days
  730. 34:30it really the the alpha is generated in
  731. 34:33the research and the back test phase so
  732. 34:35research back test research back test
  733. 34:37find a bunch of winning back tests and
  734. 34:39once you have winning back tests
  735. 34:40Implement those into Bots it's really
  736. 34:43exciting to jump in and start building
  737. 34:45Bots right away I get it I was there but
  738. 34:47I'm trying to give you my experience so
  739. 34:49you save the money and you work in the r
  740. 34:51and the B opposed to the the I which is
  741. 34:54implementing Bots but I can't wait to uh
  742. 34:56see you in the next video and this was a
  743. 34:59really good uh risk control video so you
  744. 35:01can think about ways that you want to
  745. 35:03manage risk I'll see you in the next
  746. 35:04video have a great one

About this transcript

This page contains the full transcript of d5 risk management on hyper liquid by Moon Dev, generated from the public captions YouTube serves with the video. The transcript has 4,942 words across 746 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.