@defisaver/positions-sdk 0.0.201-fluid-dev-10 → 0.0.201-fluid-dev-12

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.
Files changed (66) hide show
  1. package/cjs/aaveV2/index.js +1 -1
  2. package/cjs/config/contracts.d.ts +87 -6
  3. package/cjs/config/contracts.js +15 -2
  4. package/cjs/helpers/liquityV2Helpers/index.js +2 -2
  5. package/cjs/liquityV2/index.d.ts +9 -4
  6. package/cjs/liquityV2/index.js +69 -10
  7. package/cjs/markets/fluid/index.js +1 -1
  8. package/cjs/markets/index.d.ts +1 -1
  9. package/cjs/markets/index.js +2 -1
  10. package/cjs/markets/liquityV2/index.d.ts +2 -1
  11. package/cjs/markets/liquityV2/index.js +12 -1
  12. package/cjs/markets/spark/marketAssets.js +1 -1
  13. package/cjs/morphoAaveV2/index.js +1 -1
  14. package/cjs/morphoAaveV3/index.js +1 -2
  15. package/cjs/spark/index.js +1 -2
  16. package/cjs/staking/staking.d.ts +1 -6
  17. package/cjs/staking/staking.js +20 -23
  18. package/cjs/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
  19. package/cjs/types/contracts/generated/LiquityV2StabilityPool.js +5 -0
  20. package/cjs/types/contracts/generated/LiquityV2View.d.ts +144 -2
  21. package/cjs/types/contracts/generated/index.d.ts +1 -0
  22. package/cjs/types/liquityV2.d.ts +1 -0
  23. package/esm/aaveV2/index.js +2 -2
  24. package/esm/config/contracts.d.ts +87 -6
  25. package/esm/config/contracts.js +15 -2
  26. package/esm/helpers/liquityV2Helpers/index.js +2 -2
  27. package/esm/liquityV2/index.d.ts +9 -4
  28. package/esm/liquityV2/index.js +64 -10
  29. package/esm/markets/fluid/index.js +1 -1
  30. package/esm/markets/index.d.ts +1 -1
  31. package/esm/markets/index.js +1 -1
  32. package/esm/markets/liquityV2/index.d.ts +2 -1
  33. package/esm/markets/liquityV2/index.js +10 -0
  34. package/esm/markets/spark/marketAssets.js +1 -1
  35. package/esm/morphoAaveV2/index.js +2 -2
  36. package/esm/morphoAaveV3/index.js +1 -2
  37. package/esm/spark/index.js +1 -2
  38. package/esm/staking/staking.d.ts +1 -6
  39. package/esm/staking/staking.js +24 -22
  40. package/esm/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
  41. package/esm/types/contracts/generated/LiquityV2StabilityPool.js +4 -0
  42. package/esm/types/contracts/generated/LiquityV2View.d.ts +144 -2
  43. package/esm/types/contracts/generated/index.d.ts +1 -0
  44. package/esm/types/liquityV2.d.ts +1 -0
  45. package/package.json +2 -1
  46. package/src/aaveV2/index.ts +2 -2
  47. package/src/config/contracts.js +15 -2
  48. package/src/helpers/liquityV2Helpers/index.ts +3 -3
  49. package/src/liquityV2/index.ts +79 -12
  50. package/src/markets/fluid/index.ts +1 -1
  51. package/src/markets/index.ts +1 -1
  52. package/src/markets/liquityV2/index.ts +13 -2
  53. package/src/markets/spark/marketAssets.ts +1 -1
  54. package/src/morphoAaveV2/index.ts +2 -2
  55. package/src/morphoAaveV3/index.ts +1 -2
  56. package/src/spark/index.ts +1 -2
  57. package/src/staking/staking.ts +22 -22
  58. package/src/types/contracts/generated/LiquityV2StabilityPool.ts +453 -0
  59. package/src/types/contracts/generated/LiquityV2View.ts +173 -2
  60. package/src/types/contracts/generated/index.ts +1 -0
  61. package/src/types/liquityV2.ts +1 -0
  62. package/cjs/services/dsrService.d.ts +0 -3
  63. package/cjs/services/dsrService.js +0 -28
  64. package/esm/services/dsrService.d.ts +0 -3
  65. package/esm/services/dsrService.js +0 -21
  66. package/src/services/dsrService.ts +0 -16
@@ -66,7 +66,7 @@ const getAaveV2MarketsData = (web3, network, selectedMarket, mainnetWeb3) => __a
66
66
  }));
67
67
  const stEthMarket = markets.find(({ symbol }) => symbol === 'stETH');
68
68
  if (stEthMarket) {
69
- stEthMarket.incentiveSupplyApy = yield (0, staking_1.getStETHApy)(mainnetWeb3);
69
+ stEthMarket.incentiveSupplyApy = yield (0, staking_1.getStakingApy)('stETH', mainnetWeb3);
70
70
  stEthMarket.incentiveSupplyToken = 'stETH';
71
71
  }
72
72
  const payload = {};
@@ -7421,7 +7421,13 @@ export namespace LlamaLendControllerAbi {
7421
7421
  export { networks_80 as networks };
7422
7422
  }
7423
7423
  export namespace LiquityV2View {
7424
- let abi_81: {
7424
+ let abi_81: ({
7425
+ inputs: never[];
7426
+ name: string;
7427
+ type: string;
7428
+ outputs?: undefined;
7429
+ stateMutability?: undefined;
7430
+ } | {
7425
7431
  inputs: {
7426
7432
  internalType: string;
7427
7433
  name: string;
@@ -7445,11 +7451,42 @@ export namespace LiquityV2View {
7445
7451
  })[];
7446
7452
  stateMutability: string;
7447
7453
  type: string;
7448
- }[];
7454
+ })[];
7449
7455
  export { abi_81 as abi };
7450
7456
  let networks_81: {
7451
7457
  "1": {
7452
7458
  address: string;
7459
+ createdBlock: number;
7460
+ oldVersions: {
7461
+ "21767168": {
7462
+ abi: {
7463
+ inputs: {
7464
+ internalType: string;
7465
+ name: string;
7466
+ type: string;
7467
+ }[];
7468
+ name: string;
7469
+ outputs: ({
7470
+ components: {
7471
+ internalType: string;
7472
+ name: string;
7473
+ type: string;
7474
+ }[];
7475
+ internalType: string;
7476
+ name: string;
7477
+ type: string;
7478
+ } | {
7479
+ internalType: string;
7480
+ name: string;
7481
+ type: string;
7482
+ components?: undefined;
7483
+ })[];
7484
+ stateMutability: string;
7485
+ type: string;
7486
+ }[];
7487
+ address: string;
7488
+ };
7489
+ };
7453
7490
  };
7454
7491
  };
7455
7492
  export { networks_81 as networks };
@@ -7614,8 +7651,52 @@ export namespace EulerV2View {
7614
7651
  };
7615
7652
  export { networks_84 as networks };
7616
7653
  }
7617
- export namespace FluidView {
7654
+ export namespace LiquityV2StabilityPool {
7618
7655
  let abi_85: ({
7656
+ inputs: {
7657
+ internalType: string;
7658
+ name: string;
7659
+ type: string;
7660
+ }[];
7661
+ stateMutability: string;
7662
+ type: string;
7663
+ anonymous?: undefined;
7664
+ name?: undefined;
7665
+ outputs?: undefined;
7666
+ } | {
7667
+ anonymous: boolean;
7668
+ inputs: {
7669
+ indexed: boolean;
7670
+ internalType: string;
7671
+ name: string;
7672
+ type: string;
7673
+ }[];
7674
+ name: string;
7675
+ type: string;
7676
+ stateMutability?: undefined;
7677
+ outputs?: undefined;
7678
+ } | {
7679
+ inputs: {
7680
+ internalType: string;
7681
+ name: string;
7682
+ type: string;
7683
+ }[];
7684
+ name: string;
7685
+ outputs: {
7686
+ internalType: string;
7687
+ name: string;
7688
+ type: string;
7689
+ }[];
7690
+ stateMutability: string;
7691
+ type: string;
7692
+ anonymous?: undefined;
7693
+ })[];
7694
+ export { abi_85 as abi };
7695
+ let networks_85: {};
7696
+ export { networks_85 as networks };
7697
+ }
7698
+ export namespace FluidView {
7699
+ let abi_86: ({
7619
7700
  inputs: {
7620
7701
  internalType: string;
7621
7702
  name: string;
@@ -7649,8 +7730,8 @@ export namespace FluidView {
7649
7730
  stateMutability: string;
7650
7731
  type: string;
7651
7732
  })[];
7652
- export { abi_85 as abi };
7653
- let networks_85: {
7733
+ export { abi_86 as abi };
7734
+ let networks_86: {
7654
7735
  "1": {
7655
7736
  address: string;
7656
7737
  };
@@ -7661,5 +7742,5 @@ export namespace FluidView {
7661
7742
  address: string;
7662
7743
  };
7663
7744
  };
7664
- export { networks_85 as networks };
7745
+ export { networks_86 as networks };
7665
7746
  }
@@ -1092,9 +1092,18 @@ module.exports = {
1092
1092
  "networks": {}
1093
1093
  },
1094
1094
  "LiquityV2View": {
1095
- "abi": [{ "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": "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": "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": "struct LiquityV2View.MarketData", "name": "data", "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": "struct LiquityV2View.TroveData", "name": "trove", "type": "tuple" }], "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": "_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" }],
1095
+ "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": "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" }],
1096
1096
  "networks": {
1097
- "1": { "address": "0x9C43F5ED37042Fd4bA7f98aa734026c6C7Fb1Db0" },
1097
+ "1": {
1098
+ "address": "0x8ABc5D6850DF33D621c30ae487bab843deb9CB63",
1099
+ "createdBlock": 21779917,
1100
+ "oldVersions": {
1101
+ "21767168": {
1102
+ "abi": [{ "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": "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": "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": "struct LiquityV2View.MarketData", "name": "data", "type": "tuple" }], "stateMutability": "nonpayable", "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": "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": "nonpayable", "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" }],
1103
+ "address": "0xb1CCB64689F03cC7fd066a2095A285471c8A8554",
1104
+ },
1105
+ },
1106
+ },
1098
1107
  },
1099
1108
  },
1100
1109
  "LiquityV2CollSurplusPool": {
@@ -1111,6 +1120,10 @@ module.exports = {
1111
1120
  "1": { "address": "0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967" }
1112
1121
  }
1113
1122
  },
1123
+ "LiquityV2StabilityPool": {
1124
+ "abi": [{ "inputs": [{ "internalType": "contract IAddressesRegistry", "name": "_addressesRegistry", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newActivePoolAddress", "type": "address" }], "name": "ActivePoolAddressChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "_B", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "_epoch", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "_scale", "type": "uint128" }], "name": "B_Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newBoldTokenAddress", "type": "address" }], "name": "BoldTokenAddressChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newDefaultPoolAddress", "type": "address" }], "name": "DefaultPoolAddressChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "_depositor", "type": "address" }, { "indexed": false, "internalType": "enum IStabilityPoolEvents.Operation", "name": "_operation", "type": "uint8" }, { "indexed": false, "internalType": "uint256", "name": "_depositLossSinceLastOperation", "type": "uint256" }, { "indexed": false, "internalType": "int256", "name": "_depositChange", "type": "int256" }, { "indexed": false, "internalType": "uint256", "name": "_yieldGainSinceLastOperation", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_yieldGainClaimed", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_ethGainSinceLastOperation", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_ethGainClaimed", "type": "uint256" }], "name": "DepositOperation", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "_depositor", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_newDeposit", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_stashedColl", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_snapshotP", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_snapshotS", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_snapshotB", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_snapshotScale", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_snapshotEpoch", "type": "uint256" }], "name": "DepositUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint128", "name": "_currentEpoch", "type": "uint128" }], "name": "EpochUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "EtherSent", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "_P", "type": "uint256" }], "name": "P_Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newPriceFeedAddress", "type": "address" }], "name": "PriceFeedAddressChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "_S", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "_epoch", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "_scale", "type": "uint128" }], "name": "S_Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint128", "name": "_currentScale", "type": "uint128" }], "name": "ScaleUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "_newBalance", "type": "uint256" }], "name": "StabilityPoolBoldBalanceUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "_newBalance", "type": "uint256" }], "name": "StabilityPoolCollBalanceUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newTroveManagerAddress", "type": "address" }], "name": "TroveManagerAddressChanged", "type": "event" }, { "inputs": [], "name": "NAME", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "P", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SCALE_FACTOR", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "activePool", "outputs": [{ "internalType": "contract IActivePool", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "boldToken", "outputs": [{ "internalType": "contract IBoldToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "claimAllCollGains", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "collToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "currentEpoch", "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "currentScale", "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "depositSnapshots", "outputs": [{ "internalType": "uint256", "name": "S", "type": "uint256" }, { "internalType": "uint256", "name": "P", "type": "uint256" }, { "internalType": "uint256", "name": "B", "type": "uint256" }, { "internalType": "uint128", "name": "scale", "type": "uint128" }, { "internalType": "uint128", "name": "epoch", "type": "uint128" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "deposits", "outputs": [{ "internalType": "uint256", "name": "initialValue", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }, { "internalType": "uint128", "name": "", "type": "uint128" }], "name": "epochToScaleToB", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }, { "internalType": "uint128", "name": "", "type": "uint128" }], "name": "epochToScaleToS", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCollBalance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getCompoundedBoldDeposit", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorCollGain", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorYieldGain", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorYieldGainWithPending", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getEntireSystemColl", "outputs": [{ "internalType": "uint256", "name": "entireSystemColl", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getEntireSystemDebt", "outputs": [{ "internalType": "uint256", "name": "entireSystemDebt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getTotalBoldDeposits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getYieldGainsOwed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getYieldGainsPending", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastBoldLossError_Offset", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastBoldLossError_TotalDeposits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastCollError_Offset", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastYieldError", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_debtToOffset", "type": "uint256" }, { "internalType": "uint256", "name": "_collToAdd", "type": "uint256" }], "name": "offset", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_topUp", "type": "uint256" }, { "internalType": "bool", "name": "_doClaim", "type": "bool" }], "name": "provideToSP", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "stashedColl", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_boldYield", "type": "uint256" }], "name": "triggerBoldRewards", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "troveManager", "outputs": [{ "internalType": "contract ITroveManager", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "bool", "name": "_doClaim", "type": "bool" }], "name": "withdrawFromSP", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
1125
+ "networks": {}
1126
+ },
1114
1127
  "FluidView": {
1115
1128
  "abi": [{ "inputs": [], "name": "getAllFTokens", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAllFTokensData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getAllUserEarnPositionsWithFTokens", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition[]", "name": "userPositions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "fTokensData", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }], "name": "getFTokenData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getPositionByNftId", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition", "name": "position", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }], "internalType": "struct FluidView.VaultData", "name": "vault", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "ratio", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPosition", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPositionWithFToken", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "userPosition", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIdsWithVaultIds", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "address", "name": "vaultAddr", "type": "address" }], "internalType": "struct FluidView.NftWithVault[]", "name": "retVal", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserPositions", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition[]", "name": "positions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }], "internalType": "struct FluidView.VaultData[]", "name": "vaults", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultData", "outputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }], "internalType": "struct FluidView.VaultData", "name": "vaultData", "type": "tuple" }], "stateMutability": "view", "type": "function" }],
1116
1129
  "networks": {
@@ -44,8 +44,8 @@ const getLiquityV2AggregatedPositionData = ({ usedAssets, assetsData, minCollRat
44
44
  payload.borrowLimitUsd = new decimal_js_1.default(payload.suppliedUsd).div(minCollRatio).mul(100).toString();
45
45
  const leftToBorrowUsd = new decimal_js_1.default(payload.borrowLimitUsd).sub(payload.borrowedUsd);
46
46
  payload.leftToBorrowUsd = leftToBorrowUsd.lte('0') ? '0' : leftToBorrowUsd.toString();
47
- payload.ratio = +payload.suppliedUsd ? new decimal_js_1.default(payload.borrowLimitUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
48
- payload.collRatio = +payload.suppliedUsd ? new decimal_js_1.default(payload.suppliedUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
47
+ payload.ratio = (+payload.suppliedUsd && +payload.borrowedUsd) ? new decimal_js_1.default(payload.borrowLimitUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
48
+ payload.collRatio = (+payload.suppliedUsd && +payload.borrowedUsd) ? new decimal_js_1.default(payload.suppliedUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
49
49
  const { netApy, incentiveUsd, totalInterestUsd } = (0, exports.calculateNetApyLiquityV2)(usedAssets, assetsData, interestRate);
50
50
  payload.netApy = netApy;
51
51
  payload.incentiveUsd = incentiveUsd;
@@ -1,6 +1,6 @@
1
1
  import Web3 from 'web3';
2
2
  import { EthAddress, NetworkNumber } from '../types/common';
3
- import { InnerLiquityV2MarketData, LiquityV2AssetsData, LiquityV2MarketData, LiquityV2MarketInfo, LiquityV2TroveData } from '../types';
3
+ import { LiquityV2AssetsData, LiquityV2MarketData, LiquityV2MarketInfo, LiquityV2TroveData, LiquityV2Versions } from '../types';
4
4
  export declare const getLiquityV2MarketData: (web3: Web3, network: NetworkNumber, selectedMarket: LiquityV2MarketInfo, mainnetWeb3: Web3) => Promise<LiquityV2MarketData>;
5
5
  export declare const getLiquityV2UserTroveIds: (web3: Web3, network: NetworkNumber, selectedMarket: LiquityV2MarketInfo, troveNFTAddress: EthAddress, limitBlocksForEventFetching: boolean, account: EthAddress) => Promise<{
6
6
  troves: {
@@ -8,11 +8,16 @@ export declare const getLiquityV2UserTroveIds: (web3: Web3, network: NetworkNumb
8
8
  }[];
9
9
  nextFreeTroveIndex: string;
10
10
  }>;
11
- export declare const getDebtInFrontLiquityV2: (viewContract: any, marketAddress: EthAddress, troveId: string, accumulatedSum?: string, iterations?: number) => Promise<string>;
12
- export declare const getLiquityV2TroveData: (web3: Web3, network: NetworkNumber, { selectedMarket, assetsData, marketData, troveId, }: {
11
+ export declare const getDebtInFrontForSingleMarketLiquityV2: (viewContract: any, marketAddress: EthAddress, troveId: string, accumulatedSum?: string, iterations?: number) => Promise<string>;
12
+ export declare const getDebtInFrontForInterestRateSingleMarketLiquityV2: (viewContract: any, marketAddress: EthAddress, interestRate: string, troveId?: string, accumulatedSum?: string, iterations?: number) => Promise<string>;
13
+ export declare const getAllMarketsUnbackedDebts: (markets: Record<LiquityV2Versions, LiquityV2MarketData>, web3: Web3, network: NetworkNumber) => Promise<Record<LiquityV2Versions, string>>;
14
+ export declare const calculateDebtInFrontLiquityV2: (markets: Record<LiquityV2Versions, LiquityV2MarketData>, selectedMarket: LiquityV2Versions, allMarketsUnbackedDebts: Record<LiquityV2Versions, string>, interestRateDebtInFront: string) => string;
15
+ export declare const getDebtInFrontLiquityV2: (markets: Record<LiquityV2Versions, LiquityV2MarketData>, selectedMarket: LiquityV2Versions, web3: Web3, network: NetworkNumber, viewContract: any, troveId: string) => Promise<string>;
16
+ export declare const getDebtInFrontForInterestRateLiquityV2: (markets: Record<LiquityV2Versions, LiquityV2MarketData>, selectedMarket: LiquityV2Versions, web3: Web3, network: NetworkNumber, viewContract: any, interestRate: string) => Promise<string>;
17
+ export declare const getLiquityV2TroveData: (web3: Web3, network: NetworkNumber, { selectedMarket, assetsData, troveId, allMarketsData, }: {
13
18
  selectedMarket: LiquityV2MarketInfo;
14
19
  assetsData: LiquityV2AssetsData;
15
- marketData: InnerLiquityV2MarketData;
16
20
  troveId: string;
21
+ allMarketsData: Record<LiquityV2Versions, LiquityV2MarketData>;
17
22
  }) => Promise<LiquityV2TroveData>;
18
23
  export declare const getLiquityV2ClaimableCollateral: (collSurplusPoolAddress: EthAddress, account: EthAddress, web3: Web3, network: NetworkNumber) => Promise<string>;
@@ -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 _getDebtInFront = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () { return viewContract.methods.getDebtInFront(marketAddress, troveId, accumulatedSum, iterations).call(); });
137
- const getDebtInFrontLiquityV2 = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () {
138
- const { debt, next } = yield _getDebtInFront(viewContract, marketAddress, troveId, accumulatedSum, iterations);
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.getDebtInFrontLiquityV2)(viewContract, marketAddress, next, debt, iterations);
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 getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, marketData, troveId, }) => __awaiter(void 0, void 0, void 0, function* () {
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 [data, debtInFront] = yield Promise.all([
204
+ const [_data, debtInFront] = yield Promise.all([
149
205
  viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
150
- (0, exports.getDebtInFrontLiquityV2)(viewContract, marketAddress, troveId),
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, troveStatus: types_1.LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
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;
@@ -1953,7 +1953,7 @@ const FluidMarkets = (networkId) => ({
1953
1953
  [types_1.FluidBaseVersions.WSTETH_CBBTC_16_BASE]: (0, exports.WSTETH_CBBTC_16_BASE)(networkId),
1954
1954
  });
1955
1955
  exports.FluidMarkets = FluidMarkets;
1956
- const getFluidVersionsDataForNetwork = (network) => (Object.values((0, exports.FluidMarkets)(network)).filter(({ chainIds, marketAddress, type }) => !!marketAddress && chainIds.includes(network) && type === types_1.FluidVaultType.T1));
1956
+ const getFluidVersionsDataForNetwork = (network) => (Object.values((0, exports.FluidMarkets)(network)).filter(({ chainIds, marketAddress }) => !!marketAddress && chainIds.includes(network)));
1957
1957
  exports.getFluidVersionsDataForNetwork = getFluidVersionsDataForNetwork;
1958
1958
  const getFluidMarketInfoById = (vaultId, network = 1) => (0, exports.getFluidVersionsDataForNetwork)(network).find(({ id }) => id === vaultId);
1959
1959
  exports.getFluidMarketInfoById = getFluidMarketInfoById;
@@ -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';