@defisaver/positions-sdk 0.0.201-fluid-dev-9 → 0.0.201-fluid-dev-11
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/cjs/aaveV2/index.js +1 -1
- package/cjs/config/contracts.d.ts +87 -6
- package/cjs/config/contracts.js +15 -2
- package/cjs/fluid/index.d.ts +25 -2
- package/cjs/fluid/index.js +1 -1
- package/cjs/helpers/liquityV2Helpers/index.js +2 -2
- package/cjs/liquityV2/index.d.ts +9 -4
- package/cjs/liquityV2/index.js +69 -10
- package/cjs/markets/index.d.ts +1 -1
- package/cjs/markets/index.js +2 -1
- package/cjs/markets/liquityV2/index.d.ts +2 -1
- package/cjs/markets/liquityV2/index.js +12 -1
- package/cjs/markets/spark/marketAssets.js +1 -1
- package/cjs/morphoAaveV2/index.js +1 -1
- package/cjs/morphoAaveV3/index.js +1 -2
- package/cjs/spark/index.js +1 -2
- package/cjs/staking/staking.d.ts +1 -6
- package/cjs/staking/staking.js +20 -23
- package/cjs/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
- package/cjs/types/contracts/generated/LiquityV2StabilityPool.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +144 -2
- package/cjs/types/contracts/generated/index.d.ts +1 -0
- package/cjs/types/liquityV2.d.ts +1 -0
- package/esm/aaveV2/index.js +2 -2
- package/esm/config/contracts.d.ts +87 -6
- package/esm/config/contracts.js +15 -2
- package/esm/fluid/index.d.ts +25 -2
- package/esm/fluid/index.js +1 -1
- package/esm/helpers/liquityV2Helpers/index.js +2 -2
- package/esm/liquityV2/index.d.ts +9 -4
- package/esm/liquityV2/index.js +64 -10
- package/esm/markets/index.d.ts +1 -1
- package/esm/markets/index.js +1 -1
- package/esm/markets/liquityV2/index.d.ts +2 -1
- package/esm/markets/liquityV2/index.js +10 -0
- package/esm/markets/spark/marketAssets.js +1 -1
- package/esm/morphoAaveV2/index.js +2 -2
- package/esm/morphoAaveV3/index.js +1 -2
- package/esm/spark/index.js +1 -2
- package/esm/staking/staking.d.ts +1 -6
- package/esm/staking/staking.js +24 -22
- package/esm/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
- package/esm/types/contracts/generated/LiquityV2StabilityPool.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +144 -2
- package/esm/types/contracts/generated/index.d.ts +1 -0
- package/esm/types/liquityV2.d.ts +1 -0
- package/package.json +2 -1
- package/src/aaveV2/index.ts +2 -2
- package/src/config/contracts.js +15 -2
- package/src/fluid/index.ts +1 -1
- package/src/helpers/liquityV2Helpers/index.ts +3 -3
- package/src/liquityV2/index.ts +79 -12
- package/src/markets/index.ts +1 -1
- package/src/markets/liquityV2/index.ts +13 -2
- package/src/markets/spark/marketAssets.ts +1 -1
- package/src/morphoAaveV2/index.ts +2 -2
- package/src/morphoAaveV3/index.ts +1 -2
- package/src/spark/index.ts +1 -2
- package/src/staking/staking.ts +22 -22
- package/src/types/contracts/generated/LiquityV2StabilityPool.ts +453 -0
- package/src/types/contracts/generated/LiquityV2View.ts +173 -2
- package/src/types/contracts/generated/index.ts +1 -0
- package/src/types/liquityV2.ts +1 -0
- package/cjs/services/dsrService.d.ts +0 -3
- package/cjs/services/dsrService.js +0 -28
- package/esm/services/dsrService.d.ts +0 -3
- package/esm/services/dsrService.js +0 -21
- package/src/services/dsrService.ts +0 -16
package/cjs/liquityV2/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getLiquityV2ClaimableCollateral = exports.getLiquityV2TroveData = exports.getDebtInFrontLiquityV2 = exports.getLiquityV2UserTroveIds = exports.getLiquityV2MarketData = void 0;
|
|
15
|
+
exports.getLiquityV2ClaimableCollateral = exports.getLiquityV2TroveData = exports.getDebtInFrontForInterestRateLiquityV2 = exports.getDebtInFrontLiquityV2 = exports.calculateDebtInFrontLiquityV2 = exports.getAllMarketsUnbackedDebts = exports.getDebtInFrontForInterestRateSingleMarketLiquityV2 = exports.getDebtInFrontForSingleMarketLiquityV2 = exports.getLiquityV2UserTroveIds = exports.getLiquityV2MarketData = void 0;
|
|
16
16
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
17
17
|
const tokens_1 = require("@defisaver/tokens");
|
|
18
18
|
const contracts_1 = require("../contracts");
|
|
@@ -21,6 +21,7 @@ const staking_1 = require("../staking");
|
|
|
21
21
|
const liquityV2Helpers_1 = require("../helpers/liquityV2Helpers");
|
|
22
22
|
const utils_1 = require("../services/utils");
|
|
23
23
|
const constants_1 = require("../constants");
|
|
24
|
+
const markets_1 = require("../markets");
|
|
24
25
|
const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
26
|
const viewContract = (0, contracts_1.LiquityV2ViewContract)(web3, network);
|
|
26
27
|
const { marketAddress, debtToken, collateralToken } = selectedMarket;
|
|
@@ -133,22 +134,78 @@ const getLiquityV2UserTroveIds = (web3, network, selectedMarket, troveNFTAddress
|
|
|
133
134
|
return { troves: filteredTroves, nextFreeTroveIndex };
|
|
134
135
|
});
|
|
135
136
|
exports.getLiquityV2UserTroveIds = getLiquityV2UserTroveIds;
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
const { debt, next } = yield
|
|
137
|
+
const _getDebtInFrontForSingleMarket = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () { return viewContract.methods.getDebtInFront(marketAddress, troveId, accumulatedSum, iterations).call(); });
|
|
138
|
+
const getDebtInFrontForSingleMarketLiquityV2 = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () {
|
|
139
|
+
const { debt, next } = yield _getDebtInFrontForSingleMarket(viewContract, marketAddress, troveId, accumulatedSum, iterations);
|
|
139
140
|
if (next === '0')
|
|
140
141
|
return (0, tokens_1.assetAmountInEth)(debt);
|
|
141
|
-
return (0, exports.
|
|
142
|
+
return (0, exports.getDebtInFrontForSingleMarketLiquityV2)(viewContract, marketAddress, next, debt, iterations);
|
|
143
|
+
});
|
|
144
|
+
exports.getDebtInFrontForSingleMarketLiquityV2 = getDebtInFrontForSingleMarketLiquityV2;
|
|
145
|
+
const _getDebtInFrontForInterestRateSingleMarketLiquityV2 = (viewContract, marketAddress, troveId = '0', accumulatedSum = '0', iterations = 2000, interestRate) => __awaiter(void 0, void 0, void 0, function* () { return viewContract.methods.getDebtInFrontByInterestRate(marketAddress, troveId, accumulatedSum, iterations, interestRate).call(); });
|
|
146
|
+
const getDebtInFrontForInterestRateSingleMarketLiquityV2 = (viewContract, marketAddress, interestRate, troveId = '0', accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () {
|
|
147
|
+
if (+interestRate === 0 || !interestRate)
|
|
148
|
+
return '0';
|
|
149
|
+
const interestRateWei = new decimal_js_1.default(interestRate).times(1e16).toFixed(0).toString();
|
|
150
|
+
const res = yield _getDebtInFrontForInterestRateSingleMarketLiquityV2(viewContract, marketAddress, troveId, accumulatedSum, iterations, interestRateWei);
|
|
151
|
+
const { debt, next } = res;
|
|
152
|
+
if (next === '0')
|
|
153
|
+
return (0, tokens_1.assetAmountInEth)(debt);
|
|
154
|
+
return (0, exports.getDebtInFrontForInterestRateSingleMarketLiquityV2)(viewContract, marketAddress, interestRate, next, debt, iterations);
|
|
155
|
+
});
|
|
156
|
+
exports.getDebtInFrontForInterestRateSingleMarketLiquityV2 = getDebtInFrontForInterestRateSingleMarketLiquityV2;
|
|
157
|
+
const getUnbackedDebtForSingleMarket = (totalBorrowed, web3, network, stabilityPoolAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
158
|
+
const stabilityPoolContract = (0, contracts_1.createContractWrapper)(web3, network, 'LiquityV2StabilityPool', stabilityPoolAddress);
|
|
159
|
+
const totalBoldDeposits = yield stabilityPoolContract.methods.getTotalBoldDeposits().call();
|
|
160
|
+
const totalBoldDepositsInEth = (0, tokens_1.assetAmountInEth)(totalBoldDeposits);
|
|
161
|
+
return decimal_js_1.default.max(new decimal_js_1.default(totalBorrowed).sub(totalBoldDepositsInEth), 0).toString();
|
|
162
|
+
});
|
|
163
|
+
const getAllMarketsUnbackedDebts = (markets, web3, network) => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
|
+
const allMarketsUnbackedDebt = yield Promise.all(Object.entries(markets).map(([version, market]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
|
+
const { assetsData, marketData } = market;
|
|
166
|
+
const unbackedDebt = yield getUnbackedDebtForSingleMarket(assetsData.BOLD.totalBorrow, web3, network, marketData.stabilityPoolAddress);
|
|
167
|
+
return [version, unbackedDebt];
|
|
168
|
+
})));
|
|
169
|
+
return Object.fromEntries(allMarketsUnbackedDebt);
|
|
170
|
+
});
|
|
171
|
+
exports.getAllMarketsUnbackedDebts = getAllMarketsUnbackedDebts;
|
|
172
|
+
const calculateDebtInFrontLiquityV2 = (markets, selectedMarket, allMarketsUnbackedDebts, interestRateDebtInFront) => {
|
|
173
|
+
const selectedMarketUnbackedDebt = new decimal_js_1.default(allMarketsUnbackedDebts[selectedMarket]);
|
|
174
|
+
if (selectedMarketUnbackedDebt.eq(0))
|
|
175
|
+
return 'N/A';
|
|
176
|
+
const amountBeingReedemedOnEachMarket = Object.entries(markets).map(([version, market]) => {
|
|
177
|
+
if (version === selectedMarket)
|
|
178
|
+
return new decimal_js_1.default(interestRateDebtInFront);
|
|
179
|
+
const { assetsData } = market;
|
|
180
|
+
const unbackedDebt = new decimal_js_1.default(allMarketsUnbackedDebts[version]);
|
|
181
|
+
const totalBorrow = new decimal_js_1.default(assetsData.BOLD.totalBorrow);
|
|
182
|
+
const amountToReedem = new decimal_js_1.default(interestRateDebtInFront).mul(unbackedDebt).div(selectedMarketUnbackedDebt);
|
|
183
|
+
return decimal_js_1.default.min(amountToReedem, totalBorrow);
|
|
184
|
+
});
|
|
185
|
+
return amountBeingReedemedOnEachMarket.reduce((acc, val) => acc.plus(val), new decimal_js_1.default(0)).toString();
|
|
186
|
+
};
|
|
187
|
+
exports.calculateDebtInFrontLiquityV2 = calculateDebtInFrontLiquityV2;
|
|
188
|
+
const getDebtInFrontLiquityV2 = (markets, selectedMarket, web3, network, viewContract, troveId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
189
|
+
const allMarketsUnbackedDebts = yield (0, exports.getAllMarketsUnbackedDebts)(markets, web3, network);
|
|
190
|
+
const interestRateDebtInFront = yield (0, exports.getDebtInFrontForSingleMarketLiquityV2)(viewContract, (0, markets_1.LiquityV2Markets)(network)[selectedMarket].marketAddress, troveId);
|
|
191
|
+
return (0, exports.calculateDebtInFrontLiquityV2)(markets, selectedMarket, allMarketsUnbackedDebts, interestRateDebtInFront.toString());
|
|
142
192
|
});
|
|
143
193
|
exports.getDebtInFrontLiquityV2 = getDebtInFrontLiquityV2;
|
|
144
|
-
const
|
|
194
|
+
const getDebtInFrontForInterestRateLiquityV2 = (markets, selectedMarket, web3, network, viewContract, interestRate) => __awaiter(void 0, void 0, void 0, function* () {
|
|
195
|
+
const allMarketsUnbackedDebts = yield (0, exports.getAllMarketsUnbackedDebts)(markets, web3, network);
|
|
196
|
+
const interestRateDebtInFront = new decimal_js_1.default(yield (0, exports.getDebtInFrontForInterestRateSingleMarketLiquityV2)(viewContract, (0, markets_1.LiquityV2Markets)(network)[selectedMarket].marketAddress, interestRate));
|
|
197
|
+
return (0, exports.calculateDebtInFrontLiquityV2)(markets, selectedMarket, allMarketsUnbackedDebts, interestRateDebtInFront.toString());
|
|
198
|
+
});
|
|
199
|
+
exports.getDebtInFrontForInterestRateLiquityV2 = getDebtInFrontForInterestRateLiquityV2;
|
|
200
|
+
const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, troveId, allMarketsData, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
201
|
const viewContract = (0, contracts_1.LiquityV2ViewContract)(web3, network);
|
|
146
|
-
const { minCollRatio } = marketData;
|
|
202
|
+
const { minCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
147
203
|
const { collateralToken, marketAddress, debtToken } = selectedMarket;
|
|
148
|
-
const [
|
|
204
|
+
const [_data, debtInFront] = yield Promise.all([
|
|
149
205
|
viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
|
|
150
|
-
(0, exports.getDebtInFrontLiquityV2)(
|
|
206
|
+
(0, exports.getDebtInFrontLiquityV2)(allMarketsData, selectedMarket.value, web3, network, viewContract, troveId),
|
|
151
207
|
]);
|
|
208
|
+
const data = Object.assign(Object.assign({}, _data), { TCRatio: _data.TCRatio === utils_1.MAXUINT ? '0' : _data.TCRatio });
|
|
152
209
|
const usedAssets = {};
|
|
153
210
|
const debtAssetData = assetsData[debtToken];
|
|
154
211
|
const borrowed = (0, tokens_1.assetAmountInEth)(data.debtAmount);
|
|
@@ -176,11 +233,13 @@ const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, mark
|
|
|
176
233
|
const collRatio = new decimal_js_1.default(data.TCRatio).div(1e16).toString();
|
|
177
234
|
const interestRate = new decimal_js_1.default(data.annualInterestRate).div(1e16).toString();
|
|
178
235
|
const interestBatchManager = data.interestBatchManager;
|
|
236
|
+
const lastInterestRateAdjTime = data.lastInterestRateAdjTime;
|
|
179
237
|
const payload = Object.assign(Object.assign({ usedAssets,
|
|
180
238
|
troveId,
|
|
181
239
|
interestRate,
|
|
182
240
|
interestBatchManager,
|
|
183
|
-
debtInFront,
|
|
241
|
+
debtInFront,
|
|
242
|
+
lastInterestRateAdjTime, troveStatus: types_1.LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
|
|
184
243
|
usedAssets, assetsData, minCollRatio, interestRate,
|
|
185
244
|
})), { collRatio });
|
|
186
245
|
return payload;
|
package/cjs/markets/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export { SparkMarkets } from './spark';
|
|
|
4
4
|
export { CrvUsdMarkets } from './curveUsd';
|
|
5
5
|
export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
|
|
6
6
|
export { LlamaLendMarkets } from './llamaLend';
|
|
7
|
-
export { LiquityV2Markets } from './liquityV2';
|
|
7
|
+
export { LiquityV2Markets, findLiquityV2MarketByAddress } from './liquityV2';
|
|
8
8
|
export { EulerV2Markets } from './euler';
|
|
9
9
|
export { FluidMarkets, getFluidVersionsDataForNetwork, getFluidMarketInfoById, getFTokenAddress, } from './fluid';
|
package/cjs/markets/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFTokenAddress = exports.getFluidMarketInfoById = exports.getFluidVersionsDataForNetwork = exports.FluidMarkets = exports.EulerV2Markets = exports.LiquityV2Markets = exports.LlamaLendMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.morphoAaveV3AssetEthMarket = exports.morphoAaveV2AssetDefaultMarket = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
|
|
3
|
+
exports.getFTokenAddress = exports.getFluidMarketInfoById = exports.getFluidVersionsDataForNetwork = exports.FluidMarkets = exports.EulerV2Markets = exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LlamaLendMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.morphoAaveV3AssetEthMarket = exports.morphoAaveV2AssetDefaultMarket = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
|
|
4
4
|
var aave_1 = require("./aave");
|
|
5
5
|
Object.defineProperty(exports, "AaveMarkets", { enumerable: true, get: function () { return aave_1.AaveMarkets; } });
|
|
6
6
|
Object.defineProperty(exports, "aaveV1AssetsDefaultMarket", { enumerable: true, get: function () { return aave_1.aaveV1AssetsDefaultMarket; } });
|
|
@@ -28,6 +28,7 @@ var llamaLend_1 = require("./llamaLend");
|
|
|
28
28
|
Object.defineProperty(exports, "LlamaLendMarkets", { enumerable: true, get: function () { return llamaLend_1.LlamaLendMarkets; } });
|
|
29
29
|
var liquityV2_1 = require("./liquityV2");
|
|
30
30
|
Object.defineProperty(exports, "LiquityV2Markets", { enumerable: true, get: function () { return liquityV2_1.LiquityV2Markets; } });
|
|
31
|
+
Object.defineProperty(exports, "findLiquityV2MarketByAddress", { enumerable: true, get: function () { return liquityV2_1.findLiquityV2MarketByAddress; } });
|
|
31
32
|
var euler_1 = require("./euler");
|
|
32
33
|
Object.defineProperty(exports, "EulerV2Markets", { enumerable: true, get: function () { return euler_1.EulerV2Markets; } });
|
|
33
34
|
var fluid_1 = require("./fluid");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NetworkNumber } from '../../types/common';
|
|
1
|
+
import { EthAddress, NetworkNumber } from '../../types/common';
|
|
2
2
|
import { LiquityV2MarketInfo } from '../../types/liquityV2';
|
|
3
3
|
export declare const LIQUITY_V2_ETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
4
4
|
export declare const LIQUITY_V2_WSTETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
@@ -8,3 +8,4 @@ export declare const LiquityV2Markets: (networkId: NetworkNumber) => {
|
|
|
8
8
|
readonly liquityv2wsteth: LiquityV2MarketInfo;
|
|
9
9
|
readonly liquityv2reth: LiquityV2MarketInfo;
|
|
10
10
|
};
|
|
11
|
+
export declare const findLiquityV2MarketByAddress: (marketAddress: EthAddress) => LiquityV2MarketInfo | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LiquityV2Markets = exports.LIQUITY_V2_RETH_MARKET = exports.LIQUITY_V2_WSTETH_MARKET = exports.LIQUITY_V2_ETH_MARKET = void 0;
|
|
3
|
+
exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LIQUITY_V2_RETH_MARKET = exports.LIQUITY_V2_WSTETH_MARKET = exports.LIQUITY_V2_ETH_MARKET = void 0;
|
|
4
|
+
const utils_1 = require("../../services/utils");
|
|
4
5
|
const common_1 = require("../../types/common");
|
|
5
6
|
const liquityV2_1 = require("../../types/liquityV2");
|
|
6
7
|
const LIQUITY_V2_ETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
@@ -45,3 +46,13 @@ const LiquityV2Markets = (networkId) => ({
|
|
|
45
46
|
[liquityV2_1.LiquityV2Versions.LiquityV2REth]: (0, exports.LIQUITY_V2_RETH_MARKET)(networkId),
|
|
46
47
|
});
|
|
47
48
|
exports.LiquityV2Markets = LiquityV2Markets;
|
|
49
|
+
const findLiquityV2MarketByAddress = (marketAddress) => {
|
|
50
|
+
const markets = (0, exports.LiquityV2Markets)(common_1.NetworkNumber.Eth);
|
|
51
|
+
for (const market of Object.values(markets)) {
|
|
52
|
+
if ((0, utils_1.compareAddresses)(market.marketAddress, marketAddress)) {
|
|
53
|
+
return market;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
};
|
|
58
|
+
exports.findLiquityV2MarketByAddress = findLiquityV2MarketByAddress;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sparkAssetsDefaultMarket = exports.sparkAssetsDefaultMarketEth = void 0;
|
|
4
4
|
const common_1 = require("../../types/common");
|
|
5
|
-
exports.sparkAssetsDefaultMarketEth = ['DAI', 'sDAI', 'USDC', 'ETH', 'wstETH', 'WBTC', 'GNO', 'rETH', 'USDT', 'weETH', 'cbBTC', 'sUSDS'];
|
|
5
|
+
exports.sparkAssetsDefaultMarketEth = ['DAI', 'sDAI', 'USDC', 'ETH', 'wstETH', 'WBTC', 'GNO', 'rETH', 'USDT', 'weETH', 'cbBTC', 'sUSDS', 'USDS'];
|
|
6
6
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
7
7
|
exports.sparkAssetsDefaultMarket = {
|
|
8
8
|
[common_1.NetworkNumber.Eth]: exports.sparkAssetsDefaultMarketEth,
|
|
@@ -93,7 +93,7 @@ const getMorphoAaveV2MarketsData = (web3, network, mainnetWeb3) => __awaiter(voi
|
|
|
93
93
|
});
|
|
94
94
|
const stEthMarket = assetsData.find(({ symbol }) => symbol === 'stETH');
|
|
95
95
|
if (stEthMarket) {
|
|
96
|
-
stEthMarket.incentiveSupplyApy = yield (0, staking_1.
|
|
96
|
+
stEthMarket.incentiveSupplyApy = yield (0, staking_1.getStakingApy)('stETH', mainnetWeb3);
|
|
97
97
|
stEthMarket.incentiveSupplyToken = 'stETH';
|
|
98
98
|
}
|
|
99
99
|
const payload = {};
|
|
@@ -23,7 +23,6 @@ const utils_1 = require("../services/utils");
|
|
|
23
23
|
const contracts_1 = require("../contracts");
|
|
24
24
|
const multicall_1 = require("../multicall");
|
|
25
25
|
const staking_1 = require("../staking");
|
|
26
|
-
const dsrService_1 = require("../services/dsrService");
|
|
27
26
|
const moneymarket_1 = require("../moneymarket");
|
|
28
27
|
const aaveV3_1 = require("../aaveV3");
|
|
29
28
|
const aaveHelpers_1 = require("../helpers/aaveHelpers");
|
|
@@ -239,7 +238,7 @@ const getMorphoAaveV3MarketsData = (web3, network, selectedMarket, mainnetWeb3)
|
|
|
239
238
|
data.incentiveSupplyToken = data.symbol;
|
|
240
239
|
}
|
|
241
240
|
if (data.symbol === 'sDAI') {
|
|
242
|
-
data.incentiveSupplyApy = yield (0,
|
|
241
|
+
data.incentiveSupplyApy = yield (0, staking_1.getStakingApy)('sDAI', mainnetWeb3);
|
|
243
242
|
data.incentiveSupplyToken = 'sDAI';
|
|
244
243
|
}
|
|
245
244
|
return data;
|
package/cjs/spark/index.js
CHANGED
|
@@ -17,7 +17,6 @@ const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
|
17
17
|
const tokens_1 = require("@defisaver/tokens");
|
|
18
18
|
const utils_1 = require("../services/utils");
|
|
19
19
|
const staking_1 = require("../staking");
|
|
20
|
-
const dsrService_1 = require("../services/dsrService");
|
|
21
20
|
const contracts_1 = require("../contracts");
|
|
22
21
|
const multicall_1 = require("../multicall");
|
|
23
22
|
const sparkHelpers_1 = require("../helpers/sparkHelpers");
|
|
@@ -138,7 +137,7 @@ const getSparkMarketsData = (web3, network, selectedMarket, mainnetWeb3) => __aw
|
|
|
138
137
|
});
|
|
139
138
|
}
|
|
140
139
|
if (market.symbol === 'sDAI') {
|
|
141
|
-
market.incentiveSupplyApy = yield (0,
|
|
140
|
+
market.incentiveSupplyApy = yield (0, staking_1.getStakingApy)('sDAI', mainnetWeb3);
|
|
142
141
|
market.incentiveSupplyToken = 'sDAI';
|
|
143
142
|
}
|
|
144
143
|
if (market.canBeBorrowed && market.incentiveSupplyApy) {
|
package/cjs/staking/staking.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
2
|
import { MMAssetsData, MMUsedAssets } from '../types/common';
|
|
3
|
-
export declare const getStETHApy: (web3: Web3, fromBlock?: number, blockNumber?: 'latest' | number) => Promise<string>;
|
|
4
|
-
export declare const getCbETHApy: (web3: Web3, blockNumber?: 'latest' | number) => Promise<string>;
|
|
5
|
-
export declare const getREthApy: (web3: Web3, blockNumber?: 'latest' | number) => Promise<string>;
|
|
6
|
-
export declare const getDsrApy: (web3: Web3, blockNumber?: 'latest' | number) => Promise<string>;
|
|
7
|
-
export declare const getSsrApy: () => Promise<string>;
|
|
8
3
|
export declare const STAKING_ASSETS: string[];
|
|
9
|
-
export declare const getStakingApy: (asset: string, web3: Web3, blockNumber?: 'latest' | number, fromBlock?: number | undefined) =>
|
|
4
|
+
export declare const getStakingApy: (asset: string, web3: Web3, blockNumber?: 'latest' | number, fromBlock?: number | undefined) => Promise<string>;
|
|
10
5
|
export declare const calculateInterestEarned: (principal: string, interest: string, type: string, apy?: boolean) => number;
|
|
11
6
|
export declare const calculateNetApy: ({ usedAssets, assetsData, isMorpho }: {
|
|
12
7
|
usedAssets: MMUsedAssets;
|
package/cjs/staking/staking.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getStETHByWstETHMultiple = exports.getStETHByWstETH = exports.getWstETHByStETH = exports.calculateNetApy = exports.calculateInterestEarned = exports.getStakingApy = exports.STAKING_ASSETS =
|
|
15
|
+
exports.getStETHByWstETHMultiple = exports.getStETHByWstETH = exports.getWstETHByStETH = exports.calculateNetApy = exports.calculateInterestEarned = exports.getStakingApy = exports.STAKING_ASSETS = void 0;
|
|
16
16
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
17
17
|
const contracts_1 = require("../contracts");
|
|
18
18
|
const common_1 = require("../types/common");
|
|
@@ -40,7 +40,6 @@ const getStETHApy = (web3, fromBlock = 17900000, blockNumber = 'latest') => __aw
|
|
|
40
40
|
return (0, moneymarket_1.aprToApy)(data.data.smaApr);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
exports.getStETHApy = getStETHApy;
|
|
44
43
|
const getCbETHApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
44
|
let currentBlock = blockNumber;
|
|
46
45
|
if (blockNumber === 'latest')
|
|
@@ -58,7 +57,6 @@ const getCbETHApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0,
|
|
|
58
57
|
.toString();
|
|
59
58
|
return (0, moneymarket_1.aprToApy)(apr);
|
|
60
59
|
});
|
|
61
|
-
exports.getCbETHApy = getCbETHApy;
|
|
62
60
|
const getREthApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
61
|
let currentBlock = blockNumber;
|
|
64
62
|
if (blockNumber === 'latest')
|
|
@@ -76,7 +74,6 @@ const getREthApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0, v
|
|
|
76
74
|
.toString();
|
|
77
75
|
return (0, moneymarket_1.aprToApy)(apr);
|
|
78
76
|
});
|
|
79
|
-
exports.getREthApy = getREthApy;
|
|
80
77
|
const getDsrApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
78
|
const potContract = (0, contracts_1.PotContract)(web3, common_1.NetworkNumber.Eth);
|
|
82
79
|
return new decimal_js_1.default(yield potContract.methods.dsr().call())
|
|
@@ -86,13 +83,11 @@ const getDsrApy = (web3, blockNumber = 'latest') => __awaiter(void 0, void 0, vo
|
|
|
86
83
|
.mul(100)
|
|
87
84
|
.toString();
|
|
88
85
|
});
|
|
89
|
-
exports.getDsrApy = getDsrApy;
|
|
90
86
|
const getSsrApy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
91
87
|
const res = yield fetch('https://fe.defisaver.com/api/sky/data');
|
|
92
88
|
const data = yield res.json();
|
|
93
89
|
return new decimal_js_1.default(data.data.skyData[0].sky_savings_rate_apy).mul(100).toString();
|
|
94
90
|
});
|
|
95
|
-
exports.getSsrApy = getSsrApy;
|
|
96
91
|
const getSuperOETHApy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
92
|
const res = yield fetch('https://origin.squids.live/origin-squid/graphql', {
|
|
98
93
|
method: 'POST',
|
|
@@ -112,48 +107,50 @@ const getSuperOETHApy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
112
107
|
});
|
|
113
108
|
const getApyFromDfsApi = (asset) => __awaiter(void 0, void 0, void 0, function* () {
|
|
114
109
|
const res = yield fetch(`https://fe.defisaver.com/api/staking/apy?asset=${asset}`);
|
|
110
|
+
if (!res.ok)
|
|
111
|
+
throw new Error(`Failed to fetch APY for ${asset}`);
|
|
115
112
|
const data = yield res.json();
|
|
116
113
|
// if our server returns apr, transform it into apy
|
|
117
114
|
if (['weETH'].includes(asset)) {
|
|
118
115
|
return (0, moneymarket_1.aprToApy)(data.apy);
|
|
119
116
|
}
|
|
120
|
-
return data.apy;
|
|
117
|
+
return String(data.apy);
|
|
121
118
|
});
|
|
122
119
|
exports.STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS'];
|
|
123
|
-
const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefined) => {
|
|
120
|
+
const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefined) => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
121
|
try {
|
|
125
122
|
if (asset === 'stETH' || asset === 'wstETH')
|
|
126
|
-
return
|
|
123
|
+
return yield getStETHApy(web3, fromBlock, blockNumber);
|
|
127
124
|
if (asset === 'cbETH')
|
|
128
|
-
return
|
|
125
|
+
return yield getCbETHApy(web3, blockNumber);
|
|
129
126
|
if (asset === 'rETH')
|
|
130
|
-
return
|
|
127
|
+
return yield getREthApy(web3, blockNumber);
|
|
131
128
|
if (asset === 'sDAI')
|
|
132
|
-
return
|
|
129
|
+
return yield getDsrApy(web3);
|
|
133
130
|
if (asset === 'sUSDe')
|
|
134
|
-
return getApyFromDfsApi('sUSDe');
|
|
131
|
+
return yield getApyFromDfsApi('sUSDe');
|
|
135
132
|
if (asset === 'weETH')
|
|
136
|
-
return getApyFromDfsApi('weETH');
|
|
133
|
+
return yield getApyFromDfsApi('weETH');
|
|
137
134
|
if (asset === 'ezETH')
|
|
138
|
-
return getApyFromDfsApi('ezETH');
|
|
135
|
+
return yield getApyFromDfsApi('ezETH');
|
|
139
136
|
if (asset === 'osETH')
|
|
140
|
-
return getApyFromDfsApi('osETH');
|
|
137
|
+
return yield getApyFromDfsApi('osETH');
|
|
141
138
|
if (asset === 'ETHx')
|
|
142
|
-
return getApyFromDfsApi('ETHx');
|
|
139
|
+
return yield getApyFromDfsApi('ETHx');
|
|
143
140
|
if (asset === 'rsETH' || asset === 'wrsETH')
|
|
144
|
-
return getApyFromDfsApi('rsETH');
|
|
141
|
+
return yield getApyFromDfsApi('rsETH');
|
|
145
142
|
if (asset === 'pufETH')
|
|
146
|
-
return getApyFromDfsApi('pufETH');
|
|
143
|
+
return yield getApyFromDfsApi('pufETH');
|
|
147
144
|
if (asset === 'wsuperOETHb')
|
|
148
|
-
return getSuperOETHApy();
|
|
145
|
+
return yield getSuperOETHApy();
|
|
149
146
|
if (asset === 'sUSDS')
|
|
150
|
-
return
|
|
147
|
+
return yield getSsrApy();
|
|
151
148
|
}
|
|
152
149
|
catch (e) {
|
|
153
150
|
console.error(`Failed to fetch APY for ${asset}`);
|
|
154
|
-
return '0';
|
|
155
151
|
}
|
|
156
|
-
|
|
152
|
+
return '0';
|
|
153
|
+
});
|
|
157
154
|
exports.getStakingApy = getStakingApy;
|
|
158
155
|
const calculateInterestEarned = (principal, interest, type, apy = false) => {
|
|
159
156
|
let interval = 1;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type ActivePoolAddressChanged = ContractEventLog<{
|
|
13
|
+
_newActivePoolAddress: string;
|
|
14
|
+
0: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type B_Updated = ContractEventLog<{
|
|
17
|
+
_B: string;
|
|
18
|
+
_epoch: string;
|
|
19
|
+
_scale: string;
|
|
20
|
+
0: string;
|
|
21
|
+
1: string;
|
|
22
|
+
2: string;
|
|
23
|
+
}>;
|
|
24
|
+
export type BoldTokenAddressChanged = ContractEventLog<{
|
|
25
|
+
_newBoldTokenAddress: string;
|
|
26
|
+
0: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type DefaultPoolAddressChanged = ContractEventLog<{
|
|
29
|
+
_newDefaultPoolAddress: string;
|
|
30
|
+
0: string;
|
|
31
|
+
}>;
|
|
32
|
+
export type DepositOperation = ContractEventLog<{
|
|
33
|
+
_depositor: string;
|
|
34
|
+
_operation: string;
|
|
35
|
+
_depositLossSinceLastOperation: string;
|
|
36
|
+
_depositChange: string;
|
|
37
|
+
_yieldGainSinceLastOperation: string;
|
|
38
|
+
_yieldGainClaimed: string;
|
|
39
|
+
_ethGainSinceLastOperation: string;
|
|
40
|
+
_ethGainClaimed: string;
|
|
41
|
+
0: string;
|
|
42
|
+
1: string;
|
|
43
|
+
2: string;
|
|
44
|
+
3: string;
|
|
45
|
+
4: string;
|
|
46
|
+
5: string;
|
|
47
|
+
6: string;
|
|
48
|
+
7: string;
|
|
49
|
+
}>;
|
|
50
|
+
export type DepositUpdated = ContractEventLog<{
|
|
51
|
+
_depositor: string;
|
|
52
|
+
_newDeposit: string;
|
|
53
|
+
_stashedColl: string;
|
|
54
|
+
_snapshotP: string;
|
|
55
|
+
_snapshotS: string;
|
|
56
|
+
_snapshotB: string;
|
|
57
|
+
_snapshotScale: string;
|
|
58
|
+
_snapshotEpoch: string;
|
|
59
|
+
0: string;
|
|
60
|
+
1: string;
|
|
61
|
+
2: string;
|
|
62
|
+
3: string;
|
|
63
|
+
4: string;
|
|
64
|
+
5: string;
|
|
65
|
+
6: string;
|
|
66
|
+
7: string;
|
|
67
|
+
}>;
|
|
68
|
+
export type EpochUpdated = ContractEventLog<{
|
|
69
|
+
_currentEpoch: string;
|
|
70
|
+
0: string;
|
|
71
|
+
}>;
|
|
72
|
+
export type EtherSent = ContractEventLog<{
|
|
73
|
+
_to: string;
|
|
74
|
+
_amount: string;
|
|
75
|
+
0: string;
|
|
76
|
+
1: string;
|
|
77
|
+
}>;
|
|
78
|
+
export type P_Updated = ContractEventLog<{
|
|
79
|
+
_P: string;
|
|
80
|
+
0: string;
|
|
81
|
+
}>;
|
|
82
|
+
export type PriceFeedAddressChanged = ContractEventLog<{
|
|
83
|
+
_newPriceFeedAddress: string;
|
|
84
|
+
0: string;
|
|
85
|
+
}>;
|
|
86
|
+
export type S_Updated = ContractEventLog<{
|
|
87
|
+
_S: string;
|
|
88
|
+
_epoch: string;
|
|
89
|
+
_scale: string;
|
|
90
|
+
0: string;
|
|
91
|
+
1: string;
|
|
92
|
+
2: string;
|
|
93
|
+
}>;
|
|
94
|
+
export type ScaleUpdated = ContractEventLog<{
|
|
95
|
+
_currentScale: string;
|
|
96
|
+
0: string;
|
|
97
|
+
}>;
|
|
98
|
+
export type StabilityPoolBoldBalanceUpdated = ContractEventLog<{
|
|
99
|
+
_newBalance: string;
|
|
100
|
+
0: string;
|
|
101
|
+
}>;
|
|
102
|
+
export type StabilityPoolCollBalanceUpdated = ContractEventLog<{
|
|
103
|
+
_newBalance: string;
|
|
104
|
+
0: string;
|
|
105
|
+
}>;
|
|
106
|
+
export type TroveManagerAddressChanged = ContractEventLog<{
|
|
107
|
+
_newTroveManagerAddress: string;
|
|
108
|
+
0: string;
|
|
109
|
+
}>;
|
|
110
|
+
export interface LiquityV2StabilityPool extends BaseContract {
|
|
111
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): LiquityV2StabilityPool;
|
|
112
|
+
clone(): LiquityV2StabilityPool;
|
|
113
|
+
methods: {
|
|
114
|
+
NAME(): NonPayableTransactionObject<string>;
|
|
115
|
+
P(): NonPayableTransactionObject<string>;
|
|
116
|
+
SCALE_FACTOR(): NonPayableTransactionObject<string>;
|
|
117
|
+
activePool(): NonPayableTransactionObject<string>;
|
|
118
|
+
boldToken(): NonPayableTransactionObject<string>;
|
|
119
|
+
claimAllCollGains(): NonPayableTransactionObject<void>;
|
|
120
|
+
collToken(): NonPayableTransactionObject<string>;
|
|
121
|
+
currentEpoch(): NonPayableTransactionObject<string>;
|
|
122
|
+
currentScale(): NonPayableTransactionObject<string>;
|
|
123
|
+
depositSnapshots(arg0: string): NonPayableTransactionObject<[
|
|
124
|
+
string,
|
|
125
|
+
string,
|
|
126
|
+
string,
|
|
127
|
+
string,
|
|
128
|
+
string
|
|
129
|
+
] & {
|
|
130
|
+
S: string;
|
|
131
|
+
P: string;
|
|
132
|
+
B: string;
|
|
133
|
+
scale: string;
|
|
134
|
+
epoch: string;
|
|
135
|
+
}>;
|
|
136
|
+
deposits(arg0: string): NonPayableTransactionObject<string>;
|
|
137
|
+
epochToScaleToB(arg0: number | string | BN, arg1: number | string | BN): NonPayableTransactionObject<string>;
|
|
138
|
+
epochToScaleToS(arg0: number | string | BN, arg1: number | string | BN): NonPayableTransactionObject<string>;
|
|
139
|
+
getCollBalance(): NonPayableTransactionObject<string>;
|
|
140
|
+
getCompoundedBoldDeposit(_depositor: string): NonPayableTransactionObject<string>;
|
|
141
|
+
getDepositorCollGain(_depositor: string): NonPayableTransactionObject<string>;
|
|
142
|
+
getDepositorYieldGain(_depositor: string): NonPayableTransactionObject<string>;
|
|
143
|
+
getDepositorYieldGainWithPending(_depositor: string): NonPayableTransactionObject<string>;
|
|
144
|
+
getEntireSystemColl(): NonPayableTransactionObject<string>;
|
|
145
|
+
getEntireSystemDebt(): NonPayableTransactionObject<string>;
|
|
146
|
+
getTotalBoldDeposits(): NonPayableTransactionObject<string>;
|
|
147
|
+
getYieldGainsOwed(): NonPayableTransactionObject<string>;
|
|
148
|
+
getYieldGainsPending(): NonPayableTransactionObject<string>;
|
|
149
|
+
lastBoldLossError_Offset(): NonPayableTransactionObject<string>;
|
|
150
|
+
lastBoldLossError_TotalDeposits(): NonPayableTransactionObject<string>;
|
|
151
|
+
lastCollError_Offset(): NonPayableTransactionObject<string>;
|
|
152
|
+
lastYieldError(): NonPayableTransactionObject<string>;
|
|
153
|
+
offset(_debtToOffset: number | string | BN, _collToAdd: number | string | BN): NonPayableTransactionObject<void>;
|
|
154
|
+
provideToSP(_topUp: number | string | BN, _doClaim: boolean): NonPayableTransactionObject<void>;
|
|
155
|
+
stashedColl(arg0: string): NonPayableTransactionObject<string>;
|
|
156
|
+
triggerBoldRewards(_boldYield: number | string | BN): NonPayableTransactionObject<void>;
|
|
157
|
+
troveManager(): NonPayableTransactionObject<string>;
|
|
158
|
+
withdrawFromSP(_amount: number | string | BN, _doClaim: boolean): NonPayableTransactionObject<void>;
|
|
159
|
+
};
|
|
160
|
+
events: {
|
|
161
|
+
ActivePoolAddressChanged(cb?: Callback<ActivePoolAddressChanged>): EventEmitter;
|
|
162
|
+
ActivePoolAddressChanged(options?: EventOptions, cb?: Callback<ActivePoolAddressChanged>): EventEmitter;
|
|
163
|
+
B_Updated(cb?: Callback<B_Updated>): EventEmitter;
|
|
164
|
+
B_Updated(options?: EventOptions, cb?: Callback<B_Updated>): EventEmitter;
|
|
165
|
+
BoldTokenAddressChanged(cb?: Callback<BoldTokenAddressChanged>): EventEmitter;
|
|
166
|
+
BoldTokenAddressChanged(options?: EventOptions, cb?: Callback<BoldTokenAddressChanged>): EventEmitter;
|
|
167
|
+
DefaultPoolAddressChanged(cb?: Callback<DefaultPoolAddressChanged>): EventEmitter;
|
|
168
|
+
DefaultPoolAddressChanged(options?: EventOptions, cb?: Callback<DefaultPoolAddressChanged>): EventEmitter;
|
|
169
|
+
DepositOperation(cb?: Callback<DepositOperation>): EventEmitter;
|
|
170
|
+
DepositOperation(options?: EventOptions, cb?: Callback<DepositOperation>): EventEmitter;
|
|
171
|
+
DepositUpdated(cb?: Callback<DepositUpdated>): EventEmitter;
|
|
172
|
+
DepositUpdated(options?: EventOptions, cb?: Callback<DepositUpdated>): EventEmitter;
|
|
173
|
+
EpochUpdated(cb?: Callback<EpochUpdated>): EventEmitter;
|
|
174
|
+
EpochUpdated(options?: EventOptions, cb?: Callback<EpochUpdated>): EventEmitter;
|
|
175
|
+
EtherSent(cb?: Callback<EtherSent>): EventEmitter;
|
|
176
|
+
EtherSent(options?: EventOptions, cb?: Callback<EtherSent>): EventEmitter;
|
|
177
|
+
P_Updated(cb?: Callback<P_Updated>): EventEmitter;
|
|
178
|
+
P_Updated(options?: EventOptions, cb?: Callback<P_Updated>): EventEmitter;
|
|
179
|
+
PriceFeedAddressChanged(cb?: Callback<PriceFeedAddressChanged>): EventEmitter;
|
|
180
|
+
PriceFeedAddressChanged(options?: EventOptions, cb?: Callback<PriceFeedAddressChanged>): EventEmitter;
|
|
181
|
+
S_Updated(cb?: Callback<S_Updated>): EventEmitter;
|
|
182
|
+
S_Updated(options?: EventOptions, cb?: Callback<S_Updated>): EventEmitter;
|
|
183
|
+
ScaleUpdated(cb?: Callback<ScaleUpdated>): EventEmitter;
|
|
184
|
+
ScaleUpdated(options?: EventOptions, cb?: Callback<ScaleUpdated>): EventEmitter;
|
|
185
|
+
StabilityPoolBoldBalanceUpdated(cb?: Callback<StabilityPoolBoldBalanceUpdated>): EventEmitter;
|
|
186
|
+
StabilityPoolBoldBalanceUpdated(options?: EventOptions, cb?: Callback<StabilityPoolBoldBalanceUpdated>): EventEmitter;
|
|
187
|
+
StabilityPoolCollBalanceUpdated(cb?: Callback<StabilityPoolCollBalanceUpdated>): EventEmitter;
|
|
188
|
+
StabilityPoolCollBalanceUpdated(options?: EventOptions, cb?: Callback<StabilityPoolCollBalanceUpdated>): EventEmitter;
|
|
189
|
+
TroveManagerAddressChanged(cb?: Callback<TroveManagerAddressChanged>): EventEmitter;
|
|
190
|
+
TroveManagerAddressChanged(options?: EventOptions, cb?: Callback<TroveManagerAddressChanged>): EventEmitter;
|
|
191
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
192
|
+
};
|
|
193
|
+
once(event: "ActivePoolAddressChanged", cb: Callback<ActivePoolAddressChanged>): void;
|
|
194
|
+
once(event: "ActivePoolAddressChanged", options: EventOptions, cb: Callback<ActivePoolAddressChanged>): void;
|
|
195
|
+
once(event: "B_Updated", cb: Callback<B_Updated>): void;
|
|
196
|
+
once(event: "B_Updated", options: EventOptions, cb: Callback<B_Updated>): void;
|
|
197
|
+
once(event: "BoldTokenAddressChanged", cb: Callback<BoldTokenAddressChanged>): void;
|
|
198
|
+
once(event: "BoldTokenAddressChanged", options: EventOptions, cb: Callback<BoldTokenAddressChanged>): void;
|
|
199
|
+
once(event: "DefaultPoolAddressChanged", cb: Callback<DefaultPoolAddressChanged>): void;
|
|
200
|
+
once(event: "DefaultPoolAddressChanged", options: EventOptions, cb: Callback<DefaultPoolAddressChanged>): void;
|
|
201
|
+
once(event: "DepositOperation", cb: Callback<DepositOperation>): void;
|
|
202
|
+
once(event: "DepositOperation", options: EventOptions, cb: Callback<DepositOperation>): void;
|
|
203
|
+
once(event: "DepositUpdated", cb: Callback<DepositUpdated>): void;
|
|
204
|
+
once(event: "DepositUpdated", options: EventOptions, cb: Callback<DepositUpdated>): void;
|
|
205
|
+
once(event: "EpochUpdated", cb: Callback<EpochUpdated>): void;
|
|
206
|
+
once(event: "EpochUpdated", options: EventOptions, cb: Callback<EpochUpdated>): void;
|
|
207
|
+
once(event: "EtherSent", cb: Callback<EtherSent>): void;
|
|
208
|
+
once(event: "EtherSent", options: EventOptions, cb: Callback<EtherSent>): void;
|
|
209
|
+
once(event: "P_Updated", cb: Callback<P_Updated>): void;
|
|
210
|
+
once(event: "P_Updated", options: EventOptions, cb: Callback<P_Updated>): void;
|
|
211
|
+
once(event: "PriceFeedAddressChanged", cb: Callback<PriceFeedAddressChanged>): void;
|
|
212
|
+
once(event: "PriceFeedAddressChanged", options: EventOptions, cb: Callback<PriceFeedAddressChanged>): void;
|
|
213
|
+
once(event: "S_Updated", cb: Callback<S_Updated>): void;
|
|
214
|
+
once(event: "S_Updated", options: EventOptions, cb: Callback<S_Updated>): void;
|
|
215
|
+
once(event: "ScaleUpdated", cb: Callback<ScaleUpdated>): void;
|
|
216
|
+
once(event: "ScaleUpdated", options: EventOptions, cb: Callback<ScaleUpdated>): void;
|
|
217
|
+
once(event: "StabilityPoolBoldBalanceUpdated", cb: Callback<StabilityPoolBoldBalanceUpdated>): void;
|
|
218
|
+
once(event: "StabilityPoolBoldBalanceUpdated", options: EventOptions, cb: Callback<StabilityPoolBoldBalanceUpdated>): void;
|
|
219
|
+
once(event: "StabilityPoolCollBalanceUpdated", cb: Callback<StabilityPoolCollBalanceUpdated>): void;
|
|
220
|
+
once(event: "StabilityPoolCollBalanceUpdated", options: EventOptions, cb: Callback<StabilityPoolCollBalanceUpdated>): void;
|
|
221
|
+
once(event: "TroveManagerAddressChanged", cb: Callback<TroveManagerAddressChanged>): void;
|
|
222
|
+
once(event: "TroveManagerAddressChanged", options: EventOptions, cb: Callback<TroveManagerAddressChanged>): void;
|
|
223
|
+
}
|