@aurigami/sdk 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.cjs.development.js +8 -6
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +8 -6
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/interactors/MoneyMarket.ts +8 -4
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import BigNumber from 'bignumber.js';
|
|
|
4
4
|
import { BigNumber as BN, Contract } from 'ethers';
|
|
5
5
|
import * as abis from '../abis';
|
|
6
6
|
import * as consts from '../consts';
|
|
7
|
+
import { ONE_DAY } from '../consts';
|
|
7
8
|
import {
|
|
8
9
|
AuriEnv,
|
|
9
10
|
BlockchainEntity,
|
|
@@ -74,16 +75,19 @@ export class MoneyMarketRead extends BlockchainEntityRead {
|
|
|
74
75
|
|
|
75
76
|
public async getDepositAPY(): Promise<BigNumber> {
|
|
76
77
|
const supplyRatePerTimestamp = await this.auToken.supplyRatePerTimestamp();
|
|
77
|
-
|
|
78
|
-
.multipliedBy(
|
|
78
|
+
const supplyRatePerDay = new BigNumber(supplyRatePerTimestamp.toString())
|
|
79
|
+
.multipliedBy(ONE_DAY)
|
|
79
80
|
.div(helpers.decimalFactor(18));
|
|
81
|
+
|
|
82
|
+
return new BigNumber(supplyRatePerDay.plus(1)).pow(365).minus(1);
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
public async getBorrowAPY(): Promise<BigNumber> {
|
|
83
86
|
const borrowRatePerTimestamp = await this.auToken.borrowRatePerTimestamp();
|
|
84
|
-
|
|
85
|
-
.multipliedBy(
|
|
87
|
+
const borrowRatePerDay = new BigNumber(borrowRatePerTimestamp.toString())
|
|
88
|
+
.multipliedBy(ONE_DAY)
|
|
86
89
|
.div(helpers.decimalFactor(18));
|
|
90
|
+
return new BigNumber(borrowRatePerDay.plus(1)).pow(365).minus(1);
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
public async getCollateralRatio(): Promise<BigNumber> {
|