@@ -671,7 +671,7 @@ export class User {
671671 ) [ 0 ] ;
672672
673673 const perpMarket = this . driftClient . getPerpMarketAccount ( marketIndex ) ;
674- const oraclePriceData = this . getMMOracleDataForPerpMarket ( marketIndex ) ;
674+ const oraclePriceData = this . getOracleDataForPerpMarket ( marketIndex ) ;
675675 const worstCaseBaseAssetAmount = perpPosition
676676 ? calculateWorstCaseBaseAssetAmount (
677677 perpPosition ,
@@ -1447,7 +1447,7 @@ export class User {
14471447 ) [ 0 ] ;
14481448 }
14491449
1450- let valuationPrice = this . getMMOracleDataForPerpMarket (
1450+ let valuationPrice = this . getOracleDataForPerpMarket (
14511451 market . marketIndex
14521452 ) . price ;
14531453
@@ -3426,7 +3426,7 @@ export class User {
34263426 this . getEmptyPosition ( targetMarketIndex ) ;
34273427
34283428 const perpMarket = this . driftClient . getPerpMarketAccount ( targetMarketIndex ) ;
3429- const oracleData = this . getMMOracleDataForPerpMarket ( targetMarketIndex ) ;
3429+ const oracleData = this . getOracleDataForPerpMarket ( targetMarketIndex ) ;
34303430
34313431 let {
34323432 // eslint-disable-next-line prefer-const
@@ -4106,7 +4106,7 @@ export class User {
41064106 ! ! marginCategory
41074107 ) [ 0 ] || this . getEmptyPosition ( marketToIgnore ) ;
41084108
4109- const oracleData = this . getMMOracleDataForPerpMarket ( marketToIgnore ) ;
4109+ const oracleData = this . getOracleDataForPerpMarket ( marketToIgnore ) ;
41104110
41114111 let currentPerpPositionValueUSDC = ZERO ;
41124112 if ( currentPerpPosition ) {
@@ -4128,6 +4128,10 @@ export class User {
41284128 return this . driftClient . getMMOracleDataForPerpMarket ( marketIndex ) ;
41294129 }
41304130
4131+ private getOracleDataForPerpMarket ( marketIndex : number ) : OraclePriceData {
4132+ return this . driftClient . getOracleDataForPerpMarket ( marketIndex ) ;
4133+ }
4134+
41314135 private getOracleDataForSpotMarket ( marketIndex : number ) : OraclePriceData {
41324136 return this . driftClient . getOracleDataForSpotMarket ( marketIndex ) ;
41334137 }
0 commit comments