added utility functions to MangoGroup

This commit is contained in:
dd 2021-02-14 10:53:19 -05:00
parent f5cb53ff2c
commit a00feb1d94
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ export class MangoGroup {
getDepositRate(tokenIndex: number): number {
return 0.0 // TODO
}
getUiTotalDeposit(tokenIndex: number): number {
return nativeToUi(this.totalDeposits[tokenIndex] * this.indexes[tokenIndex].deposit, this.mintDecimals[tokenIndex])
}
getUiTotalBorrow(tokenIndex: number): number {
return nativeToUi(this.totalBorrows[tokenIndex] * this.indexes[tokenIndex].borrow, this.mintDecimals[tokenIndex])
}
}
export class MarginAccount {