@aurigami/sdk 1.12.9 → 1.13.1

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.esm.js CHANGED
@@ -22,6 +22,7 @@ export { default as MAINNET_ADDRESSES } from '@aurigami/contracts/deployments/au
22
22
  export { default as TESTNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_testnet.json';
23
23
  import axios from 'axios';
24
24
  import { Signer } from '@ethersproject/abstract-signer';
25
+ import { __decorate, __metadata } from 'tslib';
25
26
 
26
27
 
27
28
 
@@ -191,6 +192,7 @@ var REFERRAL_CAMPAIGNS = /*#__PURE__*/Object.fromEntries([['referral-2505', {
191
192
  start: 1654696800,
192
193
  end: 1655301599
193
194
  }]]);
195
+ var CACHE_TIMEOUT = 10 * 1000; // 10 seconds
194
196
 
195
197
  var decimalRecords = {
196
198
  '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
@@ -1279,6 +1281,9 @@ function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
1279
1281
 
1280
1282
  return rewardsValue.multipliedBy(frequencyPerYear).dividedBy(totalStakeValue);
1281
1283
  }
1284
+ function calcNetApy(suppliedValue, supplyApy, borrowedValue, borrowApy) {
1285
+ return suppliedValue.multipliedBy(supplyApy).minus(borrowedValue.multipliedBy(borrowApy));
1286
+ }
1282
1287
  function getBlockTimestamp(_x2, _x3) {
1283
1288
  return _getBlockTimestamp.apply(this, arguments);
1284
1289
  }
@@ -1530,6 +1535,36 @@ function sortEvents(events) {
1530
1535
  return a.blockNumber - b.blockNumber;
1531
1536
  });
1532
1537
  }
1538
+ function Cache(cacheTimeout) {
1539
+ return function (target, propertyKey, descriptor) {
1540
+ var originalMethod = descriptor.value;
1541
+ var cache = new Map();
1542
+
1543
+ descriptor.value = function () {
1544
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1545
+ args[_key2] = arguments[_key2];
1546
+ }
1547
+
1548
+ var key = JSON.stringify(args);
1549
+
1550
+ if (cache.has(key)) {
1551
+ var _cache$get = cache.get(key),
1552
+ timestamp = _cache$get[0],
1553
+ value = _cache$get[1];
1554
+
1555
+ if (Date.now() - timestamp < cacheTimeout) {
1556
+ return value;
1557
+ }
1558
+ }
1559
+
1560
+ var result = originalMethod.apply(this, args);
1561
+ cache.set(key, [Date.now(), result]);
1562
+ return result;
1563
+ };
1564
+
1565
+ return descriptor;
1566
+ };
1567
+ }
1533
1568
 
1534
1569
  var BlockchainEntityRead = function BlockchainEntityRead(networkConnection) {
1535
1570
  this._networkConnection = networkConnection;
@@ -2040,31 +2075,31 @@ function fetchLPPositions(_x5, _x6) {
2040
2075
 
2041
2076
  function _fetchLPPositions() {
2042
2077
  _fetchLPPositions = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(LPAddress, provider) {
2043
- var LPContract, promises, values;
2078
+ var LPContract, _yield$Promise$all, token0, token1, reserves, totalSupply;
2079
+
2044
2080
  return runtime_1.wrap(function _callee5$(_context5) {
2045
2081
  while (1) {
2046
2082
  switch (_context5.prev = _context5.next) {
2047
2083
  case 0:
2048
2084
  LPContract = new Contract(LPAddress, IUniswapV2PairABI.abi, provider);
2049
- promises = [];
2050
- promises.push(LPContract.token0());
2051
- promises.push(LPContract.token1());
2052
- promises.push(LPContract.getReserves());
2053
- promises.push(LPContract.totalSupply());
2054
- _context5.next = 8;
2055
- return Promise.all(promises);
2085
+ _context5.next = 3;
2086
+ return Promise.all([LPContract.token0(), LPContract.token1(), LPContract.getReserves(), LPContract.totalSupply()]);
2056
2087
 
2057
- case 8:
2058
- values = _context5.sent;
2088
+ case 3:
2089
+ _yield$Promise$all = _context5.sent;
2090
+ token0 = _yield$Promise$all[0];
2091
+ token1 = _yield$Promise$all[1];
2092
+ reserves = _yield$Promise$all[2];
2093
+ totalSupply = _yield$Promise$all[3];
2059
2094
  return _context5.abrupt("return", {
2060
- token0: values[0],
2061
- token1: values[1],
2062
- reserve0: values[2].reserve0,
2063
- reserve1: values[2].reserve1,
2064
- totalSupply: values[3]
2095
+ token0: token0,
2096
+ token1: token1,
2097
+ reserve0: reserves.reserve0,
2098
+ reserve1: reserves.reserve1,
2099
+ totalSupply: totalSupply
2065
2100
  });
2066
2101
 
2067
- case 10:
2102
+ case 9:
2068
2103
  case "end":
2069
2104
  return _context5.stop();
2070
2105
  }
@@ -2187,7 +2222,7 @@ function fetchStNEARPrice() {
2187
2222
 
2188
2223
  function _fetchStNEARPrice() {
2189
2224
  _fetchStNEARPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
2190
- var ratioPromise, nearPricePromise, _yield$Promise$all, ratioRes, nearPrice, ratio;
2225
+ var ratioPromise, nearPricePromise, _yield$Promise$all2, ratioRes, nearPrice, ratio;
2191
2226
 
2192
2227
  return runtime_1.wrap(function _callee8$(_context8) {
2193
2228
  while (1) {
@@ -2201,9 +2236,9 @@ function _fetchStNEARPrice() {
2201
2236
  return Promise.all([ratioPromise, nearPricePromise]);
2202
2237
 
2203
2238
  case 4:
2204
- _yield$Promise$all = _context8.sent;
2205
- ratioRes = _yield$Promise$all[0];
2206
- nearPrice = _yield$Promise$all[1];
2239
+ _yield$Promise$all2 = _context8.sent;
2240
+ ratioRes = _yield$Promise$all2[0];
2241
+ nearPrice = _yield$Promise$all2[1];
2207
2242
  ratio = new BigNumber(ratioRes.st_near_price);
2208
2243
  return _context8.abrupt("return", ratio.multipliedBy(nearPrice));
2209
2244
 
@@ -3056,12 +3091,14 @@ var helpers = {
3056
3091
  getSymbol: getSymbol,
3057
3092
  getUnderlying: getUnderlying,
3058
3093
  calcLMRewardApr: calcLMRewardApr,
3094
+ calcNetApy: calcNetApy,
3059
3095
  getBlockTimestamp: getBlockTimestamp,
3060
3096
  getBlocksTimestampViaRPC: getBlocksTimestampViaRPC,
3061
3097
  getBlocksTimestamp: getBlocksTimestamp,
3062
3098
  getBlockBeforeTimestamp: getBlockBeforeTimestamp,
3063
3099
  devLog: devLog,
3064
3100
  sortEvents: sortEvents,
3101
+ Cache: Cache,
3065
3102
  fetchPriceFromDefiLlamaAPI: fetchPriceFromDefiLlamaAPI,
3066
3103
  fetchPriceFromCoingeckoAPI: fetchPriceFromCoingeckoAPI,
3067
3104
  fetchPriceFromDefiLlama: fetchPriceFromDefiLlama,
@@ -3276,26 +3313,72 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3276
3313
 
3277
3314
  var _proto = MoneyMarketRead.prototype;
3278
3315
 
3279
- _proto.getRewardSpeeds = /*#__PURE__*/function () {
3280
- var _getRewardSpeeds = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3281
- var speeds;
3316
+ _proto.getUnderlyingPrice = /*#__PURE__*/function () {
3317
+ var _getUnderlyingPrice = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3282
3318
  return runtime_1.wrap(function _callee$(_context) {
3283
3319
  while (1) {
3284
3320
  switch (_context.prev = _context.next) {
3285
3321
  case 0:
3286
- _context.next = 2;
3322
+ return _context.abrupt("return", fetchPrice(this.underlying.address, this._networkConnection.provider));
3323
+
3324
+ case 1:
3325
+ case "end":
3326
+ return _context.stop();
3327
+ }
3328
+ }
3329
+ }, _callee, this);
3330
+ }));
3331
+
3332
+ function getUnderlyingPrice() {
3333
+ return _getUnderlyingPrice.apply(this, arguments);
3334
+ }
3335
+
3336
+ return getUnderlyingPrice;
3337
+ }();
3338
+
3339
+ _proto.getPlyPrice = /*#__PURE__*/function () {
3340
+ var _getPlyPrice = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
3341
+ return runtime_1.wrap(function _callee2$(_context2) {
3342
+ while (1) {
3343
+ switch (_context2.prev = _context2.next) {
3344
+ case 0:
3345
+ return _context2.abrupt("return", fetchPrice(networkAddresses.tokens.PLY, this._networkConnection.provider));
3346
+
3347
+ case 1:
3348
+ case "end":
3349
+ return _context2.stop();
3350
+ }
3351
+ }
3352
+ }, _callee2, this);
3353
+ }));
3354
+
3355
+ function getPlyPrice() {
3356
+ return _getPlyPrice.apply(this, arguments);
3357
+ }
3358
+
3359
+ return getPlyPrice;
3360
+ }();
3361
+
3362
+ _proto.getRewardSpeeds = /*#__PURE__*/function () {
3363
+ var _getRewardSpeeds = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
3364
+ var speeds;
3365
+ return runtime_1.wrap(function _callee3$(_context3) {
3366
+ while (1) {
3367
+ switch (_context3.prev = _context3.next) {
3368
+ case 0:
3369
+ _context3.next = 2;
3287
3370
  return this.env.auriLens.getRewardSpeeds(this.env.comptroller.address, this.auToken.address);
3288
3371
 
3289
3372
  case 2:
3290
- speeds = _context.sent;
3291
- return _context.abrupt("return", speeds);
3373
+ speeds = _context3.sent;
3374
+ return _context3.abrupt("return", speeds);
3292
3375
 
3293
3376
  case 4:
3294
3377
  case "end":
3295
- return _context.stop();
3378
+ return _context3.stop();
3296
3379
  }
3297
3380
  }
3298
- }, _callee, this);
3381
+ }, _callee3, this);
3299
3382
  }));
3300
3383
 
3301
3384
  function getRewardSpeeds() {
@@ -3306,26 +3389,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3306
3389
  }();
3307
3390
 
3308
3391
  _proto.getTotalTokenBorrowed = /*#__PURE__*/function () {
3309
- var _getTotalTokenBorrowed = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
3310
- return runtime_1.wrap(function _callee2$(_context2) {
3392
+ var _getTotalTokenBorrowed = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
3393
+ return runtime_1.wrap(function _callee4$(_context4) {
3311
3394
  while (1) {
3312
- switch (_context2.prev = _context2.next) {
3395
+ switch (_context4.prev = _context4.next) {
3313
3396
  case 0:
3314
- _context2.t0 = TokenAmount;
3315
- _context2.t1 = this.underlying;
3316
- _context2.next = 4;
3397
+ _context4.t0 = TokenAmount;
3398
+ _context4.t1 = this.underlying;
3399
+ _context4.next = 4;
3317
3400
  return this.auToken.totalBorrows();
3318
3401
 
3319
3402
  case 4:
3320
- _context2.t2 = _context2.sent.toString();
3321
- return _context2.abrupt("return", new _context2.t0(_context2.t1, _context2.t2));
3403
+ _context4.t2 = _context4.sent.toString();
3404
+ return _context4.abrupt("return", new _context4.t0(_context4.t1, _context4.t2));
3322
3405
 
3323
3406
  case 6:
3324
3407
  case "end":
3325
- return _context2.stop();
3408
+ return _context4.stop();
3326
3409
  }
3327
3410
  }
3328
- }, _callee2, this);
3411
+ }, _callee4, this);
3329
3412
  }));
3330
3413
 
3331
3414
  function getTotalTokenBorrowed() {
@@ -3336,33 +3419,28 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3336
3419
  }();
3337
3420
 
3338
3421
  _proto.getTotalTokenDeposited = /*#__PURE__*/function () {
3339
- var _getTotalTokenDeposited = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
3340
- var _this2 = this;
3422
+ var _getTotalTokenDeposited = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3423
+ var _yield$Promise$all, totalBorrow, totalCash;
3341
3424
 
3342
- var promises, totalBorrow, totalCash;
3343
- return runtime_1.wrap(function _callee3$(_context3) {
3425
+ return runtime_1.wrap(function _callee5$(_context5) {
3344
3426
  while (1) {
3345
- switch (_context3.prev = _context3.next) {
3427
+ switch (_context5.prev = _context5.next) {
3346
3428
  case 0:
3347
- promises = [];
3348
- promises.push(this.getTotalTokenBorrowed().then(function (res) {
3349
- totalBorrow = res;
3350
- }));
3351
- promises.push(this.auToken.getCash().then(function (res) {
3352
- totalCash = new TokenAmount(_this2.underlying, res.toString());
3353
- }));
3354
- _context3.next = 5;
3355
- return Promise.all(promises);
3429
+ _context5.next = 2;
3430
+ return Promise.all([this.getTotalTokenBorrowed(), this.auToken.getCash()]);
3356
3431
 
3357
- case 5:
3358
- return _context3.abrupt("return", new TokenAmount(this.underlying, BigNumber$1.from(totalCash.rawAmount()).add(totalBorrow.rawAmount()).toString()));
3432
+ case 2:
3433
+ _yield$Promise$all = _context5.sent;
3434
+ totalBorrow = _yield$Promise$all[0];
3435
+ totalCash = _yield$Promise$all[1];
3436
+ return _context5.abrupt("return", new TokenAmount(this.underlying, BigNumber$1.from(new TokenAmount(this.underlying, totalCash.toString()).rawAmount()).add(totalBorrow.rawAmount()).toString()));
3359
3437
 
3360
3438
  case 6:
3361
3439
  case "end":
3362
- return _context3.stop();
3440
+ return _context5.stop();
3363
3441
  }
3364
3442
  }
3365
- }, _callee3, this);
3443
+ }, _callee5, this);
3366
3444
  }));
3367
3445
 
3368
3446
  function getTotalTokenDeposited() {
@@ -3373,26 +3451,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3373
3451
  }();
3374
3452
 
3375
3453
  _proto.getDepositAPY = /*#__PURE__*/function () {
3376
- var _getDepositAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
3454
+ var _getDepositAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
3377
3455
  var supplyRatePerTimestamp, supplyRatePerDay;
3378
- return runtime_1.wrap(function _callee4$(_context4) {
3456
+ return runtime_1.wrap(function _callee6$(_context6) {
3379
3457
  while (1) {
3380
- switch (_context4.prev = _context4.next) {
3458
+ switch (_context6.prev = _context6.next) {
3381
3459
  case 0:
3382
- _context4.next = 2;
3460
+ _context6.next = 2;
3383
3461
  return this.auToken.supplyRatePerTimestamp();
3384
3462
 
3385
3463
  case 2:
3386
- supplyRatePerTimestamp = _context4.sent;
3464
+ supplyRatePerTimestamp = _context6.sent;
3387
3465
  supplyRatePerDay = new BigNumber(supplyRatePerTimestamp.toString()).multipliedBy(ONE_DAY).div(decimalFactor(18));
3388
- return _context4.abrupt("return", new BigNumber(supplyRatePerDay.plus(1)).pow(365).minus(1));
3466
+ return _context6.abrupt("return", new BigNumber(supplyRatePerDay.plus(1)).pow(365).minus(1));
3389
3467
 
3390
3468
  case 5:
3391
3469
  case "end":
3392
- return _context4.stop();
3470
+ return _context6.stop();
3393
3471
  }
3394
3472
  }
3395
- }, _callee4, this);
3473
+ }, _callee6, this);
3396
3474
  }));
3397
3475
 
3398
3476
  function getDepositAPY() {
@@ -3403,26 +3481,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3403
3481
  }();
3404
3482
 
3405
3483
  _proto.getBorrowAPY = /*#__PURE__*/function () {
3406
- var _getBorrowAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3484
+ var _getBorrowAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
3407
3485
  var borrowRatePerTimestamp, borrowRatePerDay;
3408
- return runtime_1.wrap(function _callee5$(_context5) {
3486
+ return runtime_1.wrap(function _callee7$(_context7) {
3409
3487
  while (1) {
3410
- switch (_context5.prev = _context5.next) {
3488
+ switch (_context7.prev = _context7.next) {
3411
3489
  case 0:
3412
- _context5.next = 2;
3490
+ _context7.next = 2;
3413
3491
  return this.auToken.borrowRatePerTimestamp();
3414
3492
 
3415
3493
  case 2:
3416
- borrowRatePerTimestamp = _context5.sent;
3494
+ borrowRatePerTimestamp = _context7.sent;
3417
3495
  borrowRatePerDay = new BigNumber(borrowRatePerTimestamp.toString()).multipliedBy(ONE_DAY).div(decimalFactor(18));
3418
- return _context5.abrupt("return", new BigNumber(borrowRatePerDay.plus(1)).pow(365).minus(1));
3496
+ return _context7.abrupt("return", new BigNumber(borrowRatePerDay.plus(1)).pow(365).minus(1));
3419
3497
 
3420
3498
  case 5:
3421
3499
  case "end":
3422
- return _context5.stop();
3500
+ return _context7.stop();
3423
3501
  }
3424
3502
  }
3425
- }, _callee5, this);
3503
+ }, _callee7, this);
3426
3504
  }));
3427
3505
 
3428
3506
  function getBorrowAPY() {
@@ -3433,21 +3511,21 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3433
3511
  }();
3434
3512
 
3435
3513
  _proto.getCollateralRatio = /*#__PURE__*/function () {
3436
- var _getCollateralRatio = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
3437
- return runtime_1.wrap(function _callee6$(_context6) {
3514
+ var _getCollateralRatio = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
3515
+ return runtime_1.wrap(function _callee8$(_context8) {
3438
3516
  while (1) {
3439
- switch (_context6.prev = _context6.next) {
3517
+ switch (_context8.prev = _context8.next) {
3440
3518
  case 0:
3441
- return _context6.abrupt("return", this.env.comptroller.markets(this.auToken.address).then(function (res) {
3519
+ return _context8.abrupt("return", this.env.comptroller.markets(this.auToken.address).then(function (res) {
3442
3520
  return new BigNumber(res.collateralFactorMantissa.toString()).div(decimalFactor(18));
3443
3521
  }));
3444
3522
 
3445
3523
  case 1:
3446
3524
  case "end":
3447
- return _context6.stop();
3525
+ return _context8.stop();
3448
3526
  }
3449
3527
  }
3450
- }, _callee6, this);
3528
+ }, _callee8, this);
3451
3529
  }));
3452
3530
 
3453
3531
  function getCollateralRatio() {
@@ -3458,37 +3536,30 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3458
3536
  }();
3459
3537
 
3460
3538
  _proto.getBorrowPlyAPY = /*#__PURE__*/function () {
3461
- var _getBorrowPlyAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
3462
- var promises, totalBorrowed, rewardSpeed, plyPrice, underlyingPrice;
3463
- return runtime_1.wrap(function _callee7$(_context7) {
3539
+ var _getBorrowPlyAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
3540
+ var _yield$Promise$all2, totalBorrowed, rewardSpeeds, plyPrice, underlyingPrice;
3541
+
3542
+ return runtime_1.wrap(function _callee9$(_context9) {
3464
3543
  while (1) {
3465
- switch (_context7.prev = _context7.next) {
3544
+ switch (_context9.prev = _context9.next) {
3466
3545
  case 0:
3467
- promises = [];
3468
- promises.push(this.getTotalTokenBorrowed().then(function (res) {
3469
- totalBorrowed = res;
3470
- }));
3471
- promises.push(this.env.comptroller.rewardSpeeds(ComptrollerRewardType.PLY, this.auToken.address, false).then(function (res) {
3472
- rewardSpeed = new TokenAmount(PLYToken, res.toString());
3473
- }));
3474
- promises.push(fetchPrice(networkAddresses.tokens.PLY, this._networkConnection.provider).then(function (res) {
3475
- plyPrice = res;
3476
- }));
3477
- promises.push(fetchPrice(this.underlying.address, this._networkConnection.provider).then(function (res) {
3478
- underlyingPrice = res;
3479
- }));
3480
- _context7.next = 7;
3481
- return Promise.all(promises);
3546
+ _context9.next = 2;
3547
+ return Promise.all([this.getTotalTokenBorrowed(), this.getRewardSpeeds(), this.getPlyPrice(), this.getUnderlyingPrice()]);
3482
3548
 
3483
- case 7:
3484
- return _context7.abrupt("return", calcLMRewardApr(plyPrice.multipliedBy(rewardSpeed.formattedAmount()), underlyingPrice.multipliedBy(totalBorrowed.formattedAmount()), ONE_YEAR));
3549
+ case 2:
3550
+ _yield$Promise$all2 = _context9.sent;
3551
+ totalBorrowed = _yield$Promise$all2[0];
3552
+ rewardSpeeds = _yield$Promise$all2[1];
3553
+ plyPrice = _yield$Promise$all2[2];
3554
+ underlyingPrice = _yield$Promise$all2[3];
3555
+ return _context9.abrupt("return", calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalBorrowed.formattedAmount()), ONE_YEAR));
3485
3556
 
3486
3557
  case 8:
3487
3558
  case "end":
3488
- return _context7.stop();
3559
+ return _context9.stop();
3489
3560
  }
3490
3561
  }
3491
- }, _callee7, this);
3562
+ }, _callee9, this);
3492
3563
  }));
3493
3564
 
3494
3565
  function getBorrowPlyAPY() {
@@ -3499,37 +3570,30 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3499
3570
  }();
3500
3571
 
3501
3572
  _proto.getDepositPlyAPY = /*#__PURE__*/function () {
3502
- var _getDepositPlyAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
3503
- var promises, totalDeposited, rewardSpeed, plyPrice, underlyingPrice;
3504
- return runtime_1.wrap(function _callee8$(_context8) {
3573
+ var _getDepositPlyAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
3574
+ var _yield$Promise$all3, totalDeposited, rewardSpeeds, plyPrice, underlyingPrice;
3575
+
3576
+ return runtime_1.wrap(function _callee10$(_context10) {
3505
3577
  while (1) {
3506
- switch (_context8.prev = _context8.next) {
3578
+ switch (_context10.prev = _context10.next) {
3507
3579
  case 0:
3508
- promises = [];
3509
- promises.push(this.getTotalTokenDeposited().then(function (res) {
3510
- totalDeposited = res;
3511
- }));
3512
- promises.push(this.env.comptroller.rewardSpeeds(ComptrollerRewardType.PLY, this.auToken.address, true).then(function (res) {
3513
- rewardSpeed = new TokenAmount(PLYToken, res.toString());
3514
- }));
3515
- promises.push(fetchPrice(networkAddresses.tokens.PLY, this._networkConnection.provider).then(function (res) {
3516
- plyPrice = res;
3517
- }));
3518
- promises.push(fetchPrice(this.underlying.address, this._networkConnection.provider).then(function (res) {
3519
- underlyingPrice = res;
3520
- }));
3521
- _context8.next = 7;
3522
- return Promise.all(promises);
3580
+ _context10.next = 2;
3581
+ return Promise.all([this.getTotalTokenDeposited(), this.getRewardSpeeds(), this.getPlyPrice(), this.getUnderlyingPrice()]);
3523
3582
 
3524
- case 7:
3525
- return _context8.abrupt("return", calcLMRewardApr(plyPrice.multipliedBy(rewardSpeed.formattedAmount()), underlyingPrice.multipliedBy(totalDeposited.formattedAmount()), ONE_YEAR));
3583
+ case 2:
3584
+ _yield$Promise$all3 = _context10.sent;
3585
+ totalDeposited = _yield$Promise$all3[0];
3586
+ rewardSpeeds = _yield$Promise$all3[1];
3587
+ plyPrice = _yield$Promise$all3[2];
3588
+ underlyingPrice = _yield$Promise$all3[3];
3589
+ return _context10.abrupt("return", calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardSupplySpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalDeposited.formattedAmount()), ONE_YEAR));
3526
3590
 
3527
3591
  case 8:
3528
3592
  case "end":
3529
- return _context8.stop();
3593
+ return _context10.stop();
3530
3594
  }
3531
3595
  }
3532
- }, _callee8, this);
3596
+ }, _callee10, this);
3533
3597
  }));
3534
3598
 
3535
3599
  function getDepositPlyAPY() {
@@ -3539,103 +3603,190 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3539
3603
  return getDepositPlyAPY;
3540
3604
  }();
3541
3605
 
3542
- _proto.getDetails = /*#__PURE__*/function () {
3543
- var _getDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
3544
- var promises, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, plyPrice, underlyingPrice, rewardSpeeds, borrowPlyApy, depositPlyApy, depositNEARApy, borrowNEARApy, depositMETAApy;
3545
- return runtime_1.wrap(function _callee9$(_context9) {
3606
+ _proto.getDepositNearAPY = /*#__PURE__*/function () {
3607
+ var _getDepositNearAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
3608
+ var _yield$Promise$all4, totalDeposited, underlyingPrice, depositNEARApy;
3609
+
3610
+ return runtime_1.wrap(function _callee11$(_context11) {
3546
3611
  while (1) {
3547
- switch (_context9.prev = _context9.next) {
3612
+ switch (_context11.prev = _context11.next) {
3548
3613
  case 0:
3549
- promises = [];
3550
- promises.push(this.getTotalTokenDeposited().then(function (res) {
3551
- totalDeposited = res;
3552
- }));
3553
- promises.push(this.getTotalTokenBorrowed().then(function (res) {
3554
- totalBorrowed = res;
3555
- }));
3556
- promises.push(this.getDepositAPY().then(function (res) {
3557
- depositAPY = res.toNumber();
3558
- }));
3559
- promises.push(this.getBorrowAPY().then(function (res) {
3560
- borrowAPY = res.toNumber();
3561
- }));
3562
- promises.push(this.getCollateralRatio().then(function (res) {
3563
- collateralRatio = res.toNumber();
3564
- }));
3565
- promises.push(this.getRewardSpeeds().then(function (res) {
3566
- rewardSpeeds = res;
3567
- }));
3568
- promises.push(fetchPrice(networkAddresses.tokens.PLY, this._networkConnection.provider).then(function (res) {
3569
- plyPrice = res;
3570
- }));
3571
- promises.push(fetchPrice(this.underlying.address, this._networkConnection.provider).then(function (res) {
3572
- underlyingPrice = res;
3573
- }));
3574
- _context9.next = 11;
3575
- return Promise.all(promises);
3614
+ _context11.next = 2;
3615
+ return Promise.all([this.getTotalTokenDeposited(), this.getUnderlyingPrice()]);
3576
3616
 
3577
- case 11:
3578
- borrowPlyApy = calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalBorrowed.formattedAmount()), ONE_YEAR);
3579
- depositPlyApy = calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardSupplySpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalDeposited.formattedAmount()), ONE_YEAR);
3580
- _context9.t0 = helpers;
3581
- _context9.next = 16;
3617
+ case 2:
3618
+ _yield$Promise$all4 = _context11.sent;
3619
+ totalDeposited = _yield$Promise$all4[0];
3620
+ underlyingPrice = _yield$Promise$all4[1];
3621
+ _context11.t0 = helpers;
3622
+ _context11.next = 8;
3582
3623
  return fetchValuation(this.getDepositNEARRewardPerWeek(), this._networkConnection.provider);
3583
3624
 
3584
- case 16:
3585
- _context9.t1 = _context9.sent;
3586
- _context9.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
3587
- depositNEARApy = _context9.t0.calcLMRewardApr.call(_context9.t0, _context9.t1, _context9.t2, 52);
3588
- _context9.t3 = helpers;
3589
- _context9.next = 22;
3625
+ case 8:
3626
+ _context11.t1 = _context11.sent;
3627
+ _context11.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
3628
+ depositNEARApy = _context11.t0.calcLMRewardApr.call(_context11.t0, _context11.t1, _context11.t2, 52);
3629
+ return _context11.abrupt("return", depositNEARApy);
3630
+
3631
+ case 12:
3632
+ case "end":
3633
+ return _context11.stop();
3634
+ }
3635
+ }
3636
+ }, _callee11, this);
3637
+ }));
3638
+
3639
+ function getDepositNearAPY() {
3640
+ return _getDepositNearAPY.apply(this, arguments);
3641
+ }
3642
+
3643
+ return getDepositNearAPY;
3644
+ }();
3645
+
3646
+ _proto.getBorrowNearAPY = /*#__PURE__*/function () {
3647
+ var _getBorrowNearAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
3648
+ var _yield$Promise$all5, totalBorrowed, underlyingPrice, borrowNEARApy;
3649
+
3650
+ return runtime_1.wrap(function _callee12$(_context12) {
3651
+ while (1) {
3652
+ switch (_context12.prev = _context12.next) {
3653
+ case 0:
3654
+ _context12.next = 2;
3655
+ return Promise.all([this.getTotalTokenBorrowed(), this.getUnderlyingPrice()]);
3656
+
3657
+ case 2:
3658
+ _yield$Promise$all5 = _context12.sent;
3659
+ totalBorrowed = _yield$Promise$all5[0];
3660
+ underlyingPrice = _yield$Promise$all5[1];
3661
+ _context12.t0 = helpers;
3662
+ _context12.next = 8;
3590
3663
  return fetchValuation(this.getBorrowNEARRewardPerWeek(), this._networkConnection.provider);
3591
3664
 
3592
- case 22:
3593
- _context9.t4 = _context9.sent;
3594
- _context9.t5 = underlyingPrice.multipliedBy(totalBorrowed.formattedAmount());
3595
- borrowNEARApy = _context9.t3.calcLMRewardApr.call(_context9.t3, _context9.t4, _context9.t5, 52);
3665
+ case 8:
3666
+ _context12.t1 = _context12.sent;
3667
+ _context12.t2 = underlyingPrice.multipliedBy(totalBorrowed.formattedAmount());
3668
+ borrowNEARApy = _context12.t0.calcLMRewardApr.call(_context12.t0, _context12.t1, _context12.t2, 52);
3669
+ return _context12.abrupt("return", borrowNEARApy);
3670
+
3671
+ case 12:
3672
+ case "end":
3673
+ return _context12.stop();
3674
+ }
3675
+ }
3676
+ }, _callee12, this);
3677
+ }));
3678
+
3679
+ function getBorrowNearAPY() {
3680
+ return _getBorrowNearAPY.apply(this, arguments);
3681
+ }
3682
+
3683
+ return getBorrowNearAPY;
3684
+ }();
3685
+
3686
+ _proto.getDepositMetaAPY = /*#__PURE__*/function () {
3687
+ var _getDepositMetaAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13() {
3688
+ var _yield$Promise$all6, totalDeposited, underlyingPrice, depositMETAApy;
3689
+
3690
+ return runtime_1.wrap(function _callee13$(_context13) {
3691
+ while (1) {
3692
+ switch (_context13.prev = _context13.next) {
3693
+ case 0:
3694
+ _context13.next = 2;
3695
+ return Promise.all([this.getTotalTokenDeposited(), fetchPrice(this.underlying.address, this._networkConnection.provider)]);
3696
+
3697
+ case 2:
3698
+ _yield$Promise$all6 = _context13.sent;
3699
+ totalDeposited = _yield$Promise$all6[0];
3700
+ underlyingPrice = _yield$Promise$all6[1];
3596
3701
 
3597
3702
  if (!isSameAddress(this.underlying.address, networkAddresses.tokens.stNEAR)) {
3598
- _context9.next = 34;
3703
+ _context13.next = 14;
3599
3704
  break;
3600
3705
  }
3601
3706
 
3602
- _context9.t6 = helpers;
3603
- _context9.next = 29;
3707
+ _context13.t0 = helpers;
3708
+ _context13.next = 9;
3604
3709
  return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.META, '1250000', false), this._networkConnection.provider);
3605
3710
 
3606
- case 29:
3607
- _context9.t7 = _context9.sent;
3608
- _context9.t8 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
3609
- depositMETAApy = _context9.t6.calcLMRewardApr.call(_context9.t6, _context9.t7, _context9.t8, 12);
3610
- _context9.next = 35;
3711
+ case 9:
3712
+ _context13.t1 = _context13.sent;
3713
+ _context13.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
3714
+ depositMETAApy = _context13.t0.calcLMRewardApr.call(_context13.t0, _context13.t1, _context13.t2, 12);
3715
+ _context13.next = 15;
3611
3716
  break;
3612
3717
 
3613
- case 34:
3718
+ case 14:
3614
3719
  depositMETAApy = new BigNumber(0);
3615
3720
 
3616
- case 35:
3617
- return _context9.abrupt("return", {
3721
+ case 15:
3722
+ return _context13.abrupt("return", depositMETAApy);
3723
+
3724
+ case 16:
3725
+ case "end":
3726
+ return _context13.stop();
3727
+ }
3728
+ }
3729
+ }, _callee13, this);
3730
+ }));
3731
+
3732
+ function getDepositMetaAPY() {
3733
+ return _getDepositMetaAPY.apply(this, arguments);
3734
+ }
3735
+
3736
+ return getDepositMetaAPY;
3737
+ }();
3738
+
3739
+ _proto.getDetails = /*#__PURE__*/function () {
3740
+ var _getDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14() {
3741
+ var _yield$Promise$all7, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, rewardSpeeds, _yield$Promise$all8, depositPlyAPY, borrowPlyAPY, depositNearAPY, borrowNearAPY, depositMetaAPY;
3742
+
3743
+ return runtime_1.wrap(function _callee14$(_context14) {
3744
+ while (1) {
3745
+ switch (_context14.prev = _context14.next) {
3746
+ case 0:
3747
+ _context14.next = 2;
3748
+ return Promise.all([this.getTotalTokenDeposited(), this.getTotalTokenBorrowed(), this.getDepositAPY(), this.getBorrowAPY(), this.getCollateralRatio(), this.getRewardSpeeds()]);
3749
+
3750
+ case 2:
3751
+ _yield$Promise$all7 = _context14.sent;
3752
+ totalDeposited = _yield$Promise$all7[0];
3753
+ totalBorrowed = _yield$Promise$all7[1];
3754
+ depositAPY = _yield$Promise$all7[2];
3755
+ borrowAPY = _yield$Promise$all7[3];
3756
+ collateralRatio = _yield$Promise$all7[4];
3757
+ rewardSpeeds = _yield$Promise$all7[5];
3758
+ _context14.next = 11;
3759
+ return Promise.all([this.getDepositPlyAPY(), this.getBorrowPlyAPY(), this.getDepositNearAPY(), this.getBorrowNearAPY(), this.getDepositMetaAPY()]);
3760
+
3761
+ case 11:
3762
+ _yield$Promise$all8 = _context14.sent;
3763
+ depositPlyAPY = _yield$Promise$all8[0];
3764
+ borrowPlyAPY = _yield$Promise$all8[1];
3765
+ depositNearAPY = _yield$Promise$all8[2];
3766
+ borrowNearAPY = _yield$Promise$all8[3];
3767
+ depositMetaAPY = _yield$Promise$all8[4];
3768
+ return _context14.abrupt("return", {
3618
3769
  auTokenAddress: this.auToken.address,
3619
3770
  totalTokenDeposited: totalDeposited,
3620
3771
  totalTokenBorrowed: totalBorrowed,
3621
- depositApy: depositAPY,
3622
- depositPlyApy: depositPlyApy.toNumber(),
3623
- borrowApy: borrowAPY,
3624
- borrowPlyApy: borrowPlyApy.toNumber() * -1,
3625
- collateralRatio: collateralRatio,
3772
+ depositApy: depositAPY.toNumber(),
3773
+ depositPlyApy: depositPlyAPY.toNumber(),
3774
+ borrowApy: borrowAPY.toNumber(),
3775
+ borrowPlyApy: borrowPlyAPY.toNumber() * -1,
3776
+ collateralRatio: collateralRatio.toNumber(),
3626
3777
  depositPlyPerWeek: new TokenAmount(PLYToken, rewardSpeeds.plyRewardSupplySpeed.mul(ONE_DAY).mul(7).toString()),
3627
3778
  borrowPlyPerWeek: new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.mul(ONE_DAY).mul(7).toString()),
3628
- depositNEARApy: depositNEARApy.toNumber(),
3629
- borrowNEARApy: borrowNEARApy.toNumber() * -1,
3630
- depositMETAApy: depositMETAApy.toNumber()
3779
+ depositNEARApy: depositNearAPY.toNumber(),
3780
+ borrowNEARApy: borrowNearAPY.toNumber() * -1,
3781
+ depositMETAApy: depositMetaAPY.toNumber()
3631
3782
  });
3632
3783
 
3633
- case 36:
3784
+ case 18:
3634
3785
  case "end":
3635
- return _context9.stop();
3786
+ return _context14.stop();
3636
3787
  }
3637
3788
  }
3638
- }, _callee9, this);
3789
+ }, _callee14, this);
3639
3790
  }));
3640
3791
 
3641
3792
  function getDetails() {
@@ -3646,25 +3797,25 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3646
3797
  }();
3647
3798
 
3648
3799
  _proto.getUserBorrowBalance = /*#__PURE__*/function () {
3649
- var _getUserBorrowBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(userAddress) {
3800
+ var _getUserBorrowBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(userAddress) {
3650
3801
  var totalBorrow;
3651
- return runtime_1.wrap(function _callee10$(_context10) {
3802
+ return runtime_1.wrap(function _callee15$(_context15) {
3652
3803
  while (1) {
3653
- switch (_context10.prev = _context10.next) {
3804
+ switch (_context15.prev = _context15.next) {
3654
3805
  case 0:
3655
- _context10.next = 2;
3806
+ _context15.next = 2;
3656
3807
  return this.auToken.callStatic.borrowBalanceCurrent(userAddress);
3657
3808
 
3658
3809
  case 2:
3659
- totalBorrow = _context10.sent;
3660
- return _context10.abrupt("return", new TokenAmount(this.underlying, totalBorrow.toString()));
3810
+ totalBorrow = _context15.sent;
3811
+ return _context15.abrupt("return", new TokenAmount(this.underlying, totalBorrow.toString()));
3661
3812
 
3662
3813
  case 4:
3663
3814
  case "end":
3664
- return _context10.stop();
3815
+ return _context15.stop();
3665
3816
  }
3666
3817
  }
3667
- }, _callee10, this);
3818
+ }, _callee15, this);
3668
3819
  }));
3669
3820
 
3670
3821
  function getUserBorrowBalance(_x) {
@@ -3675,25 +3826,25 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3675
3826
  }();
3676
3827
 
3677
3828
  _proto.getUserDepositBalance = /*#__PURE__*/function () {
3678
- var _getUserDepositBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(userAddress) {
3829
+ var _getUserDepositBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(userAddress) {
3679
3830
  var totalDeposit;
3680
- return runtime_1.wrap(function _callee11$(_context11) {
3831
+ return runtime_1.wrap(function _callee16$(_context16) {
3681
3832
  while (1) {
3682
- switch (_context11.prev = _context11.next) {
3833
+ switch (_context16.prev = _context16.next) {
3683
3834
  case 0:
3684
- _context11.next = 2;
3835
+ _context16.next = 2;
3685
3836
  return this.auToken.callStatic.balanceOfUnderlying(userAddress);
3686
3837
 
3687
3838
  case 2:
3688
- totalDeposit = _context11.sent;
3689
- return _context11.abrupt("return", new TokenAmount(this.underlying, totalDeposit.toString()));
3839
+ totalDeposit = _context16.sent;
3840
+ return _context16.abrupt("return", new TokenAmount(this.underlying, totalDeposit.toString()));
3690
3841
 
3691
3842
  case 4:
3692
3843
  case "end":
3693
- return _context11.stop();
3844
+ return _context16.stop();
3694
3845
  }
3695
3846
  }
3696
- }, _callee11, this);
3847
+ }, _callee16, this);
3697
3848
  }));
3698
3849
 
3699
3850
  function getUserDepositBalance(_x2) {
@@ -3738,26 +3889,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3738
3889
  };
3739
3890
 
3740
3891
  _proto.mintCap = /*#__PURE__*/function () {
3741
- var _mintCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
3742
- return runtime_1.wrap(function _callee12$(_context12) {
3892
+ var _mintCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee17() {
3893
+ return runtime_1.wrap(function _callee17$(_context17) {
3743
3894
  while (1) {
3744
- switch (_context12.prev = _context12.next) {
3895
+ switch (_context17.prev = _context17.next) {
3745
3896
  case 0:
3746
- _context12.t0 = TokenAmount;
3747
- _context12.t1 = this.underlying;
3748
- _context12.next = 4;
3897
+ _context17.t0 = TokenAmount;
3898
+ _context17.t1 = this.underlying;
3899
+ _context17.next = 4;
3749
3900
  return this.env.comptroller.mintCaps(this.auToken.address);
3750
3901
 
3751
3902
  case 4:
3752
- _context12.t2 = _context12.sent.toString();
3753
- return _context12.abrupt("return", new _context12.t0(_context12.t1, _context12.t2));
3903
+ _context17.t2 = _context17.sent.toString();
3904
+ return _context17.abrupt("return", new _context17.t0(_context17.t1, _context17.t2));
3754
3905
 
3755
3906
  case 6:
3756
3907
  case "end":
3757
- return _context12.stop();
3908
+ return _context17.stop();
3758
3909
  }
3759
3910
  }
3760
- }, _callee12, this);
3911
+ }, _callee17, this);
3761
3912
  }));
3762
3913
 
3763
3914
  function mintCap() {
@@ -3768,26 +3919,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3768
3919
  }();
3769
3920
 
3770
3921
  _proto.borrowCap = /*#__PURE__*/function () {
3771
- var _borrowCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13() {
3772
- return runtime_1.wrap(function _callee13$(_context13) {
3922
+ var _borrowCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee18() {
3923
+ return runtime_1.wrap(function _callee18$(_context18) {
3773
3924
  while (1) {
3774
- switch (_context13.prev = _context13.next) {
3925
+ switch (_context18.prev = _context18.next) {
3775
3926
  case 0:
3776
- _context13.t0 = TokenAmount;
3777
- _context13.t1 = this.underlying;
3778
- _context13.next = 4;
3927
+ _context18.t0 = TokenAmount;
3928
+ _context18.t1 = this.underlying;
3929
+ _context18.next = 4;
3779
3930
  return this.env.comptroller.borrowCaps(this.auToken.address);
3780
3931
 
3781
3932
  case 4:
3782
- _context13.t2 = _context13.sent.toString();
3783
- return _context13.abrupt("return", new _context13.t0(_context13.t1, _context13.t2));
3933
+ _context18.t2 = _context18.sent.toString();
3934
+ return _context18.abrupt("return", new _context18.t0(_context18.t1, _context18.t2));
3784
3935
 
3785
3936
  case 6:
3786
3937
  case "end":
3787
- return _context13.stop();
3938
+ return _context18.stop();
3788
3939
  }
3789
3940
  }
3790
- }, _callee13, this);
3941
+ }, _callee18, this);
3791
3942
  }));
3792
3943
 
3793
3944
  function borrowCap() {
@@ -3797,48 +3948,166 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3797
3948
  return borrowCap;
3798
3949
  }();
3799
3950
 
3951
+ _proto.getApyWithoutIncentive = /*#__PURE__*/function () {
3952
+ var _getApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee19(userAddress) {
3953
+ var _yield$Promise$all9, price, depositApy, borrowApy, depositBalance, borrowBalance, suppliedValue, borrowedValue, sum;
3954
+
3955
+ return runtime_1.wrap(function _callee19$(_context19) {
3956
+ while (1) {
3957
+ switch (_context19.prev = _context19.next) {
3958
+ case 0:
3959
+ _context19.next = 2;
3960
+ return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)]);
3961
+
3962
+ case 2:
3963
+ _yield$Promise$all9 = _context19.sent;
3964
+ price = _yield$Promise$all9[0];
3965
+ depositApy = _yield$Promise$all9[1];
3966
+ borrowApy = _yield$Promise$all9[2];
3967
+ depositBalance = _yield$Promise$all9[3];
3968
+ borrowBalance = _yield$Promise$all9[4];
3969
+ suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
3970
+ borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
3971
+ sum = calcNetApy(suppliedValue, depositApy, borrowedValue, borrowApy);
3972
+ return _context19.abrupt("return", {
3973
+ sum: sum,
3974
+ suppliedValue: suppliedValue,
3975
+ borrowedValue: borrowedValue
3976
+ });
3977
+
3978
+ case 12:
3979
+ case "end":
3980
+ return _context19.stop();
3981
+ }
3982
+ }
3983
+ }, _callee19, this);
3984
+ }));
3985
+
3986
+ function getApyWithoutIncentive(_x3) {
3987
+ return _getApyWithoutIncentive.apply(this, arguments);
3988
+ }
3989
+
3990
+ return getApyWithoutIncentive;
3991
+ }();
3992
+
3993
+ _proto.getApyWithIncentive = /*#__PURE__*/function () {
3994
+ var _getApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee20(userAddress) {
3995
+ var _yield$Promise$all10, price, depositApy, borrowApy, depositBalance, borrowBalance, nearDepositApy, plyDepositApy, metaDepositApy, nearBorrowApy, plyBorrowApy, suppliedValue, borrowedValue, totalDepositApy, totalBorrowApy, sum;
3996
+
3997
+ return runtime_1.wrap(function _callee20$(_context20) {
3998
+ while (1) {
3999
+ switch (_context20.prev = _context20.next) {
4000
+ case 0:
4001
+ _context20.next = 2;
4002
+ return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress), this.getDepositNearAPY(), this.getDepositPlyAPY(), this.getDepositMetaAPY(), this.getBorrowNearAPY(), this.getBorrowPlyAPY()]);
4003
+
4004
+ case 2:
4005
+ _yield$Promise$all10 = _context20.sent;
4006
+ price = _yield$Promise$all10[0];
4007
+ depositApy = _yield$Promise$all10[1];
4008
+ borrowApy = _yield$Promise$all10[2];
4009
+ depositBalance = _yield$Promise$all10[3];
4010
+ borrowBalance = _yield$Promise$all10[4];
4011
+ nearDepositApy = _yield$Promise$all10[5];
4012
+ plyDepositApy = _yield$Promise$all10[6];
4013
+ metaDepositApy = _yield$Promise$all10[7];
4014
+ nearBorrowApy = _yield$Promise$all10[8];
4015
+ plyBorrowApy = _yield$Promise$all10[9];
4016
+ suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
4017
+ borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
4018
+ totalDepositApy = depositApy.plus(nearDepositApy).plus(plyDepositApy).plus(metaDepositApy);
4019
+ totalBorrowApy = borrowApy.plus(nearBorrowApy).plus(plyBorrowApy);
4020
+ sum = calcNetApy(suppliedValue, totalDepositApy, borrowedValue, totalBorrowApy);
4021
+ return _context20.abrupt("return", {
4022
+ sum: sum,
4023
+ suppliedValue: suppliedValue,
4024
+ borrowedValue: borrowedValue
4025
+ });
4026
+
4027
+ case 19:
4028
+ case "end":
4029
+ return _context20.stop();
4030
+ }
4031
+ }
4032
+ }, _callee20, this);
4033
+ }));
4034
+
4035
+ function getApyWithIncentive(_x4) {
4036
+ return _getApyWithIncentive.apply(this, arguments);
4037
+ }
4038
+
4039
+ return getApyWithIncentive;
4040
+ }();
4041
+
3800
4042
  return MoneyMarketRead;
3801
4043
  }(BlockchainEntityRead);
4044
+
4045
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getUnderlyingPrice", null);
4046
+
4047
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getPlyPrice", null);
4048
+
4049
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getRewardSpeeds", null);
4050
+
4051
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getTotalTokenBorrowed", null);
4052
+
4053
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getTotalTokenDeposited", null);
4054
+
4055
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getDepositAPY", null);
4056
+
4057
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getBorrowAPY", null);
4058
+
4059
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getCollateralRatio", null);
4060
+
4061
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getBorrowPlyAPY", null);
4062
+
4063
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getDepositPlyAPY", null);
4064
+
4065
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getDepositNearAPY", null);
4066
+
4067
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getBorrowNearAPY", null);
4068
+
4069
+ __decorate([Cache(CACHE_TIMEOUT), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], MoneyMarketRead.prototype, "getDepositMetaAPY", null);
4070
+
3802
4071
  var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3803
4072
  _inheritsLoose(MoneyMarketReadWrite, _MoneyMarketRead);
3804
4073
 
3805
4074
  function MoneyMarketReadWrite(networkConnection, auToken, underlyingAsset) {
3806
- var _this3;
4075
+ var _this2;
3807
4076
 
3808
- _this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
3809
- _this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$9.abi, networkConnection.provider);
3810
- return _this3;
4077
+ _this2 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
4078
+ _this2._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$9.abi, networkConnection.provider);
4079
+ return _this2;
3811
4080
  }
3812
4081
 
3813
4082
  var _proto2 = MoneyMarketReadWrite.prototype;
3814
4083
 
3815
4084
  _proto2.deposit = /*#__PURE__*/function () {
3816
- var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(amount) {
3817
- return runtime_1.wrap(function _callee14$(_context14) {
4085
+ var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee21(amount) {
4086
+ return runtime_1.wrap(function _callee21$(_context21) {
3818
4087
  while (1) {
3819
- switch (_context14.prev = _context14.next) {
4088
+ switch (_context21.prev = _context21.next) {
3820
4089
  case 0:
3821
4090
  if (!isSameAddress(amount.token.address, ETHAddress)) {
3822
- _context14.next = 4;
4091
+ _context21.next = 4;
3823
4092
  break;
3824
4093
  }
3825
4094
 
3826
- return _context14.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint({
4095
+ return _context21.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint({
3827
4096
  value: amount.rawAmount()
3828
4097
  }));
3829
4098
 
3830
4099
  case 4:
3831
- return _context14.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint(amount.rawAmount()));
4100
+ return _context21.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint(amount.rawAmount()));
3832
4101
 
3833
4102
  case 5:
3834
4103
  case "end":
3835
- return _context14.stop();
4104
+ return _context21.stop();
3836
4105
  }
3837
4106
  }
3838
- }, _callee14, this);
4107
+ }, _callee21, this);
3839
4108
  }));
3840
4109
 
3841
- function deposit(_x3) {
4110
+ function deposit(_x5) {
3842
4111
  return _deposit.apply(this, arguments);
3843
4112
  }
3844
4113
 
@@ -3846,22 +4115,22 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3846
4115
  }();
3847
4116
 
3848
4117
  _proto2.borrow = /*#__PURE__*/function () {
3849
- var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(amount) {
3850
- return runtime_1.wrap(function _callee15$(_context15) {
4118
+ var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee22(amount) {
4119
+ return runtime_1.wrap(function _callee22$(_context22) {
3851
4120
  while (1) {
3852
- switch (_context15.prev = _context15.next) {
4121
+ switch (_context22.prev = _context22.next) {
3853
4122
  case 0:
3854
- return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).borrow(amount.rawAmount()));
4123
+ return _context22.abrupt("return", this.auToken.connect(this._networkConnection.signer).borrow(amount.rawAmount()));
3855
4124
 
3856
4125
  case 1:
3857
4126
  case "end":
3858
- return _context15.stop();
4127
+ return _context22.stop();
3859
4128
  }
3860
4129
  }
3861
- }, _callee15, this);
4130
+ }, _callee22, this);
3862
4131
  }));
3863
4132
 
3864
- function borrow(_x4) {
4133
+ function borrow(_x6) {
3865
4134
  return _borrow.apply(this, arguments);
3866
4135
  }
3867
4136
 
@@ -3869,30 +4138,30 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3869
4138
  }();
3870
4139
 
3871
4140
  _proto2.withdraw = /*#__PURE__*/function () {
3872
- var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(amount) {
3873
- return runtime_1.wrap(function _callee16$(_context16) {
4141
+ var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee23(amount) {
4142
+ return runtime_1.wrap(function _callee23$(_context23) {
3874
4143
  while (1) {
3875
- switch (_context16.prev = _context16.next) {
4144
+ switch (_context23.prev = _context23.next) {
3876
4145
  case 0:
3877
4146
  if (!new BigNumber(amount.rawAmount()).lt(0)) {
3878
- _context16.next = 2;
4147
+ _context23.next = 2;
3879
4148
  break;
3880
4149
  }
3881
4150
 
3882
- return _context16.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(INF));
4151
+ return _context23.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(INF));
3883
4152
 
3884
4153
  case 2:
3885
- return _context16.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(amount.rawAmount()));
4154
+ return _context23.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(amount.rawAmount()));
3886
4155
 
3887
4156
  case 3:
3888
4157
  case "end":
3889
- return _context16.stop();
4158
+ return _context23.stop();
3890
4159
  }
3891
4160
  }
3892
- }, _callee16, this);
4161
+ }, _callee23, this);
3893
4162
  }));
3894
4163
 
3895
- function withdraw(_x5) {
4164
+ function withdraw(_x7) {
3896
4165
  return _withdraw.apply(this, arguments);
3897
4166
  }
3898
4167
 
@@ -3900,40 +4169,40 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3900
4169
  }();
3901
4170
 
3902
4171
  _proto2.repay = /*#__PURE__*/function () {
3903
- var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee17(amount) {
3904
- return runtime_1.wrap(function _callee17$(_context17) {
4172
+ var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee24(amount) {
4173
+ return runtime_1.wrap(function _callee24$(_context24) {
3905
4174
  while (1) {
3906
- switch (_context17.prev = _context17.next) {
4175
+ switch (_context24.prev = _context24.next) {
3907
4176
  case 0:
3908
4177
  if (!isSameAddress(amount.token.address, ETHAddress)) {
3909
- _context17.next = 4;
4178
+ _context24.next = 4;
3910
4179
  break;
3911
4180
  }
3912
4181
 
3913
- return _context17.abrupt("return", this._EthRepayHelper.connect(this._networkConnection.signer).repayBorrow({
4182
+ return _context24.abrupt("return", this._EthRepayHelper.connect(this._networkConnection.signer).repayBorrow({
3914
4183
  value: amount.rawAmount()
3915
4184
  }));
3916
4185
 
3917
4186
  case 4:
3918
4187
  if (!new BigNumber(amount.rawAmount()).lt(0)) {
3919
- _context17.next = 8;
4188
+ _context24.next = 8;
3920
4189
  break;
3921
4190
  }
3922
4191
 
3923
- return _context17.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(INF));
4192
+ return _context24.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(INF));
3924
4193
 
3925
4194
  case 8:
3926
- return _context17.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(amount.rawAmount()));
4195
+ return _context24.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(amount.rawAmount()));
3927
4196
 
3928
4197
  case 9:
3929
4198
  case "end":
3930
- return _context17.stop();
4199
+ return _context24.stop();
3931
4200
  }
3932
4201
  }
3933
- }, _callee17, this);
4202
+ }, _callee24, this);
3934
4203
  }));
3935
4204
 
3936
- function repay(_x6) {
4205
+ function repay(_x8) {
3937
4206
  return _repay.apply(this, arguments);
3938
4207
  }
3939
4208
 
@@ -3941,19 +4210,19 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3941
4210
  }();
3942
4211
 
3943
4212
  _proto2.enableCollateral = /*#__PURE__*/function () {
3944
- var _enableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee18() {
3945
- return runtime_1.wrap(function _callee18$(_context18) {
4213
+ var _enableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee25() {
4214
+ return runtime_1.wrap(function _callee25$(_context25) {
3946
4215
  while (1) {
3947
- switch (_context18.prev = _context18.next) {
4216
+ switch (_context25.prev = _context25.next) {
3948
4217
  case 0:
3949
- return _context18.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).enterMarkets([this.auToken.address]));
4218
+ return _context25.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).enterMarkets([this.auToken.address]));
3950
4219
 
3951
4220
  case 1:
3952
4221
  case "end":
3953
- return _context18.stop();
4222
+ return _context25.stop();
3954
4223
  }
3955
4224
  }
3956
- }, _callee18, this);
4225
+ }, _callee25, this);
3957
4226
  }));
3958
4227
 
3959
4228
  function enableCollateral() {
@@ -3964,19 +4233,19 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3964
4233
  }();
3965
4234
 
3966
4235
  _proto2.disableCollateral = /*#__PURE__*/function () {
3967
- var _disableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee19() {
3968
- return runtime_1.wrap(function _callee19$(_context19) {
4236
+ var _disableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee26() {
4237
+ return runtime_1.wrap(function _callee26$(_context26) {
3969
4238
  while (1) {
3970
- switch (_context19.prev = _context19.next) {
4239
+ switch (_context26.prev = _context26.next) {
3971
4240
  case 0:
3972
- return _context19.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).exitMarket(this.auToken.address));
4241
+ return _context26.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).exitMarket(this.auToken.address));
3973
4242
 
3974
4243
  case 1:
3975
4244
  case "end":
3976
- return _context19.stop();
4245
+ return _context26.stop();
3977
4246
  }
3978
4247
  }
3979
- }, _callee19, this);
4248
+ }, _callee26, this);
3980
4249
  }));
3981
4250
 
3982
4251
  function disableCollateral() {
@@ -3992,12 +4261,12 @@ var MoneyMarket = /*#__PURE__*/function (_BlockchainEntity) {
3992
4261
  _inheritsLoose(MoneyMarket, _BlockchainEntity);
3993
4262
 
3994
4263
  function MoneyMarket(address, underlying) {
3995
- var _this4;
4264
+ var _this3;
3996
4265
 
3997
- _this4 = _BlockchainEntity.call(this) || this;
3998
- _this4.address = validateAndParseAddress(address);
3999
- _this4.underlying = validateAndParseAddress(underlying);
4000
- return _this4;
4266
+ _this3 = _BlockchainEntity.call(this) || this;
4267
+ _this3.address = validateAndParseAddress(address);
4268
+ _this3.underlying = validateAndParseAddress(underlying);
4269
+ return _this3;
4001
4270
  }
4002
4271
 
4003
4272
  var _proto3 = MoneyMarket.prototype;
@@ -4224,29 +4493,25 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4224
4493
  /*#__PURE__*/
4225
4494
  function () {
4226
4495
  var _getLockingDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(userAddress) {
4227
- var currentWeek, promises, values, percentLockCurrentWeek, percentLockNextWeek, totalRewards, _yield$this$env$pulp$, pulpAmountCurrentWeek, plyAmountCurrentWeek, plyAmountNextWeek, pulpAmountNextWeek, currentUnlockPortion, nextUnlockPortion;
4496
+ var currentWeek, values, percentLockCurrentWeek, percentLockNextWeek, totalRewards, _yield$this$env$pulp$, pulpAmountCurrentWeek, plyAmountCurrentWeek, plyAmountNextWeek, pulpAmountNextWeek, currentUnlockPortion, nextUnlockPortion;
4228
4497
 
4229
4498
  return runtime_1.wrap(function _callee4$(_context4) {
4230
4499
  while (1) {
4231
4500
  switch (_context4.prev = _context4.next) {
4232
4501
  case 0:
4233
4502
  currentWeek = this.getWeek(getCurrentTimestamp());
4234
- promises = [];
4235
- promises.push(this.env.auriLens.getPercentLock(this.env.pulp.address, userAddress, currentWeek));
4236
- promises.push(this.env.auriLens.getPercentLock(this.env.pulp.address, userAddress, currentWeek + 1));
4237
- promises.push(this.getUnclaimedPlyReward(userAddress));
4238
- _context4.next = 7;
4239
- return Promise.all(promises);
4503
+ _context4.next = 3;
4504
+ return Promise.all([this.env.auriLens.getPercentLock(this.env.pulp.address, userAddress, currentWeek), this.env.auriLens.getPercentLock(this.env.pulp.address, userAddress, currentWeek + 1), this.getUnclaimedPlyReward(userAddress)]);
4240
4505
 
4241
- case 7:
4506
+ case 3:
4242
4507
  values = _context4.sent;
4243
4508
  percentLockCurrentWeek = BigNumber$1.from(values[0]);
4244
4509
  percentLockNextWeek = BigNumber$1.from(values[1]);
4245
4510
  totalRewards = values[2];
4246
- _context4.next = 13;
4511
+ _context4.next = 9;
4247
4512
  return this.env.pulp.calcLockAmount(userAddress, totalRewards.rawAmount());
4248
4513
 
4249
- case 13:
4514
+ case 9:
4250
4515
  _yield$this$env$pulp$ = _context4.sent;
4251
4516
  pulpAmountCurrentWeek = _yield$this$env$pulp$[0];
4252
4517
  plyAmountCurrentWeek = _yield$this$env$pulp$[1];
@@ -4270,7 +4535,7 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4270
4535
  nextPulp: new TokenAmount(this.pulpToken, pulpAmountNextWeek.toString())
4271
4536
  });
4272
4537
 
4273
- case 21:
4538
+ case 17:
4274
4539
  case "end":
4275
4540
  return _context4.stop();
4276
4541
  }
@@ -4760,9 +5025,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4760
5025
 
4761
5026
  _proto.getUserDetails = /*#__PURE__*/function () {
4762
5027
  var _getUserDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(userAddress) {
4763
- var _this2 = this;
4764
-
4765
- var marketCount, userMarketDetails, assetsIn, promises, totalBorrowLimit, pricePromises, _loop2, _iterator, _step, underlyingPrices, depositValues, _loop, i, accountLiquidity, borrowedvaluation, bufferedBorrowLimit, minimumBorrowLimitAllowed, borrowableAmount, auToken, moneyMarket, borrowLimitMargin, maxWithdrawCap;
5028
+ var marketCount, userMarketDetails, assetsIn, totalBorrowLimit, _iterator, _step, _auToken, userMarketDetail, _moneyMarket, _yield$Promise$all, depositBalance, borrowBalance, collateralRatio, underlyingPrice, depositValues, _loop, i, accountLiquidity, borrowedvaluation, bufferedBorrowLimit, minimumBorrowLimitAllowed, borrowableAmount, auToken, moneyMarket, borrowLimitMargin, maxWithdrawCap;
4766
5029
 
4767
5030
  return runtime_1.wrap(function _callee$(_context) {
4768
5031
  while (1) {
@@ -4770,47 +5033,44 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4770
5033
  case 0:
4771
5034
  marketCount = networkAddresses.auTokens.length;
4772
5035
  userMarketDetails = [];
4773
- promises = [];
4774
5036
  totalBorrowLimit = new BigNumber(0);
4775
- pricePromises = [];
4776
-
4777
- _loop2 = function _loop2() {
4778
- var auToken = _step.value;
4779
- var userMarketDetail = {};
4780
- userMarketDetails.push(userMarketDetail);
4781
- userMarketDetail.market = auToken.underlying;
4782
- var moneyMarket = new MoneyMarketRead(_this2._networkConnection, auToken.address, auToken.underlying);
4783
- promises.push(moneyMarket.getUserDepositBalance(userAddress).then(function (res) {
4784
- userMarketDetail.depositBalance = res;
4785
- }));
4786
- promises.push(moneyMarket.getUserBorrowBalance(userAddress).then(function (res) {
4787
- userMarketDetail.borrowBalance = res;
4788
- }));
4789
- promises.push(moneyMarket.getCollateralRatio().then(function (res) {
4790
- userMarketDetail.collateralRatio = res.toNumber();
4791
- }));
4792
- pricePromises.push(fetchPrice(moneyMarket.underlying.address, _this2._networkConnection.provider).then(function (res) {
4793
- userMarketDetail.underlyingPrice = res.toString();
4794
- return res;
4795
- }));
4796
- };
5037
+ _iterator = _createForOfIteratorHelperLoose(networkAddresses.auTokens);
4797
5038
 
4798
- for (_iterator = _createForOfIteratorHelperLoose(networkAddresses.auTokens); !(_step = _iterator()).done;) {
4799
- _loop2();
5039
+ case 4:
5040
+ if ((_step = _iterator()).done) {
5041
+ _context.next = 23;
5042
+ break;
4800
5043
  }
4801
5044
 
4802
- promises.push(this.env.comptroller.getAssetsIn(userAddress).then(function (res) {
4803
- assetsIn = res;
4804
- }));
4805
- _context.next = 10;
4806
- return Promise.all(promises);
4807
-
4808
- case 10:
5045
+ _auToken = _step.value;
5046
+ userMarketDetail = {};
5047
+ userMarketDetails.push(userMarketDetail);
5048
+ userMarketDetail.market = _auToken.underlying;
5049
+ _moneyMarket = new MoneyMarketRead(this._networkConnection, _auToken.address, _auToken.underlying);
4809
5050
  _context.next = 12;
4810
- return Promise.all(pricePromises);
5051
+ return Promise.all([_moneyMarket.getUserDepositBalance(userAddress), _moneyMarket.getUserBorrowBalance(userAddress), _moneyMarket.getCollateralRatio(), fetchPrice(_moneyMarket.underlying.address, this._networkConnection.provider)]);
4811
5052
 
4812
5053
  case 12:
4813
- underlyingPrices = _context.sent;
5054
+ _yield$Promise$all = _context.sent;
5055
+ depositBalance = _yield$Promise$all[0];
5056
+ borrowBalance = _yield$Promise$all[1];
5057
+ collateralRatio = _yield$Promise$all[2];
5058
+ underlyingPrice = _yield$Promise$all[3];
5059
+ userMarketDetail.depositBalance = depositBalance;
5060
+ userMarketDetail.borrowBalance = borrowBalance;
5061
+ userMarketDetail.collateralRatio = collateralRatio.toNumber();
5062
+ userMarketDetail.underlyingPrice = underlyingPrice.toString();
5063
+
5064
+ case 21:
5065
+ _context.next = 4;
5066
+ break;
5067
+
5068
+ case 23:
5069
+ _context.next = 25;
5070
+ return this.env.comptroller.getAssetsIn(userAddress);
5071
+
5072
+ case 25:
5073
+ assetsIn = _context.sent;
4814
5074
  depositValues = [];
4815
5075
 
4816
5076
  _loop = function _loop() {
@@ -4824,7 +5084,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4824
5084
  userMarketDetails[i].isCollateral = false;
4825
5085
  }
4826
5086
 
4827
- depositValues.push(calcValuation(userMarketDetails[i].depositBalance, underlyingPrices[i]));
5087
+ depositValues.push(calcValuation(userMarketDetails[i].depositBalance, new BigNumber(userMarketDetails[i].underlyingPrice)));
4828
5088
  };
4829
5089
 
4830
5090
  for (i = 0; i < marketCount; i++) {
@@ -4835,10 +5095,10 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4835
5095
  if (userMarketDetails[index].isCollateral) return p.plus(v.multipliedBy(userMarketDetails[index].collateralRatio));
4836
5096
  return p;
4837
5097
  }, new BigNumber(0));
4838
- _context.next = 19;
5098
+ _context.next = 32;
4839
5099
  return this.env.comptroller.getAccountLiquidity(userAddress);
4840
5100
 
4841
- case 19:
5101
+ case 32:
4842
5102
  accountLiquidity = _context.sent;
4843
5103
  borrowedvaluation = totalBorrowLimit.minus(new BigNumber(accountLiquidity[0].toString()).div(decimalFactor(18)));
4844
5104
 
@@ -4860,7 +5120,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4860
5120
  auToken = networkAddresses.auTokens[i];
4861
5121
  moneyMarket = new MoneyMarketRead(this._networkConnection, auToken.address, auToken.underlying);
4862
5122
  borrowLimitMargin = totalBorrowLimit.minus(minimumBorrowLimitAllowed).gt(0) ? totalBorrowLimit.minus(minimumBorrowLimitAllowed) : new BigNumber(0);
4863
- maxWithdrawCap = borrowLimitMargin.div(userMarketDetails[i].collateralRatio).div(underlyingPrices[i]);
5123
+ maxWithdrawCap = borrowLimitMargin.div(userMarketDetails[i].collateralRatio).div(userMarketDetails[i].underlyingPrice);
4864
5124
  userMarketDetails[i].maxWithdrawableAmount = userMarketDetails[i].isCollateral && maxWithdrawCap.lt(userMarketDetails[i].depositBalance.formattedAmount()) ? new TokenAmount(moneyMarket.underlying, maxWithdrawCap.toFixed(24), false) : new TokenAmount(moneyMarket.underlying, userMarketDetails[i].depositBalance.rawAmount());
4865
5125
  }
4866
5126
 
@@ -4869,10 +5129,10 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4869
5129
  currency: 'USD',
4870
5130
  amount: bufferedBorrowLimit.toFixed(DECIMAL_PRECISION)
4871
5131
  };
4872
- _context.next = 30;
5132
+ _context.next = 43;
4873
5133
  return new PapermillRead(this._networkConnection).getLockingDetails(userAddress);
4874
5134
 
4875
- case 30:
5135
+ case 43:
4876
5136
  _context.t2 = _context.sent;
4877
5137
  _context.t3 = {
4878
5138
  currency: 'USD',
@@ -4885,7 +5145,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4885
5145
  borrowableAmount: _context.t3
4886
5146
  });
4887
5147
 
4888
- case 33:
5148
+ case 46:
4889
5149
  case "end":
4890
5150
  return _context.stop();
4891
5151
  }
@@ -5059,7 +5319,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5059
5319
 
5060
5320
  _proto.sneakAccounts = /*#__PURE__*/function () {
5061
5321
  var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses, dust) {
5062
- var _this3 = this;
5322
+ var _this2 = this;
5063
5323
 
5064
5324
  var _1E18, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
5065
5325
 
@@ -5074,7 +5334,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5074
5334
  _1E18 = BigNumber$1.from(10).pow(18);
5075
5335
  oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
5076
5336
  tokens = tokenAddresses.map(function (addr) {
5077
- return _this3.env.getContract(addr, abis.abi);
5337
+ return _this2.env.getContract(addr, abis.abi);
5078
5338
  });
5079
5339
  _context5.next = 6;
5080
5340
  return oracle.getUnderlyingPrices(tokenAddresses);
@@ -5162,6 +5422,114 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5162
5422
  return sneakAccounts;
5163
5423
  }();
5164
5424
 
5425
+ _proto.getNetApyWithoutIncentive = /*#__PURE__*/function () {
5426
+ var _getNetApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(userAddress) {
5427
+ var _this3 = this;
5428
+
5429
+ var sum, totalSuppliedValue, totalBorrowedValue, netApy, apys, _iterator3, _step3, apy;
5430
+
5431
+ return runtime_1.wrap(function _callee6$(_context6) {
5432
+ while (1) {
5433
+ switch (_context6.prev = _context6.next) {
5434
+ case 0:
5435
+ sum = new BigNumber(0);
5436
+ totalSuppliedValue = new BigNumber(0);
5437
+ totalBorrowedValue = new BigNumber(0);
5438
+ netApy = new BigNumber(0);
5439
+ _context6.next = 6;
5440
+ return Promise.all(networkAddresses.auTokens.map(function (auToken) {
5441
+ var moneyMarket = new MoneyMarketRead(_this3._networkConnection, auToken.address, auToken.underlying);
5442
+ var apyWithoutIncentive = moneyMarket.getApyWithoutIncentive(userAddress);
5443
+ return apyWithoutIncentive;
5444
+ }));
5445
+
5446
+ case 6:
5447
+ apys = _context6.sent;
5448
+
5449
+ for (_iterator3 = _createForOfIteratorHelperLoose(apys); !(_step3 = _iterator3()).done;) {
5450
+ apy = _step3.value;
5451
+ sum = sum.plus(apy.sum);
5452
+ totalSuppliedValue = totalSuppliedValue.plus(apy.suppliedValue);
5453
+ totalBorrowedValue = totalBorrowedValue.plus(apy.borrowedValue);
5454
+ }
5455
+
5456
+ if (sum.gt(0)) {
5457
+ netApy = sum.div(totalSuppliedValue);
5458
+ } else if (sum.lt(0)) {
5459
+ netApy = sum.div(totalBorrowedValue);
5460
+ }
5461
+
5462
+ return _context6.abrupt("return", netApy);
5463
+
5464
+ case 10:
5465
+ case "end":
5466
+ return _context6.stop();
5467
+ }
5468
+ }
5469
+ }, _callee6);
5470
+ }));
5471
+
5472
+ function getNetApyWithoutIncentive(_x7) {
5473
+ return _getNetApyWithoutIncentive.apply(this, arguments);
5474
+ }
5475
+
5476
+ return getNetApyWithoutIncentive;
5477
+ }();
5478
+
5479
+ _proto.getNetApyWithIncentive = /*#__PURE__*/function () {
5480
+ var _getNetApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(userAddress) {
5481
+ var _this4 = this;
5482
+
5483
+ var sum, totalSuppliedValue, totalBorrowedValue, netApy, apys, _iterator4, _step4, apy;
5484
+
5485
+ return runtime_1.wrap(function _callee7$(_context7) {
5486
+ while (1) {
5487
+ switch (_context7.prev = _context7.next) {
5488
+ case 0:
5489
+ sum = new BigNumber(0);
5490
+ totalSuppliedValue = new BigNumber(0);
5491
+ totalBorrowedValue = new BigNumber(0);
5492
+ netApy = new BigNumber(0);
5493
+ _context7.next = 6;
5494
+ return Promise.all(networkAddresses.auTokens.map(function (auToken) {
5495
+ var moneyMarket = new MoneyMarketRead(_this4._networkConnection, auToken.address, auToken.underlying);
5496
+ var apyWithIncentive = moneyMarket.getApyWithIncentive(userAddress);
5497
+ return apyWithIncentive;
5498
+ }));
5499
+
5500
+ case 6:
5501
+ apys = _context7.sent;
5502
+
5503
+ for (_iterator4 = _createForOfIteratorHelperLoose(apys); !(_step4 = _iterator4()).done;) {
5504
+ apy = _step4.value;
5505
+ sum = sum.plus(apy.sum);
5506
+ totalSuppliedValue = totalSuppliedValue.plus(apy.suppliedValue);
5507
+ totalBorrowedValue = totalBorrowedValue.plus(apy.borrowedValue);
5508
+ }
5509
+
5510
+ if (sum.gt(0)) {
5511
+ netApy = sum.div(totalSuppliedValue);
5512
+ } else if (sum.lt(0)) {
5513
+ netApy = sum.div(totalBorrowedValue);
5514
+ }
5515
+
5516
+ return _context7.abrupt("return", netApy);
5517
+
5518
+ case 10:
5519
+ case "end":
5520
+ return _context7.stop();
5521
+ }
5522
+ }
5523
+ }, _callee7);
5524
+ }));
5525
+
5526
+ function getNetApyWithIncentive(_x8) {
5527
+ return _getNetApyWithIncentive.apply(this, arguments);
5528
+ }
5529
+
5530
+ return getNetApyWithIncentive;
5531
+ }();
5532
+
5165
5533
  return MiscRead;
5166
5534
  }(BlockchainEntityRead);
5167
5535
 
@@ -6573,6 +6941,56 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
6573
6941
  return sneakAccounts;
6574
6942
  }();
6575
6943
 
6944
+ _proto.getNetApyWithoutIncentive = /*#__PURE__*/function () {
6945
+ var _getNetApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(userAddress) {
6946
+ var miscRead;
6947
+ return runtime_1.wrap(function _callee10$(_context10) {
6948
+ while (1) {
6949
+ switch (_context10.prev = _context10.next) {
6950
+ case 0:
6951
+ miscRead = new MiscRead(this._networkConnection);
6952
+ return _context10.abrupt("return", miscRead.getNetApyWithoutIncentive(userAddress));
6953
+
6954
+ case 2:
6955
+ case "end":
6956
+ return _context10.stop();
6957
+ }
6958
+ }
6959
+ }, _callee10, this);
6960
+ }));
6961
+
6962
+ function getNetApyWithoutIncentive(_x10) {
6963
+ return _getNetApyWithoutIncentive.apply(this, arguments);
6964
+ }
6965
+
6966
+ return getNetApyWithoutIncentive;
6967
+ }();
6968
+
6969
+ _proto.getNetApyWithIncentive = /*#__PURE__*/function () {
6970
+ var _getNetApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(userAddress) {
6971
+ var miscRead;
6972
+ return runtime_1.wrap(function _callee11$(_context11) {
6973
+ while (1) {
6974
+ switch (_context11.prev = _context11.next) {
6975
+ case 0:
6976
+ miscRead = new MiscRead(this._networkConnection);
6977
+ return _context11.abrupt("return", miscRead.getNetApyWithIncentive(userAddress));
6978
+
6979
+ case 2:
6980
+ case "end":
6981
+ return _context11.stop();
6982
+ }
6983
+ }
6984
+ }, _callee11, this);
6985
+ }));
6986
+
6987
+ function getNetApyWithIncentive(_x11) {
6988
+ return _getNetApyWithIncentive.apply(this, arguments);
6989
+ }
6990
+
6991
+ return getNetApyWithIncentive;
6992
+ }();
6993
+
6576
6994
  return SdkRead;
6577
6995
  }(BlockchainEntityRead);
6578
6996
  var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
@@ -6590,19 +7008,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
6590
7008
  _proto2.claim =
6591
7009
  /*#__PURE__*/
6592
7010
  function () {
6593
- var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
6594
- return runtime_1.wrap(function _callee10$(_context10) {
7011
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
7012
+ return runtime_1.wrap(function _callee12$(_context12) {
6595
7013
  while (1) {
6596
- switch (_context10.prev = _context10.next) {
7014
+ switch (_context12.prev = _context12.next) {
6597
7015
  case 0:
6598
- return _context10.abrupt("return", this.env.auriLens.connect(this._networkConnection.signer).claimRewards(this.env.comptroller.address, this.env.auriFairLaunch.address, ALL_STAKING_POOLS));
7016
+ return _context12.abrupt("return", this.env.auriLens.connect(this._networkConnection.signer).claimRewards(this.env.comptroller.address, this.env.auriFairLaunch.address, ALL_STAKING_POOLS));
6599
7017
 
6600
7018
  case 1:
6601
7019
  case "end":
6602
- return _context10.stop();
7020
+ return _context12.stop();
6603
7021
  }
6604
7022
  }
6605
- }, _callee10, this);
7023
+ }, _callee12, this);
6606
7024
  }));
6607
7025
 
6608
7026
  function claim() {
@@ -6613,22 +7031,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
6613
7031
  }();
6614
7032
 
6615
7033
  _proto2.stake = /*#__PURE__*/function () {
6616
- var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(amount) {
6617
- return runtime_1.wrap(function _callee11$(_context11) {
7034
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(amount) {
7035
+ return runtime_1.wrap(function _callee13$(_context13) {
6618
7036
  while (1) {
6619
- switch (_context11.prev = _context11.next) {
7037
+ switch (_context13.prev = _context13.next) {
6620
7038
  case 0:
6621
- return _context11.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
7039
+ return _context13.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
6622
7040
 
6623
7041
  case 1:
6624
7042
  case "end":
6625
- return _context11.stop();
7043
+ return _context13.stop();
6626
7044
  }
6627
7045
  }
6628
- }, _callee11, this);
7046
+ }, _callee13, this);
6629
7047
  }));
6630
7048
 
6631
- function stake(_x10) {
7049
+ function stake(_x12) {
6632
7050
  return _stake.apply(this, arguments);
6633
7051
  }
6634
7052
 
@@ -6636,22 +7054,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
6636
7054
  }();
6637
7055
 
6638
7056
  _proto2.unstake = /*#__PURE__*/function () {
6639
- var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(amount) {
6640
- return runtime_1.wrap(function _callee12$(_context12) {
7057
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(amount) {
7058
+ return runtime_1.wrap(function _callee14$(_context14) {
6641
7059
  while (1) {
6642
- switch (_context12.prev = _context12.next) {
7060
+ switch (_context14.prev = _context14.next) {
6643
7061
  case 0:
6644
- return _context12.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
7062
+ return _context14.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
6645
7063
 
6646
7064
  case 1:
6647
7065
  case "end":
6648
- return _context12.stop();
7066
+ return _context14.stop();
6649
7067
  }
6650
7068
  }
6651
- }, _callee12, this);
7069
+ }, _callee14, this);
6652
7070
  }));
6653
7071
 
6654
- function unstake(_x11) {
7072
+ function unstake(_x13) {
6655
7073
  return _unstake.apply(this, arguments);
6656
7074
  }
6657
7075
 
@@ -6685,5 +7103,5 @@ BigNumber.config({
6685
7103
  DECIMAL_PLACES: 50
6686
7104
  });
6687
7105
 
6688
- export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchHistoricalLPPositions, fetchHistoricalLPPrice, fetchHistoricalPULPPrice, fetchHistoricalPrice, fetchHistoricalPriceByLP, fetchHistoricalPriceFromOracle, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromDefiLlama, fetchPriceFromDefiLlamaAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
7106
+ export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, CACHE_TIMEOUT, Cache, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcNetApy, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchHistoricalLPPositions, fetchHistoricalLPPrice, fetchHistoricalPULPPrice, fetchHistoricalPrice, fetchHistoricalPriceByLP, fetchHistoricalPriceFromOracle, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromDefiLlama, fetchPriceFromDefiLlamaAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
6689
7107
  //# sourceMappingURL=sdk.esm.js.map