@defisaver/positions-sdk 1.0.13-dev-1 → 1.0.13-dev-3
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/config/contracts.js +1 -1
- package/cjs/liquityV2/index.js +6 -3
- package/cjs/markets/liquityV2/index.js +3 -3
- package/cjs/types/liquityV2.d.ts +1 -0
- package/esm/config/contracts.js +1 -1
- package/esm/liquityV2/index.js +6 -3
- package/esm/markets/liquityV2/index.js +3 -3
- package/esm/types/liquityV2.d.ts +1 -0
- package/package.json +1 -1
- package/src/config/contracts.js +1 -1
- package/src/liquityV2/index.ts +6 -2
- package/src/markets/liquityV2/index.ts +3 -3
- package/src/types/liquityV2.ts +1 -0
package/cjs/config/contracts.js
CHANGED
|
@@ -1122,7 +1122,7 @@ module.exports = {
|
|
|
1122
1122
|
"abi": [{ "inputs": [], "name": "InvalidMarketAddress", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_prevId", "type": "uint256" }, { "internalType": "uint256", "name": "_nextId", "type": "uint256" }], "name": "findInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getApproxHint", "outputs": [{ "internalType": "uint256", "name": "hintId", "type": "uint256" }, { "internalType": "uint256", "name": "diff", "type": "uint256" }, { "internalType": "uint256", "name": "latestRandomSeed", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_manager", "type": "address" }], "name": "getBatchManagerInfo", "outputs": [{ "components": [{ "internalType": "uint128", "name": "minInterestRate", "type": "uint128" }, { "internalType": "uint128", "name": "maxInterestRate", "type": "uint128" }, { "internalType": "uint256", "name": "minInterestRateChangePeriod", "type": "uint256" }], "internalType": "struct IBorrowerOperations.InterestBatchManager", "name": "managerData", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "entireDebtWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "entireCollWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "accruedInterest", "type": "uint256" }, { "internalType": "uint256", "name": "recordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "accruedManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedBatchManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct ITroveManager.LatestBatchData", "name": "batchData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getDebtInFront", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }, { "internalType": "uint256", "name": "_targetIR", "type": "uint256" }], "name": "getDebtInFrontByInterestRate", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_numTroves", "type": "uint256" }], "name": "getDebtInFrontByTroveNum", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorInfo", "outputs": [{ "internalType": "uint256", "name": "compoundedBOLD", "type": "uint256" }, { "internalType": "uint256", "name": "collGain", "type": "uint256" }, { "internalType": "uint256", "name": "boldGain", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getMarketData", "outputs": [{ "components": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "CCR", "type": "uint256" }, { "internalType": "uint256", "name": "MCR", "type": "uint256" }, { "internalType": "uint256", "name": "SCR", "type": "uint256" }, { "internalType": "uint256", "name": "BCR", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_SP", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_REDISTRIBUTION", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemColl", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemDebt", "type": "uint256" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "address", "name": "troveNFT", "type": "address" }, { "internalType": "address", "name": "borrowerOperations", "type": "address" }, { "internalType": "address", "name": "troveManager", "type": "address" }, { "internalType": "address", "name": "stabilityPool", "type": "address" }, { "internalType": "address", "name": "sortedTroves", "type": "address" }, { "internalType": "address", "name": "collSurplusPool", "type": "address" }, { "internalType": "address", "name": "activePool", "type": "address" }, { "internalType": "address", "name": "hintHelpers", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "bool", "name": "isShutDown", "type": "bool" }, { "internalType": "uint256", "name": "boldDepositInSp", "type": "uint256" }], "internalType": "struct LiquityV2View.MarketData", "name": "data", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "int256", "name": "_startIdx", "type": "int256" }, { "internalType": "uint256", "name": "_count", "type": "uint256" }], "name": "getMultipleSortedTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "coll", "type": "uint256" }, { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "batchCollShares", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotETH", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotBoldDebt", "type": "uint256" }], "internalType": "struct IMultiTroveGetter.CombinedTroveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getNumOfTrovesInFrontOfTrove", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "numTroves", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }], "name": "getTroveInfo", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "enum ITroveManager.Status", "name": "status", "type": "uint8" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "uint256", "name": "TCRatio", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct LiquityV2View.TroveData", "name": "trove", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getTrovePosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_startIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_endIndex", "type": "uint256" }], "name": "getUserTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "bool", "name": "ownedByUser", "type": "bool" }], "internalType": "struct LiquityV2View.ExistingTrove[]", "name": "troves", "type": "tuple[]" }, { "internalType": "int256", "name": "nextFreeTroveIndex", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isShutDown", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_debtIncrease", "type": "uint256" }], "name": "predictAdjustTroveUpfrontFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
|
|
1123
1123
|
"networks": {
|
|
1124
1124
|
"1": {
|
|
1125
|
-
"address": "
|
|
1125
|
+
"address": "0x10B748Dc504C2515Bb6A9e23CB2F686090b6c584",
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
},
|
package/cjs/liquityV2/index.js
CHANGED
|
@@ -210,7 +210,7 @@ const getDebtInFrontForInterestRateLiquityV2 = (markets, selectedMarket, web3, n
|
|
|
210
210
|
exports.getDebtInFrontForInterestRateLiquityV2 = getDebtInFrontForInterestRateLiquityV2;
|
|
211
211
|
const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, troveId, allMarketsData, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
212
|
const viewContract = getLiquityV2ViewContract(web3, network, selectedMarket.isLegacy);
|
|
213
|
-
const { minCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
213
|
+
const { minCollRatio, batchCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
214
214
|
const { collateralToken, marketAddress, debtToken } = selectedMarket;
|
|
215
215
|
const [_data, debtInFront] = yield Promise.all([
|
|
216
216
|
viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
|
|
@@ -245,13 +245,16 @@ const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, trov
|
|
|
245
245
|
const interestRate = new decimal_js_1.default(data.annualInterestRate).div(1e16).toString();
|
|
246
246
|
const interestBatchManager = data.interestBatchManager;
|
|
247
247
|
const lastInterestRateAdjTime = data.lastInterestRateAdjTime;
|
|
248
|
+
const hasInterestBatchManager = !(0, utils_1.compareAddresses)(interestBatchManager, constants_1.ZERO_ADDRESS);
|
|
249
|
+
const liqRatio = hasInterestBatchManager ? new decimal_js_1.default(minCollRatio).add(batchCollRatio).toString() : minCollRatio;
|
|
248
250
|
const payload = Object.assign(Object.assign({ usedAssets,
|
|
249
251
|
troveId,
|
|
250
252
|
interestRate,
|
|
251
253
|
interestBatchManager,
|
|
252
254
|
debtInFront,
|
|
253
|
-
lastInterestRateAdjTime,
|
|
254
|
-
|
|
255
|
+
lastInterestRateAdjTime,
|
|
256
|
+
liqRatio, troveStatus: types_1.LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
|
|
257
|
+
usedAssets, assetsData, minCollRatio: liqRatio, interestRate,
|
|
255
258
|
})), { collRatio });
|
|
256
259
|
return payload;
|
|
257
260
|
});
|
|
@@ -12,7 +12,7 @@ const LIQUITY_V2_ETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
12
12
|
url: 'eth',
|
|
13
13
|
debtToken: 'BOLD',
|
|
14
14
|
collateralToken: 'ETH',
|
|
15
|
-
marketAddress: '
|
|
15
|
+
marketAddress: '0xde524be191de806011e98c8d36d50d7a88391a3e',
|
|
16
16
|
protocolName: 'liquity-v2',
|
|
17
17
|
isLegacy: false,
|
|
18
18
|
});
|
|
@@ -25,7 +25,7 @@ const LIQUITY_V2_WSTETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
25
25
|
url: 'wsteth',
|
|
26
26
|
debtToken: 'BOLD',
|
|
27
27
|
collateralToken: 'wstETH',
|
|
28
|
-
marketAddress: '
|
|
28
|
+
marketAddress: '0x1649ccb966c90ff524a15231bc177d77a275fda1',
|
|
29
29
|
protocolName: 'liquity-v2',
|
|
30
30
|
isLegacy: false,
|
|
31
31
|
});
|
|
@@ -38,7 +38,7 @@ const LIQUITY_V2_RETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
38
38
|
url: 'reth',
|
|
39
39
|
debtToken: 'BOLD',
|
|
40
40
|
collateralToken: 'rETH',
|
|
41
|
-
marketAddress: '
|
|
41
|
+
marketAddress: '0x6809ac46fa55e4d86be368c589427684616f91c2',
|
|
42
42
|
protocolName: 'liquity-v2',
|
|
43
43
|
isLegacy: false,
|
|
44
44
|
});
|
package/cjs/types/liquityV2.d.ts
CHANGED
package/esm/config/contracts.js
CHANGED
|
@@ -1121,7 +1121,7 @@ module.exports = {
|
|
|
1121
1121
|
"abi": [{ "inputs": [], "name": "InvalidMarketAddress", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_prevId", "type": "uint256" }, { "internalType": "uint256", "name": "_nextId", "type": "uint256" }], "name": "findInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getApproxHint", "outputs": [{ "internalType": "uint256", "name": "hintId", "type": "uint256" }, { "internalType": "uint256", "name": "diff", "type": "uint256" }, { "internalType": "uint256", "name": "latestRandomSeed", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_manager", "type": "address" }], "name": "getBatchManagerInfo", "outputs": [{ "components": [{ "internalType": "uint128", "name": "minInterestRate", "type": "uint128" }, { "internalType": "uint128", "name": "maxInterestRate", "type": "uint128" }, { "internalType": "uint256", "name": "minInterestRateChangePeriod", "type": "uint256" }], "internalType": "struct IBorrowerOperations.InterestBatchManager", "name": "managerData", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "entireDebtWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "entireCollWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "accruedInterest", "type": "uint256" }, { "internalType": "uint256", "name": "recordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "accruedManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedBatchManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct ITroveManager.LatestBatchData", "name": "batchData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getDebtInFront", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }, { "internalType": "uint256", "name": "_targetIR", "type": "uint256" }], "name": "getDebtInFrontByInterestRate", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_numTroves", "type": "uint256" }], "name": "getDebtInFrontByTroveNum", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorInfo", "outputs": [{ "internalType": "uint256", "name": "compoundedBOLD", "type": "uint256" }, { "internalType": "uint256", "name": "collGain", "type": "uint256" }, { "internalType": "uint256", "name": "boldGain", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getMarketData", "outputs": [{ "components": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "CCR", "type": "uint256" }, { "internalType": "uint256", "name": "MCR", "type": "uint256" }, { "internalType": "uint256", "name": "SCR", "type": "uint256" }, { "internalType": "uint256", "name": "BCR", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_SP", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_REDISTRIBUTION", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemColl", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemDebt", "type": "uint256" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "address", "name": "troveNFT", "type": "address" }, { "internalType": "address", "name": "borrowerOperations", "type": "address" }, { "internalType": "address", "name": "troveManager", "type": "address" }, { "internalType": "address", "name": "stabilityPool", "type": "address" }, { "internalType": "address", "name": "sortedTroves", "type": "address" }, { "internalType": "address", "name": "collSurplusPool", "type": "address" }, { "internalType": "address", "name": "activePool", "type": "address" }, { "internalType": "address", "name": "hintHelpers", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "bool", "name": "isShutDown", "type": "bool" }, { "internalType": "uint256", "name": "boldDepositInSp", "type": "uint256" }], "internalType": "struct LiquityV2View.MarketData", "name": "data", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "int256", "name": "_startIdx", "type": "int256" }, { "internalType": "uint256", "name": "_count", "type": "uint256" }], "name": "getMultipleSortedTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "coll", "type": "uint256" }, { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "batchCollShares", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotETH", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotBoldDebt", "type": "uint256" }], "internalType": "struct IMultiTroveGetter.CombinedTroveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getNumOfTrovesInFrontOfTrove", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "numTroves", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }], "name": "getTroveInfo", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "enum ITroveManager.Status", "name": "status", "type": "uint8" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "uint256", "name": "TCRatio", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct LiquityV2View.TroveData", "name": "trove", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getTrovePosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_startIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_endIndex", "type": "uint256" }], "name": "getUserTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "bool", "name": "ownedByUser", "type": "bool" }], "internalType": "struct LiquityV2View.ExistingTrove[]", "name": "troves", "type": "tuple[]" }, { "internalType": "int256", "name": "nextFreeTroveIndex", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isShutDown", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_debtIncrease", "type": "uint256" }], "name": "predictAdjustTroveUpfrontFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
|
|
1122
1122
|
"networks": {
|
|
1123
1123
|
"1": {
|
|
1124
|
-
"address": "
|
|
1124
|
+
"address": "0x10B748Dc504C2515Bb6A9e23CB2F686090b6c584",
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
},
|
package/esm/liquityV2/index.js
CHANGED
|
@@ -196,7 +196,7 @@ export const getDebtInFrontForInterestRateLiquityV2 = (markets, selectedMarket,
|
|
|
196
196
|
});
|
|
197
197
|
export const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, troveId, allMarketsData, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
198
198
|
const viewContract = getLiquityV2ViewContract(web3, network, selectedMarket.isLegacy);
|
|
199
|
-
const { minCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
199
|
+
const { minCollRatio, batchCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
200
200
|
const { collateralToken, marketAddress, debtToken } = selectedMarket;
|
|
201
201
|
const [_data, debtInFront] = yield Promise.all([
|
|
202
202
|
viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
|
|
@@ -231,13 +231,16 @@ export const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsDat
|
|
|
231
231
|
const interestRate = new Dec(data.annualInterestRate).div(1e16).toString();
|
|
232
232
|
const interestBatchManager = data.interestBatchManager;
|
|
233
233
|
const lastInterestRateAdjTime = data.lastInterestRateAdjTime;
|
|
234
|
+
const hasInterestBatchManager = !compareAddresses(interestBatchManager, ZERO_ADDRESS);
|
|
235
|
+
const liqRatio = hasInterestBatchManager ? new Dec(minCollRatio).add(batchCollRatio).toString() : minCollRatio;
|
|
234
236
|
const payload = Object.assign(Object.assign({ usedAssets,
|
|
235
237
|
troveId,
|
|
236
238
|
interestRate,
|
|
237
239
|
interestBatchManager,
|
|
238
240
|
debtInFront,
|
|
239
|
-
lastInterestRateAdjTime,
|
|
240
|
-
|
|
241
|
+
lastInterestRateAdjTime,
|
|
242
|
+
liqRatio, troveStatus: LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, getLiquityV2AggregatedPositionData({
|
|
243
|
+
usedAssets, assetsData, minCollRatio: liqRatio, interestRate,
|
|
241
244
|
})), { collRatio });
|
|
242
245
|
return payload;
|
|
243
246
|
});
|
|
@@ -9,7 +9,7 @@ export const LIQUITY_V2_ETH_MARKET = (networkId = NetworkNumber.Eth) => ({
|
|
|
9
9
|
url: 'eth',
|
|
10
10
|
debtToken: 'BOLD',
|
|
11
11
|
collateralToken: 'ETH',
|
|
12
|
-
marketAddress: '
|
|
12
|
+
marketAddress: '0xde524be191de806011e98c8d36d50d7a88391a3e',
|
|
13
13
|
protocolName: 'liquity-v2',
|
|
14
14
|
isLegacy: false,
|
|
15
15
|
});
|
|
@@ -21,7 +21,7 @@ export const LIQUITY_V2_WSTETH_MARKET = (networkId = NetworkNumber.Eth) => ({
|
|
|
21
21
|
url: 'wsteth',
|
|
22
22
|
debtToken: 'BOLD',
|
|
23
23
|
collateralToken: 'wstETH',
|
|
24
|
-
marketAddress: '
|
|
24
|
+
marketAddress: '0x1649ccb966c90ff524a15231bc177d77a275fda1',
|
|
25
25
|
protocolName: 'liquity-v2',
|
|
26
26
|
isLegacy: false,
|
|
27
27
|
});
|
|
@@ -33,7 +33,7 @@ export const LIQUITY_V2_RETH_MARKET = (networkId = NetworkNumber.Eth) => ({
|
|
|
33
33
|
url: 'reth',
|
|
34
34
|
debtToken: 'BOLD',
|
|
35
35
|
collateralToken: 'rETH',
|
|
36
|
-
marketAddress: '
|
|
36
|
+
marketAddress: '0x6809ac46fa55e4d86be368c589427684616f91c2',
|
|
37
37
|
protocolName: 'liquity-v2',
|
|
38
38
|
isLegacy: false,
|
|
39
39
|
});
|
package/esm/types/liquityV2.d.ts
CHANGED
package/package.json
CHANGED
package/src/config/contracts.js
CHANGED
|
@@ -1122,7 +1122,7 @@ module.exports = {
|
|
|
1122
1122
|
"abi": [{"inputs":[],"name":"InvalidMarketAddress","type":"error"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_prevId","type":"uint256"},{"internalType":"uint256","name":"_nextId","type":"uint256"}],"name":"findInsertPosition","outputs":[{"internalType":"uint256","name":"prevId","type":"uint256"},{"internalType":"uint256","name":"nextId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_collIndex","type":"uint256"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_numTrials","type":"uint256"},{"internalType":"uint256","name":"_inputRandomSeed","type":"uint256"}],"name":"getApproxHint","outputs":[{"internalType":"uint256","name":"hintId","type":"uint256"},{"internalType":"uint256","name":"diff","type":"uint256"},{"internalType":"uint256","name":"latestRandomSeed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_manager","type":"address"}],"name":"getBatchManagerInfo","outputs":[{"components":[{"internalType":"uint128","name":"minInterestRate","type":"uint128"},{"internalType":"uint128","name":"maxInterestRate","type":"uint128"},{"internalType":"uint256","name":"minInterestRateChangePeriod","type":"uint256"}],"internalType":"struct IBorrowerOperations.InterestBatchManager","name":"managerData","type":"tuple"},{"components":[{"internalType":"uint256","name":"entireDebtWithoutRedistribution","type":"uint256"},{"internalType":"uint256","name":"entireCollWithoutRedistribution","type":"uint256"},{"internalType":"uint256","name":"accruedInterest","type":"uint256"},{"internalType":"uint256","name":"recordedDebt","type":"uint256"},{"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"internalType":"uint256","name":"weightedRecordedDebt","type":"uint256"},{"internalType":"uint256","name":"annualManagementFee","type":"uint256"},{"internalType":"uint256","name":"accruedManagementFee","type":"uint256"},{"internalType":"uint256","name":"weightedRecordedBatchManagementFee","type":"uint256"},{"internalType":"uint256","name":"lastDebtUpdateTime","type":"uint256"},{"internalType":"uint256","name":"lastInterestRateAdjTime","type":"uint256"}],"internalType":"struct ITroveManager.LatestBatchData","name":"batchData","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_troveId","type":"uint256"},{"internalType":"uint256","name":"_acc","type":"uint256"},{"internalType":"uint256","name":"_iterations","type":"uint256"}],"name":"getDebtInFront","outputs":[{"internalType":"uint256","name":"next","type":"uint256"},{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_troveId","type":"uint256"},{"internalType":"uint256","name":"_acc","type":"uint256"},{"internalType":"uint256","name":"_iterations","type":"uint256"},{"internalType":"uint256","name":"_targetIR","type":"uint256"}],"name":"getDebtInFrontByInterestRate","outputs":[{"internalType":"uint256","name":"next","type":"uint256"},{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_numTroves","type":"uint256"}],"name":"getDebtInFrontByTroveNum","outputs":[{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_depositor","type":"address"}],"name":"getDepositorInfo","outputs":[{"internalType":"uint256","name":"compoundedBOLD","type":"uint256"},{"internalType":"uint256","name":"collGain","type":"uint256"},{"internalType":"uint256","name":"boldGain","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_collIndex","type":"uint256"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_numTrials","type":"uint256"},{"internalType":"uint256","name":"_inputRandomSeed","type":"uint256"}],"name":"getInsertPosition","outputs":[{"internalType":"uint256","name":"prevId","type":"uint256"},{"internalType":"uint256","name":"nextId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getMarketData","outputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint256","name":"CCR","type":"uint256"},{"internalType":"uint256","name":"MCR","type":"uint256"},{"internalType":"uint256","name":"SCR","type":"uint256"},{"internalType":"uint256","name":"BCR","type":"uint256"},{"internalType":"uint256","name":"LIQUIDATION_PENALTY_SP","type":"uint256"},{"internalType":"uint256","name":"LIQUIDATION_PENALTY_REDISTRIBUTION","type":"uint256"},{"internalType":"uint256","name":"entireSystemColl","type":"uint256"},{"internalType":"uint256","name":"entireSystemDebt","type":"uint256"},{"internalType":"address","name":"collToken","type":"address"},{"internalType":"address","name":"troveNFT","type":"address"},{"internalType":"address","name":"borrowerOperations","type":"address"},{"internalType":"address","name":"troveManager","type":"address"},{"internalType":"address","name":"stabilityPool","type":"address"},{"internalType":"address","name":"sortedTroves","type":"address"},{"internalType":"address","name":"collSurplusPool","type":"address"},{"internalType":"address","name":"activePool","type":"address"},{"internalType":"address","name":"hintHelpers","type":"address"},{"internalType":"address","name":"priceFeed","type":"address"},{"internalType":"uint256","name":"collPrice","type":"uint256"},{"internalType":"bool","name":"isShutDown","type":"bool"},{"internalType":"uint256","name":"boldDepositInSp","type":"uint256"}],"internalType":"struct LiquityV2View.MarketData","name":"data","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"int256","name":"_startIdx","type":"int256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"getMultipleSortedTroves","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"debt","type":"uint256"},{"internalType":"uint256","name":"coll","type":"uint256"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"internalType":"uint256","name":"lastDebtUpdateTime","type":"uint256"},{"internalType":"uint256","name":"lastInterestRateAdjTime","type":"uint256"},{"internalType":"address","name":"interestBatchManager","type":"address"},{"internalType":"uint256","name":"batchDebtShares","type":"uint256"},{"internalType":"uint256","name":"batchCollShares","type":"uint256"},{"internalType":"uint256","name":"snapshotETH","type":"uint256"},{"internalType":"uint256","name":"snapshotBoldDebt","type":"uint256"}],"internalType":"struct IMultiTroveGetter.CombinedTroveData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_troveId","type":"uint256"},{"internalType":"uint256","name":"_iterations","type":"uint256"}],"name":"getNumOfTrovesInFrontOfTrove","outputs":[{"internalType":"uint256","name":"next","type":"uint256"},{"internalType":"uint256","name":"numTroves","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_troveId","type":"uint256"}],"name":"getTroveInfo","outputs":[{"components":[{"internalType":"uint256","name":"troveId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"collToken","type":"address"},{"internalType":"enum ITroveManager.Status","name":"status","type":"uint8"},{"internalType":"uint256","name":"collAmount","type":"uint256"},{"internalType":"uint256","name":"debtAmount","type":"uint256"},{"internalType":"uint256","name":"collPrice","type":"uint256"},{"internalType":"uint256","name":"TCRatio","type":"uint256"},{"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"internalType":"address","name":"interestBatchManager","type":"address"},{"internalType":"uint256","name":"batchDebtShares","type":"uint256"},{"internalType":"uint256","name":"lastInterestRateAdjTime","type":"uint256"}],"internalType":"struct LiquityV2View.TroveData","name":"trove","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_collIndex","type":"uint256"},{"internalType":"uint256","name":"_troveId","type":"uint256"},{"internalType":"uint256","name":"_numTrials","type":"uint256"},{"internalType":"uint256","name":"_inputRandomSeed","type":"uint256"}],"name":"getTrovePosition","outputs":[{"internalType":"uint256","name":"prevId","type":"uint256"},{"internalType":"uint256","name":"nextId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_endIndex","type":"uint256"}],"name":"getUserTroves","outputs":[{"components":[{"internalType":"uint256","name":"troveId","type":"uint256"},{"internalType":"bool","name":"ownedByUser","type":"bool"}],"internalType":"struct LiquityV2View.ExistingTrove[]","name":"troves","type":"tuple[]"},{"internalType":"int256","name":"nextFreeTroveIndex","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"isShutDown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_collIndex","type":"uint256"},{"internalType":"uint256","name":"_troveId","type":"uint256"},{"internalType":"uint256","name":"_debtIncrease","type":"uint256"}],"name":"predictAdjustTroveUpfrontFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],
|
|
1123
1123
|
"networks": {
|
|
1124
1124
|
"1": {
|
|
1125
|
-
"address": "
|
|
1125
|
+
"address": "0x10B748Dc504C2515Bb6A9e23CB2F686090b6c584",
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
},
|
package/src/liquityV2/index.ts
CHANGED
|
@@ -242,7 +242,7 @@ export const getLiquityV2TroveData = async (
|
|
|
242
242
|
},
|
|
243
243
|
): Promise<LiquityV2TroveData> => {
|
|
244
244
|
const viewContract = getLiquityV2ViewContract(web3, network, selectedMarket.isLegacy);
|
|
245
|
-
const { minCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
245
|
+
const { minCollRatio, batchCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
246
246
|
const { collateralToken, marketAddress, debtToken } = selectedMarket;
|
|
247
247
|
const [_data, debtInFront] = await Promise.all([
|
|
248
248
|
viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
|
|
@@ -284,6 +284,9 @@ export const getLiquityV2TroveData = async (
|
|
|
284
284
|
const interestBatchManager = data.interestBatchManager;
|
|
285
285
|
const lastInterestRateAdjTime = data.lastInterestRateAdjTime;
|
|
286
286
|
|
|
287
|
+
const hasInterestBatchManager = !compareAddresses(interestBatchManager, ZERO_ADDRESS);
|
|
288
|
+
const liqRatio = hasInterestBatchManager ? new Dec(minCollRatio).add(batchCollRatio).toString() : minCollRatio;
|
|
289
|
+
|
|
287
290
|
const payload: LiquityV2TroveData = {
|
|
288
291
|
usedAssets,
|
|
289
292
|
troveId,
|
|
@@ -291,9 +294,10 @@ export const getLiquityV2TroveData = async (
|
|
|
291
294
|
interestBatchManager,
|
|
292
295
|
debtInFront,
|
|
293
296
|
lastInterestRateAdjTime,
|
|
297
|
+
liqRatio,
|
|
294
298
|
troveStatus: LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)],
|
|
295
299
|
...getLiquityV2AggregatedPositionData({
|
|
296
|
-
usedAssets, assetsData, minCollRatio, interestRate,
|
|
300
|
+
usedAssets, assetsData, minCollRatio: liqRatio, interestRate,
|
|
297
301
|
}),
|
|
298
302
|
collRatio,
|
|
299
303
|
};
|
|
@@ -10,7 +10,7 @@ export const LIQUITY_V2_ETH_MARKET = (networkId: NetworkNumber = NetworkNumber.E
|
|
|
10
10
|
url: 'eth',
|
|
11
11
|
debtToken: 'BOLD',
|
|
12
12
|
collateralToken: 'ETH',
|
|
13
|
-
marketAddress: '
|
|
13
|
+
marketAddress: '0xde524be191de806011e98c8d36d50d7a88391a3e',
|
|
14
14
|
protocolName: 'liquity-v2',
|
|
15
15
|
isLegacy: false,
|
|
16
16
|
});
|
|
@@ -23,7 +23,7 @@ export const LIQUITY_V2_WSTETH_MARKET = (networkId: NetworkNumber = NetworkNumbe
|
|
|
23
23
|
url: 'wsteth',
|
|
24
24
|
debtToken: 'BOLD',
|
|
25
25
|
collateralToken: 'wstETH',
|
|
26
|
-
marketAddress: '
|
|
26
|
+
marketAddress: '0x1649ccb966c90ff524a15231bc177d77a275fda1',
|
|
27
27
|
protocolName: 'liquity-v2',
|
|
28
28
|
isLegacy: false,
|
|
29
29
|
});
|
|
@@ -36,7 +36,7 @@ export const LIQUITY_V2_RETH_MARKET = (networkId: NetworkNumber = NetworkNumber.
|
|
|
36
36
|
url: 'reth',
|
|
37
37
|
debtToken: 'BOLD',
|
|
38
38
|
collateralToken: 'rETH',
|
|
39
|
-
marketAddress: '
|
|
39
|
+
marketAddress: '0x6809ac46fa55e4d86be368c589427684616f91c2',
|
|
40
40
|
protocolName: 'liquity-v2',
|
|
41
41
|
isLegacy: false,
|
|
42
42
|
});
|