File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -484,15 +484,11 @@ export class User {
484484 enterHighLeverageMode = undefined ,
485485 perpPosition ?: PerpPosition
486486 ) : BN {
487- const userCustomMargin = Math . max (
488- perpPosition ?. maxMarginRatio ?? 0 ,
489- this . getUserAccount ( ) . maxMarginRatio
490- ) ;
491487 const marginRatio = calculateMarketMarginRatio (
492488 this . driftClient . getPerpMarketAccount ( marketIndex ) ,
493489 baseAssetAmount ,
494490 'Initial' ,
495- userCustomMargin ,
491+ this . getUserAccount ( ) . maxMarginRatio ,
496492 enterHighLeverageMode || this . isHighLeverageMode ( 'Initial' )
497493 ) ;
498494
@@ -2169,10 +2165,7 @@ export class User {
21692165 ) ;
21702166 }
21712167
2172- const userCustomMargin = Math . max (
2173- perpPosition . maxMarginRatio ,
2174- this . getUserAccount ( ) . maxMarginRatio
2175- ) ;
2168+ const userCustomMargin = this . getUserAccount ( ) . maxMarginRatio ;
21762169 const marginRatio = calculateMarketMarginRatio (
21772170 market ,
21782171 baseAssetAmount . abs ( ) ,
You can’t perform that action at this time.
0 commit comments