@gearbox-protocol/sdk 0.0.100 → 0.0.103
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/.eslintignore +4 -0
- package/.eslintrc.js +52 -0
- package/.husky/pre-push +4 -0
- package/lib/apy/convexAPY.d.ts +8 -0
- package/lib/apy/convexAPY.js +200 -0
- package/lib/apy/lidoAPY.d.ts +4 -0
- package/lib/apy/lidoAPY.js +103 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +2 -1
- package/lib/contracts/contracts.d.ts +9 -4
- package/lib/contracts/contracts.js +52 -14
- package/lib/contracts/contractsRegister.js +16 -4
- package/lib/core/constants.d.ts +7 -1
- package/lib/core/constants.js +11 -5
- package/lib/core/creditAccount.d.ts +3 -1
- package/lib/core/creditAccount.js +33 -31
- package/lib/core/creditManager.d.ts +13 -2
- package/lib/core/creditManager.js +77 -33
- package/lib/core/creditSession.js +14 -3
- package/lib/core/errors.d.ts +10 -0
- package/lib/core/errors.js +16 -1
- package/lib/core/eventOrTx.d.ts +1 -1
- package/lib/core/events.d.ts +19 -19
- package/lib/core/events.js +32 -30
- package/lib/core/multicall.d.ts +1 -1
- package/lib/core/pool.d.ts +2 -2
- package/lib/core/pool.js +8 -12
- package/lib/core/price.d.ts +2 -0
- package/lib/core/price.js +14 -0
- package/lib/core/strategy.d.ts +36 -0
- package/lib/core/strategy.js +57 -0
- package/lib/core/tokenDistributor.js +1 -1
- package/lib/core/transactions.d.ts +18 -3
- package/lib/core/transactions.js +39 -3
- package/lib/index.d.ts +8 -3
- package/lib/index.js +9 -4
- package/lib/oracles/priceFeeds.js +1 -1
- package/lib/pathfinder/convexLP.d.ts +1 -1
- package/lib/pathfinder/convexLP.js +26 -29
- package/lib/pathfinder/curveLP.d.ts +1 -1
- package/lib/pathfinder/curveLP.js +5 -7
- package/lib/pathfinder/path.d.ts +1 -1
- package/lib/pathfinder/path.js +38 -42
- package/lib/pathfinder/trade.d.ts +1 -2
- package/lib/pathfinder/tradeTypes.d.ts +5 -5
- package/lib/pathfinder/yVault.d.ts +2 -2
- package/lib/pathfinder/yVault.js +22 -19
- package/lib/payload/creditAccount.d.ts +4 -26
- package/lib/payload/creditManager.d.ts +3 -25
- package/lib/payload/pool.d.ts +2 -17
- package/lib/payload/pool.js +0 -1
- package/lib/strategies/curve.d.ts +6 -60
- package/lib/strategies/curve.js +6 -0
- package/lib/strategies/uniswapV2.js +3 -19
- package/lib/strategies/uniswapV3.js +1 -1
- package/lib/strategies/yearn.js +15 -11
- package/lib/tokens/convex.d.ts +3 -3
- package/lib/tokens/curveLP.d.ts +2 -2
- package/lib/tokens/curveLP.js +1 -1
- package/lib/tokens/gear.d.ts +2 -2
- package/lib/tokens/gear.js +1 -1
- package/lib/tokens/normal.d.ts +1 -1
- package/lib/tokens/token.js +9 -9
- package/lib/tokens/tokenData.d.ts +3 -1
- package/lib/tokens/tokenData.js +10 -8
- package/lib/tokens/yearn.d.ts +3 -3
- package/lib/utils/errors.d.ts +6 -0
- package/lib/utils/errors.js +13 -0
- package/lib/utils/formatter.d.ts +2 -1
- package/lib/utils/formatter.js +23 -15
- package/lib/utils/loading.d.ts +2 -1
- package/lib/utils/loading.js +9 -13
- package/lib/utils/mappers.d.ts +2 -1
- package/lib/utils/mappers.js +13 -5
- package/lib/utils/multicall.js +4 -3
- package/lib/utils/network.js +2 -2
- package/lib/utils/repeater.js +12 -24
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/validate.js +1 -1
- package/package.json +26 -8
- package/src/apy/convexAPY.ts +250 -0
- package/src/apy/lidoAPY.ts +89 -0
- package/src/config.ts +2 -1
- package/src/contracts/contracts.ts +73 -19
- package/src/contracts/contractsRegister.ts +19 -4
- package/src/core/constants.ts +11 -4
- package/src/core/creditAccount.ts +69 -37
- package/src/core/creditManager.ts +256 -148
- package/src/core/creditOperation.ts +7 -7
- package/src/core/creditSession.ts +25 -5
- package/src/core/errors.ts +25 -0
- package/src/core/eventOrTx.ts +8 -5
- package/src/core/events.ts +978 -911
- package/src/core/history.ts +46 -46
- package/src/core/multicall.ts +1 -1
- package/src/core/operations.ts +6 -0
- package/src/core/pool.ts +75 -58
- package/src/core/price.ts +13 -0
- package/src/core/strategy.ts +134 -0
- package/src/core/tokenDistributor.ts +2 -2
- package/src/core/transactions.ts +427 -350
- package/src/index.ts +9 -4
- package/src/oracles/priceFeeds.ts +523 -523
- package/src/pathfinder/contracts.ts +15 -13
- package/src/pathfinder/convexLP.ts +29 -25
- package/src/pathfinder/curveLP.ts +57 -53
- package/src/pathfinder/path.ts +158 -150
- package/src/pathfinder/priority.ts +11 -11
- package/src/pathfinder/trade.ts +84 -77
- package/src/pathfinder/tradeTypes.ts +98 -94
- package/src/pathfinder/yVault.ts +79 -63
- package/src/payload/creditAccount.ts +4 -26
- package/src/payload/creditManager.ts +4 -26
- package/src/payload/pool.ts +2 -19
- package/src/payload/token.ts +3 -3
- package/src/strategies/convex.ts +217 -210
- package/src/strategies/creditFacade.ts +70 -53
- package/src/strategies/curve.ts +263 -194
- package/src/strategies/lido.ts +33 -37
- package/src/strategies/uniswapV2.ts +90 -112
- package/src/strategies/uniswapV3.ts +114 -91
- package/src/strategies/yearn.ts +58 -62
- package/src/tokens/connectors.ts +6 -6
- package/src/tokens/convex.ts +297 -296
- package/src/tokens/curveLP.ts +170 -165
- package/src/tokens/gear.ts +47 -45
- package/src/tokens/normal.ts +801 -802
- package/src/tokens/token.ts +19 -10
- package/src/tokens/tokenData.ts +19 -9
- package/src/tokens/tokenType.ts +11 -11
- package/src/tokens/yearn.ts +126 -124
- package/src/utils/errors.ts +11 -0
- package/src/utils/formatter.ts +26 -18
- package/src/utils/loading.ts +14 -6
- package/src/utils/mappers.ts +15 -6
- package/src/utils/multicall.ts +6 -9
- package/src/utils/network.ts +21 -21
- package/src/utils/repeater.ts +2 -2
- package/src/utils/types.ts +6 -2
- package/src/utils/validate.ts +1 -1
- package/lib/core/adapters.d.ts +0 -15
- package/lib/core/adapters.js +0 -19
- package/lib/core/contracts.d.ts +0 -67
- package/lib/core/contracts.js +0 -254
- package/lib/core/contractsRegister.d.ts +0 -2
- package/lib/core/contractsRegister.js +0 -58
- package/lib/core/creditCard.d.ts +0 -13
- package/lib/core/creditCard.js +0 -2
- package/lib/core/oracles.d.ts +0 -38
- package/lib/core/oracles.js +0 -12
- package/lib/core/priceFeeds.d.ts +0 -3
- package/lib/core/priceFeeds.js +0 -492
- package/lib/core/protocols.d.ts +0 -13
- package/lib/core/protocols.js +0 -39
- package/lib/core/swap.d.ts +0 -4
- package/lib/core/swap.js +0 -8
- package/lib/core/trade.d.ts +0 -35
- package/lib/core/trade.js +0 -62
- package/lib/core/tradeTypes.d.ts +0 -79
- package/lib/core/tradeTypes.js +0 -21
- package/lib/utils/events.d.ts +0 -2
- package/lib/utils/events.js +0 -13
- package/src/utils/events.ts +0 -10
package/lib/core/events.js
CHANGED
|
@@ -95,9 +95,7 @@ var EventParser = /** @class */ (function () {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
EventParser.deserializeArray = function (data) {
|
|
98
|
-
return data.map(function (e) {
|
|
99
|
-
return EventParser.deserialize(e);
|
|
100
|
-
});
|
|
98
|
+
return data.map(function (e) { return EventParser.deserialize(e); });
|
|
101
99
|
};
|
|
102
100
|
return EventParser;
|
|
103
101
|
}());
|
|
@@ -218,7 +216,7 @@ var EventRepayCreditAccount = /** @class */ (function (_super) {
|
|
|
218
216
|
_this.creditManager = opts.creditManager;
|
|
219
217
|
return _this;
|
|
220
218
|
}
|
|
221
|
-
EventRepayCreditAccount.prototype.toString = function (
|
|
219
|
+
EventRepayCreditAccount.prototype.toString = function () {
|
|
222
220
|
return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": was repaid");
|
|
223
221
|
};
|
|
224
222
|
return EventRepayCreditAccount;
|
|
@@ -298,16 +296,16 @@ var EventCMNewParameters = /** @class */ (function (_super) {
|
|
|
298
296
|
msg += "max amount: ".concat((0, formatter_1.formatBN)(this.prevMaxAmount, token.decimals), " => ").concat((0, formatter_1.formatBN)(this.maxAmount, token.decimals), " ").concat(token.symbol, ", ");
|
|
299
297
|
}
|
|
300
298
|
if (this.maxLeverage !== this.prevMaxLeverage) {
|
|
301
|
-
msg += "max leverage: ".concat(this.prevMaxLeverage /
|
|
299
|
+
msg += "max leverage: ".concat(this.prevMaxLeverage / constants_1.LEVERAGE_DECIMALS + 1, " => ").concat(this.maxLeverage / constants_1.LEVERAGE_DECIMALS + 1, ", ");
|
|
302
300
|
}
|
|
303
301
|
if (this.feeInterest !== this.prevFeeInterest) {
|
|
304
|
-
msg += "interest fee: ".concat(this.prevFeeInterest /
|
|
302
|
+
msg += "interest fee: ".concat(this.prevFeeInterest / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeInterest / constants_1.PERCENTAGE_DECIMALS, "%, ");
|
|
305
303
|
}
|
|
306
304
|
if (this.feeLiquidation !== this.prevFeeLiquidation) {
|
|
307
|
-
msg += "liquidation fee: ".concat(this.prevFeeLiquidation /
|
|
305
|
+
msg += "liquidation fee: ".concat(this.prevFeeLiquidation / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeLiquidation / constants_1.PERCENTAGE_DECIMALS, "%, ");
|
|
308
306
|
}
|
|
309
307
|
if (this.liquidationDiscount !== this.prevLiquidationDiscount) {
|
|
310
|
-
msg += "liquidation premium: ".concat(
|
|
308
|
+
msg += "liquidation premium: ".concat(constants_1.PERCENTAGE_DECIMALS - this.prevLiquidationDiscount / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(constants_1.PERCENTAGE_DECIMALS - this.liquidationDiscount / constants_1.PERCENTAGE_DECIMALS, "%, ");
|
|
311
309
|
}
|
|
312
310
|
return msg.slice(0, msg.length - 2);
|
|
313
311
|
};
|
|
@@ -334,11 +332,13 @@ var EventTokenAllowed = /** @class */ (function (_super) {
|
|
|
334
332
|
var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated ");
|
|
335
333
|
switch (this.status) {
|
|
336
334
|
case "NewToken":
|
|
337
|
-
return "".concat(msg, ": New token allowed: ").concat(token.symbol, ", liquidation threshold: ").concat(this.liquidityThreshold /
|
|
335
|
+
return "".concat(msg, ": New token allowed: ").concat(token.symbol, ", liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
|
|
338
336
|
case "Allowed":
|
|
339
|
-
return "".concat(msg, ": ").concat(token.symbol, " is allowed now, liquidation threshold: ").concat(this.liquidityThreshold /
|
|
337
|
+
return "".concat(msg, ": ").concat(token.symbol, " is allowed now, liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
|
|
340
338
|
case "LTUpdated":
|
|
341
|
-
return "".concat(msg, ": ").concat(token.symbol, " liquidation threshold: ").concat((this.prevLiquidationThreshold || 0) /
|
|
339
|
+
return "".concat(msg, ": ").concat(token.symbol, " liquidation threshold: ").concat((this.prevLiquidationThreshold || 0) / constants_1.PERCENTAGE_DECIMALS, " => ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
|
|
340
|
+
default:
|
|
341
|
+
return "Error: TokenAllowedProps";
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
return EventTokenAllowed;
|
|
@@ -377,13 +377,15 @@ var EventContractAllowed = /** @class */ (function (_super) {
|
|
|
377
377
|
_this.status = opts.status;
|
|
378
378
|
return _this;
|
|
379
379
|
}
|
|
380
|
-
EventContractAllowed.prototype.toString = function (
|
|
380
|
+
EventContractAllowed.prototype.toString = function () {
|
|
381
381
|
var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated");
|
|
382
382
|
switch (this.status) {
|
|
383
383
|
case "Connected":
|
|
384
384
|
return "".concat(msg, " : ").concat((0, contractsRegister_1.getContractName)(this.protocol), " was connected. Adapter at: ").concat(this.adapter);
|
|
385
385
|
case "AdapterUpdate":
|
|
386
386
|
return "".concat(msg, " : ").concat((0, contractsRegister_1.getContractName)(this.protocol), " adapter was updated. New adapter: ").concat(this.adapter);
|
|
387
|
+
default:
|
|
388
|
+
return "Error: EventContractAllowed";
|
|
387
389
|
}
|
|
388
390
|
};
|
|
389
391
|
return EventContractAllowed;
|
|
@@ -401,7 +403,7 @@ var EventContractForbidden = /** @class */ (function (_super) {
|
|
|
401
403
|
_this.protocol = opts.protocol;
|
|
402
404
|
return _this;
|
|
403
405
|
}
|
|
404
|
-
EventContractForbidden.prototype.toString = function (
|
|
406
|
+
EventContractForbidden.prototype.toString = function () {
|
|
405
407
|
return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ").concat((0, contractsRegister_1.getContractName)(this.protocol));
|
|
406
408
|
};
|
|
407
409
|
return EventContractForbidden;
|
|
@@ -422,7 +424,7 @@ var EventNewFastCheckParameters = /** @class */ (function (_super) {
|
|
|
422
424
|
_this.prevFastCheckDelay = opts.prevFastCheckDelay;
|
|
423
425
|
return _this;
|
|
424
426
|
}
|
|
425
|
-
EventNewFastCheckParameters.prototype.toString = function (
|
|
427
|
+
EventNewFastCheckParameters.prototype.toString = function () {
|
|
426
428
|
var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ");
|
|
427
429
|
if (this.chiThreshold !== this.prevChiThreshold) {
|
|
428
430
|
msg += "Chi threshold: ".concat(this.prevChiThreshold, " => ").concat(this.chiThreshold, ", ");
|
|
@@ -447,7 +449,7 @@ var EventPriceOracleUpdated = /** @class */ (function (_super) {
|
|
|
447
449
|
_this.priceOracle = opts.priceOracle;
|
|
448
450
|
return _this;
|
|
449
451
|
}
|
|
450
|
-
EventPriceOracleUpdated.prototype.toString = function (
|
|
452
|
+
EventPriceOracleUpdated.prototype.toString = function () {
|
|
451
453
|
return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: price oracle was updated. New price oracle ").concat((0, contractsRegister_1.getContractName)(this.priceOracle));
|
|
452
454
|
};
|
|
453
455
|
return EventPriceOracleUpdated;
|
|
@@ -466,7 +468,7 @@ var EventTransferPluginAllowed = /** @class */ (function (_super) {
|
|
|
466
468
|
_this.state = opts.state;
|
|
467
469
|
return _this;
|
|
468
470
|
}
|
|
469
|
-
EventTransferPluginAllowed.prototype.toString = function (
|
|
471
|
+
EventTransferPluginAllowed.prototype.toString = function () {
|
|
470
472
|
return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: transfer plugin ").concat((0, contractsRegister_1.getContractName)(this.plugin), " was ").concat(this.state ? "allowed" : "forbidden");
|
|
471
473
|
};
|
|
472
474
|
return EventTransferPluginAllowed;
|
|
@@ -484,7 +486,7 @@ var EventNewInterestRateModel = /** @class */ (function (_super) {
|
|
|
484
486
|
_this.newInterestRateModel = opts.newInterestRateModel;
|
|
485
487
|
return _this;
|
|
486
488
|
}
|
|
487
|
-
EventNewInterestRateModel.prototype.toString = function (
|
|
489
|
+
EventNewInterestRateModel.prototype.toString = function () {
|
|
488
490
|
return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: interest rate model was updated. New model: ").concat((0, contractsRegister_1.getContractName)(this.newInterestRateModel));
|
|
489
491
|
};
|
|
490
492
|
return EventNewInterestRateModel;
|
|
@@ -502,7 +504,7 @@ var EventNewCreditManagerConnected = /** @class */ (function (_super) {
|
|
|
502
504
|
_this.creditManager = opts.creditManager;
|
|
503
505
|
return _this;
|
|
504
506
|
}
|
|
505
|
-
EventNewCreditManagerConnected.prototype.toString = function (
|
|
507
|
+
EventNewCreditManagerConnected.prototype.toString = function () {
|
|
506
508
|
return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: new credit manager ").concat((0, contractsRegister_1.getContractName)(this.creditManager), " was connected");
|
|
507
509
|
};
|
|
508
510
|
return EventNewCreditManagerConnected;
|
|
@@ -520,7 +522,7 @@ var EventBorrowForbidden = /** @class */ (function (_super) {
|
|
|
520
522
|
_this.creditManager = opts.creditManager;
|
|
521
523
|
return _this;
|
|
522
524
|
}
|
|
523
|
-
EventBorrowForbidden.prototype.toString = function (
|
|
525
|
+
EventBorrowForbidden.prototype.toString = function () {
|
|
524
526
|
return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: credit manager ").concat((0, contractsRegister_1.getContractName)(this.creditManager), " was forbidden to borrow");
|
|
525
527
|
};
|
|
526
528
|
return EventBorrowForbidden;
|
|
@@ -563,10 +565,10 @@ var EventNewWithdrawFee = /** @class */ (function (_super) {
|
|
|
563
565
|
_this.prevFee = Number(opts.oldFee);
|
|
564
566
|
return _this;
|
|
565
567
|
}
|
|
566
|
-
EventNewWithdrawFee.prototype.toString = function (
|
|
568
|
+
EventNewWithdrawFee.prototype.toString = function () {
|
|
567
569
|
return this.prevFee === 0
|
|
568
|
-
? "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was set to: ").concat(this.newFee /
|
|
569
|
-
: "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was ").concat(this.newFee > this.prevFee ? "increased" : "decreased", ": ").concat(this.prevFee /
|
|
570
|
+
? "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was set to: ").concat(this.newFee / constants_1.PERCENTAGE_DECIMALS, "%")
|
|
571
|
+
: "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was ").concat(this.newFee > this.prevFee ? "increased" : "decreased", ": ").concat(this.prevFee / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.newFee / constants_1.PERCENTAGE_DECIMALS, "%");
|
|
570
572
|
};
|
|
571
573
|
return EventNewWithdrawFee;
|
|
572
574
|
}(eventOrTx_1.EVMEvent));
|
|
@@ -602,7 +604,7 @@ var EventTakeForever = /** @class */ (function (_super) {
|
|
|
602
604
|
_this.to = opts.to;
|
|
603
605
|
return _this;
|
|
604
606
|
}
|
|
605
|
-
EventTakeForever.prototype.toString = function (
|
|
607
|
+
EventTakeForever.prototype.toString = function () {
|
|
606
608
|
return "AccountFactory: account ".concat(this.creditAccount, " was taken forever and transferred to ").concat(this.to);
|
|
607
609
|
};
|
|
608
610
|
return EventTakeForever;
|
|
@@ -619,7 +621,7 @@ var EventPaused = /** @class */ (function (_super) {
|
|
|
619
621
|
_this.contract = opts.contract;
|
|
620
622
|
return _this;
|
|
621
623
|
}
|
|
622
|
-
EventPaused.prototype.toString = function (
|
|
624
|
+
EventPaused.prototype.toString = function () {
|
|
623
625
|
return "".concat((0, contractsRegister_1.getContractName)(this.contract), " was paused");
|
|
624
626
|
};
|
|
625
627
|
return EventPaused;
|
|
@@ -636,7 +638,7 @@ var EventUnPaused = /** @class */ (function (_super) {
|
|
|
636
638
|
_this.contract = opts.contract;
|
|
637
639
|
return _this;
|
|
638
640
|
}
|
|
639
|
-
EventUnPaused.prototype.toString = function (
|
|
641
|
+
EventUnPaused.prototype.toString = function () {
|
|
640
642
|
return "".concat((0, contractsRegister_1.getContractName)(this.contract), " was unpaused");
|
|
641
643
|
};
|
|
642
644
|
return EventUnPaused;
|
|
@@ -653,7 +655,7 @@ var EventPausableAdminAdded = /** @class */ (function (_super) {
|
|
|
653
655
|
_this.admin = opts.admin;
|
|
654
656
|
return _this;
|
|
655
657
|
}
|
|
656
|
-
EventPausableAdminAdded.prototype.toString = function (
|
|
658
|
+
EventPausableAdminAdded.prototype.toString = function () {
|
|
657
659
|
return "ACL: pausable admin ".concat(this.admin, " was added");
|
|
658
660
|
};
|
|
659
661
|
return EventPausableAdminAdded;
|
|
@@ -670,7 +672,7 @@ var EventPausableAdminRemoved = /** @class */ (function (_super) {
|
|
|
670
672
|
_this.admin = opts.admin;
|
|
671
673
|
return _this;
|
|
672
674
|
}
|
|
673
|
-
EventPausableAdminRemoved.prototype.toString = function (
|
|
675
|
+
EventPausableAdminRemoved.prototype.toString = function () {
|
|
674
676
|
return "ACL: pausable admin ".concat(this.admin, " was removed");
|
|
675
677
|
};
|
|
676
678
|
return EventPausableAdminRemoved;
|
|
@@ -687,7 +689,7 @@ var EventUnPausableAdminAdded = /** @class */ (function (_super) {
|
|
|
687
689
|
_this.admin = opts.admin;
|
|
688
690
|
return _this;
|
|
689
691
|
}
|
|
690
|
-
EventUnPausableAdminAdded.prototype.toString = function (
|
|
692
|
+
EventUnPausableAdminAdded.prototype.toString = function () {
|
|
691
693
|
return "ACL: unpausable admin ".concat(this.admin, " was added");
|
|
692
694
|
};
|
|
693
695
|
return EventUnPausableAdminAdded;
|
|
@@ -704,7 +706,7 @@ var EventUnPausableAdminRemoved = /** @class */ (function (_super) {
|
|
|
704
706
|
_this.admin = opts.admin;
|
|
705
707
|
return _this;
|
|
706
708
|
}
|
|
707
|
-
EventUnPausableAdminRemoved.prototype.toString = function (
|
|
709
|
+
EventUnPausableAdminRemoved.prototype.toString = function () {
|
|
708
710
|
return "ACL: unpausable admin ".concat(this.admin, " was removed");
|
|
709
711
|
};
|
|
710
712
|
return EventUnPausableAdminRemoved;
|
|
@@ -722,7 +724,7 @@ var EventTransferOwnership = /** @class */ (function (_super) {
|
|
|
722
724
|
_this.newOwner = opts.admin;
|
|
723
725
|
return _this;
|
|
724
726
|
}
|
|
725
|
-
EventTransferOwnership.prototype.toString = function (
|
|
727
|
+
EventTransferOwnership.prototype.toString = function () {
|
|
726
728
|
return "ACL: configurator was changed to ".concat(this.newOwner);
|
|
727
729
|
};
|
|
728
730
|
return EventTransferOwnership;
|
package/lib/core/multicall.d.ts
CHANGED
package/lib/core/pool.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber, Signer } from "ethers";
|
|
2
|
-
import { IPoolService } from "../types";
|
|
3
2
|
import { PoolDataPayload } from "../payload/pool";
|
|
3
|
+
import { IPoolService } from "../types";
|
|
4
4
|
export declare class PoolData {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly address: string;
|
|
@@ -19,9 +19,9 @@ export declare class PoolData {
|
|
|
19
19
|
readonly withdrawFee: number;
|
|
20
20
|
readonly timestampLU: BigNumber;
|
|
21
21
|
readonly cumulativeIndex_RAY: BigNumber;
|
|
22
|
+
readonly isPaused: boolean;
|
|
22
23
|
constructor(payload: PoolDataPayload);
|
|
23
24
|
getContractETH(signer: Signer): IPoolService;
|
|
24
|
-
get isPaused(): boolean;
|
|
25
25
|
}
|
|
26
26
|
export interface PoolsStat {
|
|
27
27
|
tvl: number;
|
package/lib/core/pool.js
CHANGED
|
@@ -2,38 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PoolData = void 0;
|
|
4
4
|
var ethers_1 = require("ethers");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
5
|
var formatter_1 = require("../utils/formatter");
|
|
6
|
+
var types_1 = require("../types");
|
|
7
|
+
var constants_1 = require("./constants");
|
|
7
8
|
var PoolData = /** @class */ (function () {
|
|
8
9
|
function PoolData(payload) {
|
|
10
|
+
this.isPaused = false;
|
|
9
11
|
this.id = payload.addr;
|
|
10
12
|
this.address = payload.addr;
|
|
11
|
-
this.underlyingToken = payload.
|
|
13
|
+
this.underlyingToken = payload.underlying || "";
|
|
12
14
|
this.dieselToken = payload.dieselToken || "";
|
|
13
15
|
this.isWETH = payload.isWETH || false;
|
|
14
16
|
this.expectedLiquidity = ethers_1.BigNumber.from(payload.expectedLiquidity);
|
|
15
17
|
this.expectedLiquidityLimit = ethers_1.BigNumber.from(payload.expectedLiquidityLimit || 0);
|
|
16
18
|
this.availableLiquidity = ethers_1.BigNumber.from(payload.availableLiquidity);
|
|
17
19
|
this.totalBorrowed = ethers_1.BigNumber.from(payload.totalBorrowed);
|
|
18
|
-
this.depositAPY = (0, formatter_1.rayToNumber)(payload.depositAPY_RAY) *
|
|
19
|
-
this.borrowAPY = (0, formatter_1.rayToNumber)(payload.borrowAPY_RAY) *
|
|
20
|
+
this.depositAPY = (0, formatter_1.rayToNumber)(payload.depositAPY_RAY) * constants_1.PERCENTAGE_DECIMALS;
|
|
21
|
+
this.borrowAPY = (0, formatter_1.rayToNumber)(payload.borrowAPY_RAY) * constants_1.PERCENTAGE_DECIMALS;
|
|
20
22
|
this.borrowAPYRay = ethers_1.BigNumber.from(payload.borrowAPY_RAY);
|
|
21
23
|
this.dieselRate = (0, formatter_1.rayToNumber)(payload.dieselRate_RAY);
|
|
22
24
|
this.dieselRateRay = ethers_1.BigNumber.from(payload.dieselRate_RAY);
|
|
23
|
-
this.withdrawFee =
|
|
25
|
+
this.withdrawFee =
|
|
26
|
+
ethers_1.BigNumber.from(payload.withdrawFee).toNumber() / constants_1.PERCENTAGE_DECIMALS;
|
|
24
27
|
this.timestampLU = ethers_1.BigNumber.from(payload.timestampLU || 0);
|
|
25
28
|
this.cumulativeIndex_RAY = ethers_1.BigNumber.from(payload.cumulativeIndex_RAY || 0);
|
|
26
29
|
}
|
|
27
30
|
PoolData.prototype.getContractETH = function (signer) {
|
|
28
31
|
return types_1.IPoolService__factory.connect(this.address, signer);
|
|
29
32
|
};
|
|
30
|
-
Object.defineProperty(PoolData.prototype, "isPaused", {
|
|
31
|
-
get: function () {
|
|
32
|
-
return false;
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
33
|
return PoolData;
|
|
38
34
|
}());
|
|
39
35
|
exports.PoolData = PoolData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calcTotalPrice = void 0;
|
|
4
|
+
var ethers_1 = require("ethers");
|
|
5
|
+
var constants_1 = require("./constants");
|
|
6
|
+
var calcTotalPrice = function (price, amount, decimals) {
|
|
7
|
+
if (decimals === void 0) { decimals = 18; }
|
|
8
|
+
return amount
|
|
9
|
+
.mul(constants_1.WAD)
|
|
10
|
+
.mul(price)
|
|
11
|
+
.div(ethers_1.BigNumber.from(10).pow(decimals))
|
|
12
|
+
.div(constants_1.PRICE_DECIMALS);
|
|
13
|
+
};
|
|
14
|
+
exports.calcTotalPrice = calcTotalPrice;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
export interface StrategyPayload {
|
|
3
|
+
apy?: number;
|
|
4
|
+
name: string;
|
|
5
|
+
lpToken: string;
|
|
6
|
+
pools: Array<string>;
|
|
7
|
+
unleveragableCollateral: Array<string>;
|
|
8
|
+
leveragableCollateral: Array<string>;
|
|
9
|
+
baseAssets: Array<string>;
|
|
10
|
+
}
|
|
11
|
+
interface PoolStats {
|
|
12
|
+
borrowRate: number;
|
|
13
|
+
}
|
|
14
|
+
declare type PoolList = Record<string, PoolStats>;
|
|
15
|
+
interface TokenDescription {
|
|
16
|
+
price: BigNumber;
|
|
17
|
+
amount: BigNumber;
|
|
18
|
+
decimals: number | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare class Strategy {
|
|
21
|
+
apy: number | undefined;
|
|
22
|
+
name: string;
|
|
23
|
+
lpToken: string;
|
|
24
|
+
pools: Array<string>;
|
|
25
|
+
unleveragableCollateral: Array<string>;
|
|
26
|
+
leveragableCollateral: Array<string>;
|
|
27
|
+
baseAssets: Array<string>;
|
|
28
|
+
constructor(payload: StrategyPayload);
|
|
29
|
+
maxAPY(maxLeverage: number, poolApy: PoolList): number;
|
|
30
|
+
overallAPY(apy: number, leverage: number, depositCollateral: string, borrowAPY: number): number;
|
|
31
|
+
liquidationPrice(borrowed: TokenDescription, collateral: TokenDescription, lp: TokenDescription, ltCollateral: BigNumber): BigNumber;
|
|
32
|
+
private farmLev;
|
|
33
|
+
private inBaseAssets;
|
|
34
|
+
private inLeveragableAssets;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Strategy = void 0;
|
|
4
|
+
var ethers_1 = require("ethers");
|
|
5
|
+
var constants_1 = require("./constants");
|
|
6
|
+
var price_1 = require("./price");
|
|
7
|
+
var Strategy = /** @class */ (function () {
|
|
8
|
+
function Strategy(payload) {
|
|
9
|
+
this.apy = payload.apy;
|
|
10
|
+
this.name = payload.name;
|
|
11
|
+
this.lpToken = payload.lpToken;
|
|
12
|
+
this.pools = payload.pools;
|
|
13
|
+
this.unleveragableCollateral = payload.unleveragableCollateral;
|
|
14
|
+
this.leveragableCollateral = payload.leveragableCollateral;
|
|
15
|
+
this.baseAssets = payload.baseAssets;
|
|
16
|
+
}
|
|
17
|
+
Strategy.prototype.maxAPY = function (maxLeverage, poolApy) {
|
|
18
|
+
var minApy = minBorrowApy(poolApy);
|
|
19
|
+
return roi(this.apy || 0, maxLeverage, maxLeverage - constants_1.LEVERAGE_DECIMALS, minApy);
|
|
20
|
+
};
|
|
21
|
+
Strategy.prototype.overallAPY = function (apy, leverage, depositCollateral, borrowAPY) {
|
|
22
|
+
var farmLev = this.farmLev(leverage, depositCollateral);
|
|
23
|
+
return roi(apy, farmLev, leverage - constants_1.LEVERAGE_DECIMALS, borrowAPY);
|
|
24
|
+
};
|
|
25
|
+
// eslint-disable-next-line class-methods-use-this
|
|
26
|
+
Strategy.prototype.liquidationPrice = function (borrowed, collateral, lp, ltCollateral) {
|
|
27
|
+
var borrowedMoney = (0, price_1.calcTotalPrice)(borrowed.price, borrowed.amount, borrowed.decimals);
|
|
28
|
+
var collateralMoney = (0, price_1.calcTotalPrice)(collateral.price, collateral.amount, collateral.decimals)
|
|
29
|
+
.mul(ltCollateral)
|
|
30
|
+
.div(constants_1.PERCENTAGE_FACTOR);
|
|
31
|
+
var lpMoney = (0, price_1.calcTotalPrice)(lp.price, lp.amount, lp.decimals);
|
|
32
|
+
return lpMoney.gt(0)
|
|
33
|
+
? borrowedMoney.sub(collateralMoney).mul(constants_1.WAD).div(lpMoney)
|
|
34
|
+
: ethers_1.BigNumber.from(0);
|
|
35
|
+
};
|
|
36
|
+
Strategy.prototype.farmLev = function (leverage, depositCollateral) {
|
|
37
|
+
return this.inBaseAssets(depositCollateral) ||
|
|
38
|
+
this.inLeveragableAssets(depositCollateral)
|
|
39
|
+
? leverage
|
|
40
|
+
: leverage - constants_1.LEVERAGE_DECIMALS;
|
|
41
|
+
};
|
|
42
|
+
Strategy.prototype.inBaseAssets = function (depositCollateral) {
|
|
43
|
+
return this.baseAssets.some(function (c) { return c.toLowerCase() === depositCollateral.toLowerCase(); });
|
|
44
|
+
};
|
|
45
|
+
Strategy.prototype.inLeveragableAssets = function (depositCollateral) {
|
|
46
|
+
return this.leveragableCollateral.some(function (c) { return c.toLowerCase() === depositCollateral.toLowerCase(); });
|
|
47
|
+
};
|
|
48
|
+
return Strategy;
|
|
49
|
+
}());
|
|
50
|
+
exports.Strategy = Strategy;
|
|
51
|
+
function roi(apy, farmLev, debtLev, borrowAPY) {
|
|
52
|
+
return (apy * farmLev - borrowAPY * debtLev) / constants_1.LEVERAGE_DECIMALS;
|
|
53
|
+
}
|
|
54
|
+
function minBorrowApy(poolApy) {
|
|
55
|
+
var apys = Object.values(poolApy).sort(function (a, b) { return a.borrowRate - b.borrowRate; });
|
|
56
|
+
return apys.length > 0 ? apys[0].borrowRate : 0;
|
|
57
|
+
}
|
|
@@ -5,5 +5,5 @@ var VotingPower;
|
|
|
5
5
|
(function (VotingPower) {
|
|
6
6
|
VotingPower[VotingPower["A"] = 0] = "A";
|
|
7
7
|
VotingPower[VotingPower["B"] = 1] = "B";
|
|
8
|
-
VotingPower[VotingPower["ZERO_VOTING_POWER"] = 2] = "ZERO_VOTING_POWER";
|
|
8
|
+
VotingPower[VotingPower["ZERO_VOTING_POWER"] = 2] = "ZERO_VOTING_POWER"; // zero voting power & B-type vesting parameters
|
|
9
9
|
})(VotingPower = exports.VotingPower || (exports.VotingPower = {}));
|
|
@@ -2,7 +2,7 @@ import { BigNumber } from "ethers";
|
|
|
2
2
|
import { TokenData } from "../tokens/tokenData";
|
|
3
3
|
import { EVMTx, EVMTxProps } from "./eventOrTx";
|
|
4
4
|
export interface TxSerialized {
|
|
5
|
-
type: "TxAddLiquidity" | "TxRemoveLiquidity" | "TxSwap" | "TxAddCollateral" | "TxIncreaseBorrowAmount" | "TxOpenAccount" | "TxRepayAccount" | "TxCloseAccount" | "TxApprove";
|
|
5
|
+
type: "TxAddLiquidity" | "TxRemoveLiquidity" | "TxSwap" | "TxAddCollateral" | "TxIncreaseBorrowAmount" | "TxOpenAccount" | "TxRepayAccount" | "TxCloseAccount" | "TxApprove" | "TxOpenMultitokenAccount";
|
|
6
6
|
content: string;
|
|
7
7
|
}
|
|
8
8
|
export declare class TxSerializer {
|
|
@@ -97,13 +97,28 @@ export declare class TxOpenAccount extends EVMTx {
|
|
|
97
97
|
toString(tokenData: Record<string, TokenData>): string;
|
|
98
98
|
serialize(): TxSerialized;
|
|
99
99
|
}
|
|
100
|
+
interface TxOpenMultitokenAccountProps extends EVMTxProps {
|
|
101
|
+
borrowedAmount: BigNumber;
|
|
102
|
+
creditManager: string;
|
|
103
|
+
underlyingToken: string;
|
|
104
|
+
assets: Array<string>;
|
|
105
|
+
}
|
|
106
|
+
export declare class TxOpenMultitokenAccount extends EVMTx {
|
|
107
|
+
readonly borrowedAmount: BigNumber;
|
|
108
|
+
readonly creditManager: string;
|
|
109
|
+
readonly underlyingToken: string;
|
|
110
|
+
readonly assets: Array<string>;
|
|
111
|
+
constructor(opts: TxOpenMultitokenAccountProps);
|
|
112
|
+
toString(tokenData: Record<string, TokenData>): string;
|
|
113
|
+
serialize(): TxSerialized;
|
|
114
|
+
}
|
|
100
115
|
interface RepayAccountProps extends EVMTxProps {
|
|
101
116
|
creditManager: string;
|
|
102
117
|
}
|
|
103
118
|
export declare class TxRepayAccount extends EVMTx {
|
|
104
119
|
readonly creditManager: string;
|
|
105
120
|
constructor(opts: RepayAccountProps);
|
|
106
|
-
toString(
|
|
121
|
+
toString(): string;
|
|
107
122
|
serialize(): TxSerialized;
|
|
108
123
|
}
|
|
109
124
|
interface CloseAccountProps extends EVMTxProps {
|
|
@@ -112,7 +127,7 @@ interface CloseAccountProps extends EVMTxProps {
|
|
|
112
127
|
export declare class TxCloseAccount extends EVMTx {
|
|
113
128
|
readonly creditManager: string;
|
|
114
129
|
constructor(opts: CloseAccountProps);
|
|
115
|
-
toString(
|
|
130
|
+
toString(): string;
|
|
116
131
|
serialize(): TxSerialized;
|
|
117
132
|
}
|
|
118
133
|
interface ApproveProps extends EVMTxProps {
|
package/lib/core/transactions.js
CHANGED
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxOpenAccount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
|
|
18
|
+
exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxOpenMultitokenAccount = exports.TxOpenAccount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
|
|
19
19
|
var ethers_1 = require("ethers");
|
|
20
20
|
var formatter_1 = require("../utils/formatter");
|
|
21
21
|
var eventOrTx_1 = require("./eventOrTx");
|
|
@@ -49,6 +49,8 @@ var TxSerializer = /** @class */ (function () {
|
|
|
49
49
|
return new TxCloseAccount(params);
|
|
50
50
|
case "TxApprove":
|
|
51
51
|
return new TxApprove(params);
|
|
52
|
+
case "TxOpenMultitokenAccount":
|
|
53
|
+
return new TxOpenMultitokenAccount(params);
|
|
52
54
|
default:
|
|
53
55
|
throw new Error("Unknown transaction for parsing");
|
|
54
56
|
}
|
|
@@ -231,6 +233,40 @@ var TxOpenAccount = /** @class */ (function (_super) {
|
|
|
231
233
|
return TxOpenAccount;
|
|
232
234
|
}(eventOrTx_1.EVMTx));
|
|
233
235
|
exports.TxOpenAccount = TxOpenAccount;
|
|
236
|
+
var TxOpenMultitokenAccount = /** @class */ (function (_super) {
|
|
237
|
+
__extends(TxOpenMultitokenAccount, _super);
|
|
238
|
+
function TxOpenMultitokenAccount(opts) {
|
|
239
|
+
var _this = _super.call(this, {
|
|
240
|
+
block: opts.block,
|
|
241
|
+
txHash: opts.txHash,
|
|
242
|
+
txStatus: opts.txStatus,
|
|
243
|
+
timestamp: opts.timestamp
|
|
244
|
+
}) || this;
|
|
245
|
+
_this.borrowedAmount = ethers_1.BigNumber.from(opts.borrowedAmount);
|
|
246
|
+
_this.underlyingToken = opts.underlyingToken;
|
|
247
|
+
_this.creditManager = opts.creditManager;
|
|
248
|
+
_this.assets = opts.assets;
|
|
249
|
+
return _this;
|
|
250
|
+
}
|
|
251
|
+
TxOpenMultitokenAccount.prototype.toString = function (tokenData) {
|
|
252
|
+
var underlyingToken = tokenData[this.underlyingToken.toLowerCase()];
|
|
253
|
+
var assetSymbols = this.assets.reduce(function (acc, assetAddress) {
|
|
254
|
+
var token = tokenData[assetAddress.toLowerCase()];
|
|
255
|
+
if (token)
|
|
256
|
+
acc.push(token.symbol);
|
|
257
|
+
return acc;
|
|
258
|
+
}, []);
|
|
259
|
+
return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": opening. Borrowed amount: ").concat((0, formatter_1.formatBN)(this.borrowedAmount, (underlyingToken === null || underlyingToken === void 0 ? void 0 : underlyingToken.decimals) || 18), " ").concat(underlyingToken === null || underlyingToken === void 0 ? void 0 : underlyingToken.symbol, "; assets: ").concat(assetSymbols.join(", "));
|
|
260
|
+
};
|
|
261
|
+
TxOpenMultitokenAccount.prototype.serialize = function () {
|
|
262
|
+
return {
|
|
263
|
+
type: "TxOpenMultitokenAccount",
|
|
264
|
+
content: JSON.stringify(this)
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
return TxOpenMultitokenAccount;
|
|
268
|
+
}(eventOrTx_1.EVMTx));
|
|
269
|
+
exports.TxOpenMultitokenAccount = TxOpenMultitokenAccount;
|
|
234
270
|
var TxRepayAccount = /** @class */ (function (_super) {
|
|
235
271
|
__extends(TxRepayAccount, _super);
|
|
236
272
|
function TxRepayAccount(opts) {
|
|
@@ -243,7 +279,7 @@ var TxRepayAccount = /** @class */ (function (_super) {
|
|
|
243
279
|
_this.creditManager = opts.creditManager;
|
|
244
280
|
return _this;
|
|
245
281
|
}
|
|
246
|
-
TxRepayAccount.prototype.toString = function (
|
|
282
|
+
TxRepayAccount.prototype.toString = function () {
|
|
247
283
|
return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Repaying account");
|
|
248
284
|
};
|
|
249
285
|
TxRepayAccount.prototype.serialize = function () {
|
|
@@ -267,7 +303,7 @@ var TxCloseAccount = /** @class */ (function (_super) {
|
|
|
267
303
|
_this.creditManager = opts.creditManager;
|
|
268
304
|
return _this;
|
|
269
305
|
}
|
|
270
|
-
TxCloseAccount.prototype.toString = function (
|
|
306
|
+
TxCloseAccount.prototype.toString = function () {
|
|
271
307
|
return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Closing account");
|
|
272
308
|
};
|
|
273
309
|
TxCloseAccount.prototype.serialize = function () {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from "./core/constants";
|
|
2
|
+
export * from "./core/price";
|
|
2
3
|
export * from "./core/creditAccount";
|
|
3
4
|
export * from "./core/creditManager";
|
|
4
5
|
export * from "./core/creditSession";
|
|
5
6
|
export * from "./contracts/contracts";
|
|
7
|
+
export * from "./core/eventOrTx";
|
|
6
8
|
export * from "./core/events";
|
|
7
9
|
export * from "./core/errors";
|
|
8
10
|
export * from "./core/pool";
|
|
@@ -21,11 +23,10 @@ export * from "./payload/token";
|
|
|
21
23
|
export * from "./utils/formatter";
|
|
22
24
|
export * from "./utils/loading";
|
|
23
25
|
export * from "./utils/validate";
|
|
24
|
-
export * from "./utils/events";
|
|
25
26
|
export * from "./utils/math";
|
|
26
27
|
export * from "./payload/graphPayload";
|
|
27
28
|
export * from "./types/index";
|
|
28
|
-
export
|
|
29
|
+
export * from "./core/strategy";
|
|
29
30
|
export { TokenType } from "./tokens/tokenType";
|
|
30
31
|
export * from "./tokens/token";
|
|
31
32
|
export * from "./tokens/tokenData";
|
|
@@ -35,8 +36,12 @@ export * from "./tokens/curveLP";
|
|
|
35
36
|
export * from "./tokens/gear";
|
|
36
37
|
export * from "./tokens/normal";
|
|
37
38
|
export * from "./tokens/yearn";
|
|
39
|
+
export * from "./apy/lidoAPY";
|
|
40
|
+
export * from "./apy/convexAPY";
|
|
38
41
|
export * from "./core/history";
|
|
39
|
-
export
|
|
42
|
+
export * from "./utils/multicall";
|
|
43
|
+
export * from "./utils/types";
|
|
44
|
+
export * from "./utils/errors";
|
|
40
45
|
export { callRepeater } from "./utils/repeater";
|
|
41
46
|
export { getContractName } from "./contracts/contractsRegister";
|
|
42
47
|
export { AdapterInterface } from "./contracts/adapters";
|
package/lib/index.js
CHANGED
|
@@ -14,12 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SwapType = exports.keyToLowercase = exports.swapKeyValue = exports.objectEntries = exports.AdapterInterface = exports.getContractName = exports.callRepeater = exports.
|
|
17
|
+
exports.SwapType = exports.keyToLowercase = exports.swapKeyValue = exports.objectEntries = exports.AdapterInterface = exports.getContractName = exports.callRepeater = exports.TokenType = void 0;
|
|
18
18
|
__exportStar(require("./core/constants"), exports);
|
|
19
|
+
__exportStar(require("./core/price"), exports);
|
|
19
20
|
__exportStar(require("./core/creditAccount"), exports);
|
|
20
21
|
__exportStar(require("./core/creditManager"), exports);
|
|
21
22
|
__exportStar(require("./core/creditSession"), exports);
|
|
22
23
|
__exportStar(require("./contracts/contracts"), exports);
|
|
24
|
+
__exportStar(require("./core/eventOrTx"), exports);
|
|
23
25
|
__exportStar(require("./core/events"), exports);
|
|
24
26
|
__exportStar(require("./core/errors"), exports);
|
|
25
27
|
__exportStar(require("./core/pool"), exports);
|
|
@@ -38,10 +40,10 @@ __exportStar(require("./payload/token"), exports);
|
|
|
38
40
|
__exportStar(require("./utils/formatter"), exports);
|
|
39
41
|
__exportStar(require("./utils/loading"), exports);
|
|
40
42
|
__exportStar(require("./utils/validate"), exports);
|
|
41
|
-
__exportStar(require("./utils/events"), exports);
|
|
42
43
|
__exportStar(require("./utils/math"), exports);
|
|
43
44
|
__exportStar(require("./payload/graphPayload"), exports);
|
|
44
45
|
__exportStar(require("./types/index"), exports);
|
|
46
|
+
__exportStar(require("./core/strategy"), exports);
|
|
45
47
|
// Tokens
|
|
46
48
|
var tokenType_1 = require("./tokens/tokenType");
|
|
47
49
|
Object.defineProperty(exports, "TokenType", { enumerable: true, get: function () { return tokenType_1.TokenType; } });
|
|
@@ -53,9 +55,12 @@ __exportStar(require("./tokens/curveLP"), exports);
|
|
|
53
55
|
__exportStar(require("./tokens/gear"), exports);
|
|
54
56
|
__exportStar(require("./tokens/normal"), exports);
|
|
55
57
|
__exportStar(require("./tokens/yearn"), exports);
|
|
58
|
+
__exportStar(require("./apy/lidoAPY"), exports);
|
|
59
|
+
__exportStar(require("./apy/convexAPY"), exports);
|
|
56
60
|
__exportStar(require("./core/history"), exports);
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
__exportStar(require("./utils/multicall"), exports);
|
|
62
|
+
__exportStar(require("./utils/types"), exports);
|
|
63
|
+
__exportStar(require("./utils/errors"), exports);
|
|
59
64
|
var repeater_1 = require("./utils/repeater");
|
|
60
65
|
Object.defineProperty(exports, "callRepeater", { enumerable: true, get: function () { return repeater_1.callRepeater; } });
|
|
61
66
|
var contractsRegister_1 = require("./contracts/contractsRegister");
|