remove rounding in deposit and borrow function

This commit is contained in:
Tyler Shipe 2021-04-29 14:17:23 -04:00
parent 475b5cf30b
commit 2e30ca4824
1 changed files with 2 additions and 2 deletions

View File

@ -184,10 +184,10 @@ export class MarginAccount {
}
getNativeDeposit(mangoGroup: MangoGroup, tokenIndex: number): number { // insufficient precision
return Math.round(mangoGroup.indexes[tokenIndex].deposit * this.deposits[tokenIndex])
return mangoGroup.indexes[tokenIndex].deposit * this.deposits[tokenIndex]
}
getNativeBorrow(mangoGroup: MangoGroup, tokenIndex: number): number { // insufficient precision
return Math.round(mangoGroup.indexes[tokenIndex].borrow * this.borrows[tokenIndex])
return mangoGroup.indexes[tokenIndex].borrow * this.borrows[tokenIndex]
}
getUiDeposit(mangoGroup: MangoGroup, tokenIndex: number): number { // insufficient precision
return nativeToUi(this.getNativeDeposit(mangoGroup, tokenIndex), mangoGroup.mintDecimals[tokenIndex])