@curvefi/api 2.52.3 → 2.52.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/factory/deploy.js +3 -2
- package/lib/pools/PoolTemplate.js +12 -19
- package/package.json +1 -1
package/lib/factory/deploy.js
CHANGED
|
@@ -375,7 +375,7 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
|
|
|
375
375
|
if (methodName === void 0) { methodName = "0x00000000"; }
|
|
376
376
|
if (oracleAddress === void 0) { oracleAddress = curve.constants.ZERO_ADDRESS; }
|
|
377
377
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
378
|
-
var _A, _fee, methodId, contract, gas, gasLimit;
|
|
378
|
+
var _A, _fee, _offpegFeeMultiplier, methodId, contract, gas, gasLimit;
|
|
379
379
|
return __generator(this, function (_a) {
|
|
380
380
|
switch (_a.label) {
|
|
381
381
|
case 0:
|
|
@@ -391,9 +391,10 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
|
|
|
391
391
|
throw Error("Invalid implementationIdx. Must be one 0 or 1");
|
|
392
392
|
_A = parseUnits(A, 0);
|
|
393
393
|
_fee = parseUnits(fee, 8);
|
|
394
|
+
_offpegFeeMultiplier = parseUnits(offpegFeeMultiplier, 10);
|
|
394
395
|
methodId = methodName === "0x00000000" ? "0x00000000" : ethers.id(methodName).substring(0, 10);
|
|
395
396
|
contract = curve.contracts[curve.constants.ALIASES.stable_ng_factory].contract;
|
|
396
|
-
return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee,
|
|
397
|
+
return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, _offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
|
|
397
398
|
case 1:
|
|
398
399
|
gas = _a.sent();
|
|
399
400
|
if (estimateGas)
|
|
@@ -1403,34 +1403,27 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
1403
1403
|
};
|
|
1404
1404
|
PoolTemplate.prototype.depositBonus = function (amounts) {
|
|
1405
1405
|
return __awaiter(this, void 0, void 0, function () {
|
|
1406
|
-
var amountsBN, prices,
|
|
1407
|
-
return __generator(this, function (
|
|
1408
|
-
switch (
|
|
1406
|
+
var amountsBN, prices, pricesBN, balancesBN, balancedAmounts, expectedBN, _c, balancedExpectedBN, _d;
|
|
1407
|
+
return __generator(this, function (_e) {
|
|
1408
|
+
switch (_e.label) {
|
|
1409
1409
|
case 0:
|
|
1410
1410
|
amountsBN = amounts.map(BN);
|
|
1411
|
-
if (!(this.isCrypto || this.id === 'wsteth')) return [3 /*break*/, 2];
|
|
1412
1411
|
return [4 /*yield*/, this._underlyingPrices()];
|
|
1413
1412
|
case 1:
|
|
1414
|
-
|
|
1415
|
-
return [3 /*break*/, 3];
|
|
1416
|
-
case 2:
|
|
1417
|
-
_c = this.underlyingCoins.map(function () { return 1; });
|
|
1418
|
-
_f.label = 3;
|
|
1419
|
-
case 3:
|
|
1420
|
-
prices = _c;
|
|
1413
|
+
prices = _e.sent();
|
|
1421
1414
|
pricesBN = prices.map(BN);
|
|
1422
1415
|
return [4 /*yield*/, this.stats.underlyingBalances()];
|
|
1423
|
-
case
|
|
1424
|
-
balancesBN = (
|
|
1416
|
+
case 2:
|
|
1417
|
+
balancesBN = (_e.sent()).map(BN);
|
|
1425
1418
|
balancedAmounts = this._balancedAmountsWithSameValue(amountsBN, pricesBN, balancesBN);
|
|
1426
|
-
|
|
1419
|
+
_c = BN;
|
|
1427
1420
|
return [4 /*yield*/, this.depositExpected(amounts)];
|
|
1428
|
-
case
|
|
1429
|
-
expectedBN =
|
|
1430
|
-
|
|
1421
|
+
case 3:
|
|
1422
|
+
expectedBN = _c.apply(void 0, [_e.sent()]);
|
|
1423
|
+
_d = BN;
|
|
1431
1424
|
return [4 /*yield*/, this.depositExpected(balancedAmounts)];
|
|
1432
|
-
case
|
|
1433
|
-
balancedExpectedBN =
|
|
1425
|
+
case 4:
|
|
1426
|
+
balancedExpectedBN = _d.apply(void 0, [_e.sent()]);
|
|
1434
1427
|
return [2 /*return*/, String(expectedBN.minus(balancedExpectedBN).div(balancedExpectedBN).times(100))];
|
|
1435
1428
|
}
|
|
1436
1429
|
});
|