@curvefi/llamalend-api 2.0.14 → 2.0.16
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/lib/lendMarkets/modules/common/leverageZapV1Base.js +1 -0
- package/lib/lendMarkets/modules/common/leverageZapV2Base.js +1 -0
- package/lib/llamalend.js +0 -1
- package/package.json +1 -1
- package/src/lendMarkets/modules/common/leverageZapV1Base.ts +1 -0
- package/src/lendMarkets/modules/common/leverageZapV2Base.ts +1 -0
- package/src/llamalend.ts +0 -1
|
@@ -266,6 +266,7 @@ export class LeverageZapV1BaseModule {
|
|
|
266
266
|
}
|
|
267
267
|
const userEffectiveCollateralBN = maxBorrowableBN.gt(0) ? toBN(_userEffectiveCollateral, this.market.collateral_token.decimals) : BN(0);
|
|
268
268
|
const maxLeverageCollateralBN = toBN(_maxLeverageCollateral, this.market.collateral_token.decimals);
|
|
269
|
+
maxBorrowableBN = maxBorrowableBN.gt(0) ? maxBorrowableBN : BN(0);
|
|
269
270
|
return {
|
|
270
271
|
maxDebt: formatNumber(maxBorrowableBN.toString(), this.market.borrowed_token.decimals),
|
|
271
272
|
maxTotalCollateral: formatNumber(maxLeverageCollateralBN.plus(userEffectiveCollateralBN).toString(), this.market.collateral_token.decimals),
|
|
@@ -254,6 +254,7 @@ export class LeverageZapV2BaseModule {
|
|
|
254
254
|
}
|
|
255
255
|
const userEffectiveCollateralBN = maxBorrowableBN.gt(0) ? toBN(_userEffectiveCollateral, this.market.collateral_token.decimals) : BN(0);
|
|
256
256
|
const maxLeverageCollateralBN = toBN(_maxLeverageCollateral, this.market.collateral_token.decimals);
|
|
257
|
+
maxBorrowableBN = maxBorrowableBN.gt(0) ? maxBorrowableBN : BN(0);
|
|
257
258
|
return {
|
|
258
259
|
maxDebt: formatNumber(maxBorrowableBN.toString(), this.market.borrowed_token.decimals),
|
|
259
260
|
maxTotalCollateral: formatNumber(maxLeverageCollateralBN.plus(userEffectiveCollateralBN).toString(), this.market.collateral_token.decimals),
|
package/lib/llamalend.js
CHANGED
|
@@ -137,7 +137,6 @@ class Llamalend {
|
|
|
137
137
|
this.fetchStats = (amms_1, controllers_1, vaults_1, borrowed_tokens_1, collateral_tokens_1, ...args_1) => __awaiter(this, [amms_1, controllers_1, vaults_1, borrowed_tokens_1, collateral_tokens_1, ...args_1], void 0, function* (amms, controllers, vaults, borrowed_tokens, collateral_tokens, version = 'v1') {
|
|
138
138
|
cacheStats.clear();
|
|
139
139
|
const marketCount = controllers.length;
|
|
140
|
-
console.log(controllers.length);
|
|
141
140
|
const calls = [];
|
|
142
141
|
for (let i = 0; i < marketCount; i++) {
|
|
143
142
|
calls.push(createCall(this.contracts[controllers[i]], 'total_debt', []));
|
package/package.json
CHANGED
|
@@ -116,6 +116,7 @@ export class LeverageZapV1BaseModule {
|
|
|
116
116
|
|
|
117
117
|
const userEffectiveCollateralBN = maxBorrowableBN.gt(0) ? toBN(_userEffectiveCollateral, this.market.collateral_token.decimals) : BN(0);
|
|
118
118
|
const maxLeverageCollateralBN = toBN(_maxLeverageCollateral, this.market.collateral_token.decimals);
|
|
119
|
+
maxBorrowableBN = maxBorrowableBN.gt(0) ? maxBorrowableBN : BN(0);
|
|
119
120
|
|
|
120
121
|
return {
|
|
121
122
|
maxDebt: formatNumber(maxBorrowableBN.toString(), this.market.borrowed_token.decimals),
|
|
@@ -134,6 +134,7 @@ export class LeverageZapV2BaseModule {
|
|
|
134
134
|
|
|
135
135
|
const userEffectiveCollateralBN = maxBorrowableBN.gt(0) ? toBN(_userEffectiveCollateral, this.market.collateral_token.decimals) : BN(0);
|
|
136
136
|
const maxLeverageCollateralBN = toBN(_maxLeverageCollateral, this.market.collateral_token.decimals);
|
|
137
|
+
maxBorrowableBN = maxBorrowableBN.gt(0) ? maxBorrowableBN : BN(0);
|
|
137
138
|
|
|
138
139
|
return {
|
|
139
140
|
maxDebt: formatNumber(maxBorrowableBN.toString(), this.market.borrowed_token.decimals),
|