@curvefi/llamalend-api 2.2.3 → 2.2.4
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.
|
@@ -15,7 +15,7 @@ import { WEEK } from "../../../constants/utils";
|
|
|
15
15
|
export class VaultModule {
|
|
16
16
|
constructor(market) {
|
|
17
17
|
this._calcCrvApr = (...args_1) => __awaiter(this, [...args_1], void 0, function* (futureWorkingSupplyBN = null) {
|
|
18
|
-
const totalLiquidityUSD = yield this.vaultTotalLiquidity();
|
|
18
|
+
const totalLiquidityUSD = yield this.vaultTotalLiquidity(false);
|
|
19
19
|
if (Number(totalLiquidityUSD) === 0)
|
|
20
20
|
return [0, 0];
|
|
21
21
|
let inflationRateBN, workingSupplyBN, totalSupplyBN;
|
|
@@ -415,7 +415,7 @@ export class VaultModule {
|
|
|
415
415
|
}
|
|
416
416
|
vaultTotalLiquidity() {
|
|
417
417
|
return __awaiter(this, arguments, void 0, function* (useAPI = true) {
|
|
418
|
-
const { totalAssets } = yield this.market.stats.capAndAvailable(
|
|
418
|
+
const { totalAssets } = yield this.market.stats.capAndAvailable(false, useAPI);
|
|
419
419
|
const price = yield _getUsdRate.call(this.llamalend, this.market.addresses.borrowed_token);
|
|
420
420
|
return BN(totalAssets).times(price).toFixed(6);
|
|
421
421
|
});
|
package/package.json
CHANGED
|
@@ -289,14 +289,15 @@ export class VaultModule {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
public async vaultTotalLiquidity(useAPI = true): Promise<string> {
|
|
292
|
-
const { totalAssets } = await this.market.stats.capAndAvailable(
|
|
292
|
+
const { totalAssets } = await this.market.stats.capAndAvailable(false, useAPI);
|
|
293
293
|
const price = await _getUsdRate.call(this.llamalend, this.market.addresses.borrowed_token);
|
|
294
294
|
|
|
295
295
|
return BN(totalAssets).times(price).toFixed(6)
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
private _calcCrvApr = async (futureWorkingSupplyBN: BigNumber | null = null): Promise<[baseApy: number, boostedApy: number]> => {
|
|
299
|
-
const totalLiquidityUSD = await this.vaultTotalLiquidity();
|
|
299
|
+
const totalLiquidityUSD = await this.vaultTotalLiquidity(false);
|
|
300
|
+
|
|
300
301
|
if (Number(totalLiquidityUSD) === 0) return [0, 0];
|
|
301
302
|
|
|
302
303
|
let inflationRateBN, workingSupplyBN, totalSupplyBN;
|