fix getAverageEntryPrice so it divides instead of multiplies (#402)

This commit is contained in:
tylersssss 2023-01-19 04:52:49 -05:00 committed by GitHub
parent 1a3d0da34a
commit 8fb231f2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1334,7 +1334,7 @@ export class PerpPosition {
} }
public getAverageEntryPrice(perpMarket: PerpMarket): I80F48 { public getAverageEntryPrice(perpMarket: PerpMarket): I80F48 {
return I80F48.fromNumber(this.avgEntryPricePerBaseLot).mul( return I80F48.fromNumber(this.avgEntryPricePerBaseLot).div(
I80F48.fromI64(perpMarket.baseLotSize), I80F48.fromI64(perpMarket.baseLotSize),
); );
} }