@curvefi/api 2.16.0 → 2.16.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.
|
@@ -41,7 +41,8 @@ exports.LINK_COINS_ETHEREUM = {
|
|
|
41
41
|
exports.EUR_COINS_ETHEREUM = {
|
|
42
42
|
eurs: "0xdB25f211AB05b1c97D595516F45794528a807ad8",
|
|
43
43
|
seur: "0xD71eCFF9342A5Ced620049e616c5035F1dB98620",
|
|
44
|
-
eurt: "0xC581b735A1688071A1746c968e0798D642EDE491",
|
|
44
|
+
eurt: "0xC581b735A1688071A1746c968e0798D642EDE491",
|
|
45
|
+
euroc: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
|
|
45
46
|
};
|
|
46
47
|
exports.USD_COINS_ETHEREUM = {
|
|
47
48
|
ycdai: "0x99d1Fa417f94dcD62BfE781a1213c092a47041Bc",
|
|
@@ -21,7 +21,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
21
21
|
reference_asset: "USD",
|
|
22
22
|
swap_address: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
|
|
23
23
|
token_address: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
|
|
24
|
-
// gauge_address: '0xbF7E49483881C76487b0989CD7d9A8239B20CA41', // Rewards-Only
|
|
25
24
|
gauge_address: '0xCE5F24B7A95e9cBa7df4B54E911B4A3Dc8CDAf6f',
|
|
26
25
|
is_plain: true,
|
|
27
26
|
underlying_coins: ['USDC', 'USDT'],
|
|
@@ -47,7 +46,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
47
46
|
is_crypto: true,
|
|
48
47
|
swap_address: '0x960ea3e3C7FB317332d990873d354E18d7645590',
|
|
49
48
|
token_address: '0x8e0B8c8BB9db49a46697F3a5Bb8A308e744821D2',
|
|
50
|
-
// gauge_address: '0x97E2768e8E73511cA874545DC5Ff8067eB19B787', // Rewards-Only
|
|
51
49
|
gauge_address: '0x555766f3da968ecBefa690Ffd49A2Ac02f47aa5f',
|
|
52
50
|
deposit_address: '0xF97c707024ef0DD3E77a0824555a46B622bfB500',
|
|
53
51
|
underlying_coins: ['USDT', 'WBTC', 'ETH'],
|
|
@@ -76,7 +74,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
76
74
|
is_plain: true,
|
|
77
75
|
swap_address: '0x3E01dD8a5E1fb3481F0F589056b428Fc308AF0Fb',
|
|
78
76
|
token_address: '0x3E01dD8a5E1fb3481F0F589056b428Fc308AF0Fb',
|
|
79
|
-
// gauge_address: '0xC2b1DF84112619D190193E48148000e3990Bf627', // Rewards-Only
|
|
80
77
|
gauge_address: '0xDB3fd1bfC67b5D4325cb31C04E0Cae52f1787FD6',
|
|
81
78
|
underlying_coins: ['WBTC', 'renBTC'],
|
|
82
79
|
wrapped_coins: ['WBTC', 'renBTC'],
|
|
@@ -100,7 +97,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
100
97
|
reference_asset: 'CRYPTO',
|
|
101
98
|
swap_address: '0xA827a652Ead76c6B0b3D19dba05452E06e25c27e',
|
|
102
99
|
token_address: '0x3dFe1324A0ee9d86337d06aEB829dEb4528DB9CA',
|
|
103
|
-
// gauge_address: '0x37C7ef6B0E23C9bd9B620A6daBbFEC13CE30D824', // Rewards-Only
|
|
104
100
|
gauge_address: '0x6339eF8Df0C2d3d3E7eE697E241666a916B81587',
|
|
105
101
|
deposit_address: '0x25e2e8d104BC1A70492e2BE32dA7c1f8367F9d2c',
|
|
106
102
|
is_meta: true,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.POOLS_DATA_OPTIMISM = void 0;
|
|
7
7
|
var swap_json_1 = __importDefault(require("../abis/3pool-optimism/swap.json"));
|
|
8
8
|
var swap_json_2 = __importDefault(require("../abis/wsteth/swap.json"));
|
|
9
|
-
var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
|
|
10
9
|
var gauge_child_json_1 = __importDefault(require("../abis/gauge_child.json"));
|
|
11
10
|
var utils_1 = require("../utils");
|
|
12
11
|
exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
@@ -18,7 +17,7 @@ exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
18
17
|
is_plain: true,
|
|
19
18
|
swap_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
20
19
|
token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
21
|
-
gauge_address: '
|
|
20
|
+
gauge_address: '0x15F52286C0FF1d7A7dDbC9E300dd66628D46D4e6',
|
|
22
21
|
underlying_coins: ['DAI', 'USDC', 'USDT'],
|
|
23
22
|
wrapped_coins: ['DAI', 'USDC', 'USDT'],
|
|
24
23
|
underlying_coin_addresses: [
|
|
@@ -34,7 +33,7 @@ exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
34
33
|
underlying_decimals: [18, 6, 6],
|
|
35
34
|
wrapped_decimals: [18, 6, 6],
|
|
36
35
|
swap_abi: swap_json_1.default,
|
|
37
|
-
gauge_abi:
|
|
36
|
+
gauge_abi: gauge_child_json_1.default,
|
|
38
37
|
},
|
|
39
38
|
wsteth: {
|
|
40
39
|
name: "wsteth",
|
|
@@ -10,6 +10,7 @@ var deposit_json_1 = __importDefault(require("../abis/rai/deposit.json"));
|
|
|
10
10
|
var swap_json_3 = __importDefault(require("../abis/tricrypto-xdai/swap.json"));
|
|
11
11
|
var zap_json_1 = __importDefault(require("../abis/tricrypto-xdai/zap.json"));
|
|
12
12
|
var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
|
|
13
|
+
var gauge_child_json_1 = __importDefault(require("../abis/gauge_child.json"));
|
|
13
14
|
var streamer_json_1 = __importDefault(require("../abis/streamer.json"));
|
|
14
15
|
var utils_1 = require("../utils");
|
|
15
16
|
exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
@@ -20,7 +21,7 @@ exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
20
21
|
reference_asset: 'USD',
|
|
21
22
|
swap_address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353',
|
|
22
23
|
token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
23
|
-
gauge_address: '
|
|
24
|
+
gauge_address: '0xb721cc32160ab0da2614cc6ab16ed822aeebc101',
|
|
24
25
|
sCurveRewards_address: '0x6C09F6727113543Fd061a721da512B7eFCDD0267',
|
|
25
26
|
is_plain: true,
|
|
26
27
|
underlying_coins: ['WXDAI', 'USDC', 'USDT'],
|
|
@@ -38,7 +39,7 @@ exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
38
39
|
underlying_decimals: [18, 6, 6],
|
|
39
40
|
wrapped_decimals: [18, 6, 6],
|
|
40
41
|
swap_abi: swap_json_1.default,
|
|
41
|
-
gauge_abi:
|
|
42
|
+
gauge_abi: gauge_child_json_1.default,
|
|
42
43
|
sCurveRewards_abi: streamer_json_1.default,
|
|
43
44
|
},
|
|
44
45
|
rai: {
|
|
@@ -365,16 +365,18 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
365
365
|
if (isDeposit === void 0) { isDeposit = true; }
|
|
366
366
|
if (useUnderlying === void 0) { useUnderlying = true; }
|
|
367
367
|
return __awaiter(_this, void 0, void 0, function () {
|
|
368
|
-
var
|
|
368
|
+
var _rates, e_1, lpContract, _lpTotalSupply, decimals_1, amounts, seedAmounts_1, N_coins, decimals_2, calcContractAddress, calcContract, poolContract, lpContract, calls, res, _c, _totalSupply, _fee, _lpTokenAmount, balances, _d, totalSupplyBN, feeBN, lpTokenAmountBN, balancesBN, amountsBN, feesBN, i, _fees, _lpTokenFee, e_2, lpContract, _lpTotalSupply, decimals_3, amounts_1, _amounts18Decimals;
|
|
369
369
|
return __generator(this, function (_e) {
|
|
370
370
|
switch (_e.label) {
|
|
371
371
|
case 0:
|
|
372
|
+
_rates = [];
|
|
372
373
|
if (!(!this.isMeta && useUnderlying)) return [3 /*break*/, 2];
|
|
373
374
|
return [4 /*yield*/, this._getRates()];
|
|
374
375
|
case 1:
|
|
375
|
-
|
|
376
|
+
// For lending pools. For others rate = 1
|
|
377
|
+
_rates = _e.sent();
|
|
376
378
|
_amounts = _amounts.map(function (_amount, i) {
|
|
377
|
-
return _amount.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(
|
|
379
|
+
return _amount.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(_rates[i]);
|
|
378
380
|
});
|
|
379
381
|
_e.label = 2;
|
|
380
382
|
case 2:
|
|
@@ -443,6 +445,11 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
443
445
|
}
|
|
444
446
|
}
|
|
445
447
|
_fees = feesBN.map(function (fBN, i) { return (0, utils_1.fromBN)(fBN, decimals_2[i]); });
|
|
448
|
+
if (!this.isMeta && useUnderlying) {
|
|
449
|
+
_fees = _fees.map(function (_fee, i) {
|
|
450
|
+
return _fee.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(_rates[i]);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
446
453
|
return [4 /*yield*/, this._pureCalcLpTokenAmount(_fees, !isDeposit, useUnderlying)];
|
|
447
454
|
case 10:
|
|
448
455
|
_lpTokenFee = _e.sent();
|