@defisaver/positions-sdk 2.1.127-midnight-8-dev → 2.1.127-midnight-10-dev

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 (119) hide show
  1. package/cjs/aaveV4/index.js +26 -10
  2. package/cjs/aaveV4/merkl.d.ts +2 -1
  3. package/cjs/aaveV4/merkl.js +42 -35
  4. package/cjs/config/contracts.d.ts +0 -938
  5. package/cjs/config/contracts.js +2 -8
  6. package/cjs/contracts.d.ts +0 -23433
  7. package/cjs/contracts.js +2 -3
  8. package/cjs/helpers/aaveV4Helpers/index.d.ts +7 -1
  9. package/cjs/helpers/aaveV4Helpers/index.js +22 -10
  10. package/cjs/helpers/index.d.ts +0 -1
  11. package/cjs/helpers/index.js +1 -2
  12. package/cjs/helpers/morphoMidnightHelpers/index.d.ts +4 -57
  13. package/cjs/helpers/morphoMidnightHelpers/index.js +15 -72
  14. package/cjs/helpers/morphoMidnightHelpers/rate.d.ts +4 -0
  15. package/cjs/helpers/morphoMidnightHelpers/rate.js +14 -1
  16. package/cjs/helpers/morphoMidnightHelpers/tenor.d.ts +8 -4
  17. package/cjs/helpers/morphoMidnightHelpers/tenor.js +12 -14
  18. package/cjs/index.d.ts +1 -2
  19. package/cjs/index.js +1 -3
  20. package/cjs/markets/index.d.ts +0 -1
  21. package/cjs/markets/index.js +1 -3
  22. package/cjs/markets/morphoBlue/index.d.ts +6 -0
  23. package/cjs/markets/morphoBlue/index.js +53 -2
  24. package/cjs/portfolio/discovery.d.ts +1 -1
  25. package/cjs/portfolio/discovery.js +1 -1
  26. package/cjs/portfolio/index.js +0 -32
  27. package/cjs/services/utils.d.ts +1 -0
  28. package/cjs/services/utils.js +3 -1
  29. package/cjs/staking/staking.js +1 -2
  30. package/cjs/types/aaveV4.d.ts +5 -0
  31. package/cjs/types/common.d.ts +4 -0
  32. package/cjs/types/common.js +6 -1
  33. package/cjs/types/index.d.ts +0 -1
  34. package/cjs/types/index.js +0 -1
  35. package/cjs/types/merkl.d.ts +3 -4
  36. package/cjs/types/morphoBlue.d.ts +3 -0
  37. package/cjs/types/morphoBlue.js +3 -0
  38. package/cjs/types/portfolio.d.ts +0 -4
  39. package/esm/aaveV4/index.js +27 -11
  40. package/esm/aaveV4/merkl.d.ts +2 -1
  41. package/esm/aaveV4/merkl.js +41 -35
  42. package/esm/config/contracts.d.ts +0 -938
  43. package/esm/config/contracts.js +0 -6
  44. package/esm/contracts.d.ts +0 -23433
  45. package/esm/contracts.js +0 -1
  46. package/esm/helpers/aaveV4Helpers/index.d.ts +7 -1
  47. package/esm/helpers/aaveV4Helpers/index.js +21 -10
  48. package/esm/helpers/index.d.ts +0 -1
  49. package/esm/helpers/index.js +0 -1
  50. package/esm/helpers/morphoMidnightHelpers/index.d.ts +4 -57
  51. package/esm/helpers/morphoMidnightHelpers/index.js +14 -73
  52. package/esm/helpers/morphoMidnightHelpers/rate.d.ts +4 -0
  53. package/esm/helpers/morphoMidnightHelpers/rate.js +12 -0
  54. package/esm/helpers/morphoMidnightHelpers/tenor.d.ts +8 -4
  55. package/esm/helpers/morphoMidnightHelpers/tenor.js +12 -13
  56. package/esm/index.d.ts +1 -2
  57. package/esm/index.js +1 -2
  58. package/esm/markets/index.d.ts +0 -1
  59. package/esm/markets/index.js +0 -1
  60. package/esm/markets/morphoBlue/index.d.ts +6 -0
  61. package/esm/markets/morphoBlue/index.js +48 -0
  62. package/esm/portfolio/discovery.d.ts +1 -1
  63. package/esm/portfolio/discovery.js +1 -1
  64. package/esm/portfolio/index.js +1 -33
  65. package/esm/services/utils.d.ts +1 -0
  66. package/esm/services/utils.js +1 -0
  67. package/esm/staking/staking.js +1 -2
  68. package/esm/types/aaveV4.d.ts +5 -0
  69. package/esm/types/common.d.ts +4 -0
  70. package/esm/types/common.js +5 -0
  71. package/esm/types/index.d.ts +0 -1
  72. package/esm/types/index.js +0 -1
  73. package/esm/types/merkl.d.ts +3 -4
  74. package/esm/types/morphoBlue.d.ts +3 -0
  75. package/esm/types/morphoBlue.js +3 -0
  76. package/esm/types/portfolio.d.ts +0 -4
  77. package/package.json +1 -1
  78. package/src/aaveV4/index.ts +29 -11
  79. package/src/aaveV4/merkl.ts +41 -32
  80. package/src/config/contracts.ts +0 -6
  81. package/src/contracts.ts +0 -1
  82. package/src/helpers/aaveV4Helpers/index.ts +22 -9
  83. package/src/helpers/index.ts +0 -1
  84. package/src/helpers/morphoMidnightHelpers/index.ts +16 -69
  85. package/src/helpers/morphoMidnightHelpers/rate.ts +25 -0
  86. package/src/helpers/morphoMidnightHelpers/tenor.ts +12 -16
  87. package/src/index.ts +0 -2
  88. package/src/markets/index.ts +0 -1
  89. package/src/markets/morphoBlue/index.ts +49 -1
  90. package/src/portfolio/discovery.ts +1 -1
  91. package/src/portfolio/index.ts +0 -33
  92. package/src/services/utils.ts +2 -0
  93. package/src/staking/staking.ts +1 -2
  94. package/src/types/aaveV4.ts +5 -0
  95. package/src/types/common.ts +5 -0
  96. package/src/types/index.ts +0 -1
  97. package/src/types/merkl.ts +3 -3
  98. package/src/types/morphoBlue.ts +3 -0
  99. package/src/types/portfolio.ts +0 -4
  100. package/cjs/eulerV2/index.d.ts +0 -47
  101. package/cjs/eulerV2/index.js +0 -225
  102. package/cjs/helpers/eulerHelpers/index.d.ts +0 -22
  103. package/cjs/helpers/eulerHelpers/index.js +0 -231
  104. package/cjs/markets/euler/index.d.ts +0 -8
  105. package/cjs/markets/euler/index.js +0 -30
  106. package/cjs/types/euler.d.ts +0 -153
  107. package/cjs/types/euler.js +0 -14
  108. package/esm/eulerV2/index.d.ts +0 -47
  109. package/esm/eulerV2/index.js +0 -215
  110. package/esm/helpers/eulerHelpers/index.d.ts +0 -22
  111. package/esm/helpers/eulerHelpers/index.js +0 -218
  112. package/esm/markets/euler/index.d.ts +0 -8
  113. package/esm/markets/euler/index.js +0 -24
  114. package/esm/types/euler.d.ts +0 -153
  115. package/esm/types/euler.js +0 -11
  116. package/src/eulerV2/index.ts +0 -331
  117. package/src/helpers/eulerHelpers/index.ts +0 -232
  118. package/src/markets/euler/index.ts +0 -27
  119. package/src/types/euler.ts +0 -178
package/cjs/contracts.js CHANGED
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.UUPSViem = exports.LiquityStabilityPoolViem = exports.LiquityLQTYStakingViem = exports.AaveUmbrellaViewViem = exports.AaveIncentivesControllerViem = exports.FluidViewContractViem = exports.LiquityV2LegacyViewContractViem = exports.LiquityV2ViewContractViem = exports.LiquityActivePoolContractViem = exports.LiquityPriceFeedContractViem = exports.LiquityTroveManagerContractViem = exports.LiquityCollSurplusPoolContractViem = exports.LiquityViewContractViem = exports.BTCPriceFeedContractViem = exports.WeETHPriceFeedContractViem = exports.ComptrollerContractViem = exports.CompoundLoanInfoContractViem = exports.McdJugContractViem = exports.McdDogContractViem = exports.McdSpotterContractViem = exports.McdVatContractViem = exports.McdViewContractViem = exports.McdGetCdpsContractViem = exports.LlamaLendViewContractViem = exports.CrvUSDFactoryContractViem = exports.CrvUSDViewContractViem = exports.EulerV2ViewContractViem = exports.SparkIncentiveDataProviderContractViem = exports.SparkViewContractViem = exports.CompV3ViewContractViem = exports.WstETHPriceFeedContractViem = exports.USDCPriceFeedContractViem = exports.ETHPriceFeedContractViem = exports.COMPPriceFeedContractViem = exports.DFSFeedRegistryContractViem = exports.FeedRegistryContractViem = exports.AaveIncentiveDataProviderV3ContractViem = exports.AaveV3ViewContractViem = exports.AaveLoanInfoV2ContractViem = exports.MorphoMidnightViewContractViem = exports.MorphoBlueViewContractViem = exports.getYearnV3VaultContractViem = exports.getErc4626ContractViem = exports.getErc20ContractViem = exports.getSparkSavingsVaultContractViem = exports.getYearnVaultContractViem = exports.getMorphoVaultContractViem = exports.createViemContractFromConfigFunc = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
37
- exports.UniswapTokenDistributorViem = exports.AaveV4ViewContractViem = exports.SkySavingsContractView = exports.MakerDsrContractViem = exports.YearnViewContractViem = exports.StkAAVEViem = exports.LiquityV2sBoldVaultViem = exports.AaveRewardsControllerViem = exports.SparkRewardsControllerViem = void 0;
36
+ exports.SparkRewardsControllerViem = exports.UUPSViem = exports.LiquityStabilityPoolViem = exports.LiquityLQTYStakingViem = exports.AaveUmbrellaViewViem = exports.AaveIncentivesControllerViem = exports.FluidViewContractViem = exports.LiquityV2LegacyViewContractViem = exports.LiquityV2ViewContractViem = exports.LiquityActivePoolContractViem = exports.LiquityPriceFeedContractViem = exports.LiquityTroveManagerContractViem = exports.LiquityCollSurplusPoolContractViem = exports.LiquityViewContractViem = exports.BTCPriceFeedContractViem = exports.WeETHPriceFeedContractViem = exports.ComptrollerContractViem = exports.CompoundLoanInfoContractViem = exports.McdJugContractViem = exports.McdDogContractViem = exports.McdSpotterContractViem = exports.McdVatContractViem = exports.McdViewContractViem = exports.McdGetCdpsContractViem = exports.LlamaLendViewContractViem = exports.CrvUSDFactoryContractViem = exports.CrvUSDViewContractViem = exports.SparkIncentiveDataProviderContractViem = exports.SparkViewContractViem = exports.CompV3ViewContractViem = exports.WstETHPriceFeedContractViem = exports.USDCPriceFeedContractViem = exports.ETHPriceFeedContractViem = exports.COMPPriceFeedContractViem = exports.DFSFeedRegistryContractViem = exports.FeedRegistryContractViem = exports.AaveIncentiveDataProviderV3ContractViem = exports.AaveV3ViewContractViem = exports.AaveLoanInfoV2ContractViem = exports.MorphoMidnightViewContractViem = exports.MorphoBlueViewContractViem = exports.getYearnV3VaultContractViem = exports.getErc4626ContractViem = exports.getErc20ContractViem = exports.getSparkSavingsVaultContractViem = exports.getYearnVaultContractViem = exports.getMorphoVaultContractViem = exports.createViemContractFromConfigFunc = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
37
+ exports.UniswapTokenDistributorViem = exports.AaveV4ViewContractViem = exports.SkySavingsContractView = exports.MakerDsrContractViem = exports.YearnViewContractViem = exports.StkAAVEViem = exports.LiquityV2sBoldVaultViem = exports.AaveRewardsControllerViem = void 0;
38
38
  const viem_1 = require("viem");
39
39
  const configRaw = __importStar(require("./config/contracts"));
40
40
  // @ts-ignore
@@ -153,7 +153,6 @@ exports.WstETHPriceFeedContractViem = (0, exports.createViemContractFromConfigFu
153
153
  exports.CompV3ViewContractViem = (0, exports.createViemContractFromConfigFunc)('CompV3View');
154
154
  exports.SparkViewContractViem = (0, exports.createViemContractFromConfigFunc)('SparkView');
155
155
  exports.SparkIncentiveDataProviderContractViem = (0, exports.createViemContractFromConfigFunc)('SparkIncentiveDataProvider');
156
- exports.EulerV2ViewContractViem = (0, exports.createViemContractFromConfigFunc)('EulerV2View');
157
156
  exports.CrvUSDViewContractViem = (0, exports.createViemContractFromConfigFunc)('crvUSDView');
158
157
  exports.CrvUSDFactoryContractViem = (0, exports.createViemContractFromConfigFunc)('crvUSDFactory');
159
158
  exports.LlamaLendViewContractViem = (0, exports.createViemContractFromConfigFunc)('LlamaLendView');
@@ -1,5 +1,11 @@
1
- import { AaveV4AggregatedPositionData, AaveV4AssetsData, AaveV4ReserveAssetData, AaveV4SpokeInfo, AaveV4UsedReserveAsset, AaveV4UsedReserveAssets, EthereumProvider, LeverageType, NetworkNumber } from '../../types';
1
+ import { AaveV4AggregatedPositionData, AaveV4AssetsData, AaveV4ReserveAssetData, AaveV4SpokeInfo, AaveV4UsedReserveAsset, AaveV4UsedReserveAssets, EthereumProvider, IncentiveData, IncentiveSide, LeverageType, NetworkNumber } from '../../types';
2
2
  export declare const calcUserRiskPremiumBps: (usedAssets: AaveV4UsedReserveAssets, assetsData: AaveV4AssetsData) => number;
3
+ /**
4
+ * The incentives that actually accrue to a position on this reserve for the given side: the
5
+ * intrinsic (staking) incentives plus the single applicable Merkl reward. Display surfaces should
6
+ * use this rather than picking a scoped list directly, so badges always match the net APY math.
7
+ */
8
+ export declare const getAaveV4ApplicableIncentives: (assetData: AaveV4ReserveAssetData, side: IncentiveSide) => IncentiveData[];
3
9
  export declare const calculateNetApyAaveV4: ({ usedAssets, assetsData, }: {
4
10
  usedAssets: AaveV4UsedReserveAssets;
5
11
  assetsData: AaveV4AssetsData;
@@ -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.getAaveV4ApyAfterValuesEstimation = exports.aaveV4GetAggregatedPositionData = exports.isLeveragedPosAaveV4 = exports.aaveV4GetCollateralFactor = exports.calculateNetApyAaveV4 = exports.calcUserRiskPremiumBps = void 0;
15
+ exports.getAaveV4ApyAfterValuesEstimation = exports.aaveV4GetAggregatedPositionData = exports.isLeveragedPosAaveV4 = exports.aaveV4GetCollateralFactor = exports.calculateNetApyAaveV4 = exports.getAaveV4ApplicableIncentives = exports.calcUserRiskPremiumBps = void 0;
16
16
  const decimal_js_1 = __importDefault(require("decimal.js"));
17
17
  const tokens_1 = require("@defisaver/tokens");
18
18
  const moneymarket_1 = require("../../moneymarket");
@@ -76,14 +76,26 @@ const calcUserRiskPremiumBps = (usedAssets, assetsData) => {
76
76
  exports.calcUserRiskPremiumBps = calcUserRiskPremiumBps;
77
77
  /**
78
78
  * `spokeXIncentives`/`hubXIncentives` are each the intrinsic `base` list with at most one Merkl
79
- * reward appended (see attachAaveV4MerklIncentives). Both scopes can apply to the same position at
80
- * once (spoke-specific + hub-wide), so the full applicable set is base + whatever each scope appended.
79
+ * reward appended (see attachAaveV4MerklIncentives). Merkl regularly publishes the same reward
80
+ * stream at both scopes (a spoke campaign and a hub campaign covering the same borrows, e.g. USDC
81
+ * borrowed from the Prime Hub via the Bluechip Spoke), so the scopes must never be summed — the
82
+ * more specific spoke reward wins and the hub reward only applies when no spoke campaign exists,
83
+ * which is also what every per-asset APY badge (and Aave's own UI) shows.
81
84
  */
82
- const mergeScopedIncentives = (base = [], spokeScoped, hubScoped) => [
83
- ...base,
84
- ...(spokeScoped ? spokeScoped.slice(base.length) : []),
85
- ...(hubScoped ? hubScoped.slice(base.length) : []),
86
- ];
85
+ const mergeScopedIncentives = (base = [], spokeScoped, hubScoped) => {
86
+ const spokeExtras = spokeScoped ? spokeScoped.slice(base.length) : [];
87
+ const hubExtras = hubScoped ? hubScoped.slice(base.length) : [];
88
+ return [...base, ...(spokeExtras.length ? spokeExtras : hubExtras)];
89
+ };
90
+ /**
91
+ * The incentives that actually accrue to a position on this reserve for the given side: the
92
+ * intrinsic (staking) incentives plus the single applicable Merkl reward. Display surfaces should
93
+ * use this rather than picking a scoped list directly, so badges always match the net APY math.
94
+ */
95
+ const getAaveV4ApplicableIncentives = (assetData, side) => (side === types_1.IncentiveSide.Supply
96
+ ? mergeScopedIncentives(assetData.supplyIncentives, assetData.spokeSupplyIncentives, assetData.hubSupplyIncentives)
97
+ : mergeScopedIncentives(assetData.borrowIncentives, assetData.spokeBorrowIncentives, assetData.hubBorrowIncentives));
98
+ exports.getAaveV4ApplicableIncentives = getAaveV4ApplicableIncentives;
87
99
  const calculateNetApyAaveV4 = ({ usedAssets, assetsData, }) => {
88
100
  const riskPremiumBps = (0, exports.calcUserRiskPremiumBps)(usedAssets, assetsData);
89
101
  const riskPremiumFraction = new decimal_js_1.default(riskPremiumBps).div(10000);
@@ -97,7 +109,7 @@ const calculateNetApyAaveV4 = ({ usedAssets, assetsData, }) => {
97
109
  acc.suppliedUsd = new decimal_js_1.default(acc.suppliedUsd).add(amount).toString();
98
110
  const supplyInterest = (0, staking_1.calculateInterestEarned)(amount, assetData.supplyRate, 'year', true);
99
111
  acc.supplyInterest = new decimal_js_1.default(acc.supplyInterest).add(supplyInterest.toString()).toString();
100
- const supplyIncentives = mergeScopedIncentives(assetData.supplyIncentives, assetData.spokeSupplyIncentives, assetData.hubSupplyIncentives);
112
+ const supplyIncentives = (0, exports.getAaveV4ApplicableIncentives)(assetData, types_1.IncentiveSide.Supply);
101
113
  for (const supplyIncentive of supplyIncentives) {
102
114
  const incentiveInterest = (0, staking_1.calculateInterestEarned)(amount, supplyIncentive.apy, 'year', true);
103
115
  acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
@@ -113,7 +125,7 @@ const calculateNetApyAaveV4 = ({ usedAssets, assetsData, }) => {
113
125
  const userBorrowRate = (0, moneymarket_1.aprToApy)(userBorrowApr.toString());
114
126
  const borrowInterest = (0, staking_1.calculateInterestEarned)(amount, userBorrowRate, 'year', true);
115
127
  acc.borrowInterest = new decimal_js_1.default(acc.borrowInterest).sub(borrowInterest.toString()).toString();
116
- const borrowIncentives = mergeScopedIncentives(assetData.borrowIncentives, assetData.spokeBorrowIncentives, assetData.hubBorrowIncentives);
128
+ const borrowIncentives = (0, exports.getAaveV4ApplicableIncentives)(assetData, types_1.IncentiveSide.Borrow);
117
129
  for (const borrowIncentive of borrowIncentives) {
118
130
  const incentiveInterest = (0, staking_1.calculateInterestEarned)(amount, borrowIncentive.apy, 'year', true);
119
131
  acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
@@ -7,6 +7,5 @@ export * as morphoBlueHelpers from './morphoBlueHelpers';
7
7
  export * as morphoMidnightHelpers from './morphoMidnightHelpers';
8
8
  export * as llamaLendHelpers from './llamaLendHelpers';
9
9
  export * as liquityV2Helpers from './liquityV2Helpers';
10
- export * as eulerV2Helpers from './eulerHelpers';
11
10
  export * as fluidHelpers from './fluidHelpers';
12
11
  export * as aaveV4Helpers from './aaveV4Helpers';
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.aaveV4Helpers = exports.fluidHelpers = exports.eulerV2Helpers = exports.liquityV2Helpers = exports.llamaLendHelpers = exports.morphoMidnightHelpers = exports.morphoBlueHelpers = exports.makerHelpers = exports.curveUsdHelpers = exports.sparkHelpers = exports.compoundHelpers = exports.aaveHelpers = void 0;
36
+ exports.aaveV4Helpers = exports.fluidHelpers = exports.liquityV2Helpers = exports.llamaLendHelpers = exports.morphoMidnightHelpers = exports.morphoBlueHelpers = exports.makerHelpers = exports.curveUsdHelpers = exports.sparkHelpers = exports.compoundHelpers = exports.aaveHelpers = void 0;
37
37
  exports.aaveHelpers = __importStar(require("./aaveHelpers"));
38
38
  exports.compoundHelpers = __importStar(require("./compoundHelpers"));
39
39
  exports.sparkHelpers = __importStar(require("./sparkHelpers"));
@@ -43,6 +43,5 @@ exports.morphoBlueHelpers = __importStar(require("./morphoBlueHelpers"));
43
43
  exports.morphoMidnightHelpers = __importStar(require("./morphoMidnightHelpers"));
44
44
  exports.llamaLendHelpers = __importStar(require("./llamaLendHelpers"));
45
45
  exports.liquityV2Helpers = __importStar(require("./liquityV2Helpers"));
46
- exports.eulerV2Helpers = __importStar(require("./eulerHelpers"));
47
46
  exports.fluidHelpers = __importStar(require("./fluidHelpers"));
48
47
  exports.aaveV4Helpers = __importStar(require("./aaveV4Helpers"));
@@ -1,7 +1,7 @@
1
1
  import Dec from 'decimal.js';
2
2
  import { MMUsedAssets, NetworkNumber } from '../../types/common';
3
3
  import { MorphoMidnightAggregatedPositionData, MorphoMidnightAssetsData, MorphoMidnightBookSide, MorphoMidnightMarketData, MorphoMidnightMarketInfo, MorphoMidnightParsedBook } from '../../types';
4
- export { buildMidnightParsedBook, midnightApyFromPrice, midnightBookBestFirst, midnightPriceFromApy, midnightTimeToMaturityDays, } from './rate';
4
+ export { buildMidnightParsedBook, midnightApyFromPrice, midnightBookBestFirst, midnightBoundPrice, midnightPriceFromApy, midnightTimeToMaturityDays, MIDNIGHT_DEFAULT_RATE_SLIPPAGE, } from './rate';
5
5
  export { tenorBookKeyFor, tenorBookRateToApyPercent, tenorOfferFillToApiFill, tenorOfferToApiOffer, } from './tenor';
6
6
  /**
7
7
  * Aggregate a Morpho Midnight position. Midnight markets are multi-collateral, so the borrow limit is
@@ -88,59 +88,6 @@ export declare const getMorphoMidnightUserBorrowInfo: (account: string, marketId
88
88
  * JSON, so without the `res.ok` check it parses as an empty book and the market silently vanishes.
89
89
  */
90
90
  export declare const getMorphoMidnightMarketBook: (market: MorphoMidnightMarketData, network: NetworkNumber, side?: MorphoMidnightBookSide) => Promise<MorphoMidnightParsedBook | null>;
91
- /**
92
- * Quote a prospective borrow against the Midnight order book: the estimated rate, the debt units it adds,
93
- * and the `maxUnits` cap sent on-chain to protect the user if better offers get filled first. `assetsRaw`
94
- * (and the returned `newUnits`/`maxUnits`) are raw loan-token base units — callers convert to/from human
95
- * amounts. Throws if the book can't fill the amount (caller handles).
96
- *
97
- * Two ways to set the cap:
98
- * - `maxBorrowRate` — an absolute APY ceiling, honoured **exactly**: the cap price is derived locally via
99
- * `midnightPriceFromApy`. Prefer this when a user pins a max rate.
100
- * - otherwise `slippagePercent`, the API's own knob. Note it is a **price**-level slippage, not APY points:
101
- * near maturity the annualisation factor (365 / ttmDays) multiplies it heavily, so on a 22-day market a
102
- * slippage of 0.5 permitted an APY ~9pp above the estimate, not 0.5pp. It also saturates at the book's
103
- * cheapest bid. `maxRate` therefore reports what the cap actually permits, derived from the cap price.
104
- *
105
- * A `maxBorrowRate` below `estBorrowRate` yields `maxUnits < newUnits` — the borrow would revert on-chain.
106
- * Compare the two before submitting and tell the user their ceiling is under the market rate.
107
- *
108
- * Tenor-hosted markets (see `isTenorMidnightMarket`) are quoted against Tenor's router instead of Morpho's
109
- * book API. Slippage is applied locally to `maxUnits`; `taker` is the position owner (the smart wallet).
110
- */
111
- export declare const getMorphoMidnightBorrowQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, maxBorrowRate?: Dec.Value, taker?: string) => Promise<MorphoMidnightBorrowQuote>;
112
- /**
113
- * Quote a prospective payback against the ask side of the Midnight order book: the rate the repayment
114
- * retires debt at, the debt units it buys, and the `minUnits` floor sent on-chain to protect the user if
115
- * the cheap offers get taken first. `assetsRaw` is the amount **spent** (raw loan-token base units) —
116
- * matching `MidnightPaybackFromOrders`, whose `amount` is what leaves the wallet; the units bought, and
117
- * therefore the debt retired, exceed it because a unit costs less than one loan token before maturity.
118
- * Throws if the book can't fill the amount (caller handles).
119
- *
120
- * The mirror image of the borrow quote in every respect. A repayer wants a *high* rate, i.e. cheap units,
121
- * so the guard is a floor rather than a ceiling:
122
- * - `minPaybackRate` — an absolute APY floor, honoured **exactly** via `midnightPriceFromApy`. Prefer
123
- * this when a user pins a min rate.
124
- * - otherwise `slippagePercent`, the API's own price-level knob, whose APY effect is amplified by the
125
- * annualisation factor near maturity. `minRate` reports what the floor actually permits.
126
- *
127
- * A `minPaybackRate` above `estPaybackRate` yields `minUnits > newUnits` — the payback would revert
128
- * on-chain. Compare the two before submitting and tell the user their floor is over the market rate.
129
- */
130
- export declare const getMorphoMidnightPaybackQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string) => Promise<MorphoMidnightPaybackQuote>;
131
- /**
132
- * Payback quoted against a **units** target instead of a spend: "retire exactly these debt units, and tell
133
- * me what that costs". The sibling of `getMorphoMidnightPaybackQuote` in every other respect — same ask
134
- * side, same rate floor, same offer list — but with the two amounts swapped, so the on-chain guard becomes
135
- * a ceiling on assets spent rather than a floor on units bought.
136
- *
137
- * This is what a **full close** must be sized with. Retiring N units costs less than N loan tokens before
138
- * maturity, so quoting the close as a spend of the debt's face value asks the book for more depth than the
139
- * close needs (and can be refused for liquidity that is in fact there), and caps the taker's spend at more
140
- * than the position is worth. Callers that cannot refund an overspend — a taker calling the bundler
141
- * directly, rather than through an action contract that sweeps the remainder back — need this quote.
142
- *
143
- * A `minPaybackRate` above `estPaybackRate` yields `maxAssets < newAssets`: the ceiling is under what the
144
- * buy costs and it would revert on-chain, the mirror of the assets-target quote's `minUnits > newUnits`.
145
- */
146
- export declare const getMorphoMidnightPaybackUnitsQuote: (marketId: string, unitsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string) => Promise<MorphoMidnightPaybackUnitsQuote>;
91
+ export declare const getMorphoMidnightBorrowQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, maxBorrowRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value) => Promise<MorphoMidnightBorrowQuote>;
92
+ export declare const getMorphoMidnightPaybackQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value) => Promise<MorphoMidnightPaybackQuote>;
93
+ export declare const getMorphoMidnightPaybackUnitsQuote: (marketId: string, unitsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value) => Promise<MorphoMidnightPaybackUnitsQuote>;
@@ -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.getMorphoMidnightPaybackUnitsQuote = exports.getMorphoMidnightPaybackQuote = exports.getMorphoMidnightBorrowQuote = exports.getMorphoMidnightMarketBook = exports.getMorphoMidnightUserBorrowInfo = exports.midnightSlippageParam = exports.getMorphoMidnightAggregatedPositionData = exports.tenorOfferToApiOffer = exports.tenorOfferFillToApiFill = exports.tenorBookRateToApyPercent = exports.tenorBookKeyFor = exports.midnightTimeToMaturityDays = exports.midnightPriceFromApy = exports.midnightBookBestFirst = exports.midnightApyFromPrice = exports.buildMidnightParsedBook = void 0;
15
+ exports.getMorphoMidnightPaybackUnitsQuote = exports.getMorphoMidnightPaybackQuote = exports.getMorphoMidnightBorrowQuote = exports.getMorphoMidnightMarketBook = exports.getMorphoMidnightUserBorrowInfo = exports.midnightSlippageParam = exports.getMorphoMidnightAggregatedPositionData = exports.tenorOfferToApiOffer = exports.tenorOfferFillToApiFill = exports.tenorBookRateToApyPercent = exports.tenorBookKeyFor = exports.MIDNIGHT_DEFAULT_RATE_SLIPPAGE = exports.midnightTimeToMaturityDays = exports.midnightPriceFromApy = exports.midnightBoundPrice = exports.midnightBookBestFirst = exports.midnightApyFromPrice = exports.buildMidnightParsedBook = void 0;
16
16
  const decimal_js_1 = __importDefault(require("decimal.js"));
17
17
  const tokens_1 = require("@defisaver/tokens");
18
18
  const moneymarket_1 = require("../../moneymarket");
@@ -27,8 +27,10 @@ var rate_2 = require("./rate");
27
27
  Object.defineProperty(exports, "buildMidnightParsedBook", { enumerable: true, get: function () { return rate_2.buildMidnightParsedBook; } });
28
28
  Object.defineProperty(exports, "midnightApyFromPrice", { enumerable: true, get: function () { return rate_2.midnightApyFromPrice; } });
29
29
  Object.defineProperty(exports, "midnightBookBestFirst", { enumerable: true, get: function () { return rate_2.midnightBookBestFirst; } });
30
+ Object.defineProperty(exports, "midnightBoundPrice", { enumerable: true, get: function () { return rate_2.midnightBoundPrice; } });
30
31
  Object.defineProperty(exports, "midnightPriceFromApy", { enumerable: true, get: function () { return rate_2.midnightPriceFromApy; } });
31
32
  Object.defineProperty(exports, "midnightTimeToMaturityDays", { enumerable: true, get: function () { return rate_2.midnightTimeToMaturityDays; } });
33
+ Object.defineProperty(exports, "MIDNIGHT_DEFAULT_RATE_SLIPPAGE", { enumerable: true, get: function () { return rate_2.MIDNIGHT_DEFAULT_RATE_SLIPPAGE; } });
32
34
  var tenor_2 = require("./tenor");
33
35
  Object.defineProperty(exports, "tenorBookKeyFor", { enumerable: true, get: function () { return tenor_2.tenorBookKeyFor; } });
34
36
  Object.defineProperty(exports, "tenorBookRateToApyPercent", { enumerable: true, get: function () { return tenor_2.tenorBookRateToApyPercent; } });
@@ -194,39 +196,17 @@ const fetchMorphoMidnightQuote = (marketId, side, size, slippagePercent) => __aw
194
196
  takeableOffers: d.takeable_offers || [],
195
197
  };
196
198
  });
197
- /**
198
- * Quote a prospective borrow against the Midnight order book: the estimated rate, the debt units it adds,
199
- * and the `maxUnits` cap sent on-chain to protect the user if better offers get filled first. `assetsRaw`
200
- * (and the returned `newUnits`/`maxUnits`) are raw loan-token base units — callers convert to/from human
201
- * amounts. Throws if the book can't fill the amount (caller handles).
202
- *
203
- * Two ways to set the cap:
204
- * - `maxBorrowRate` — an absolute APY ceiling, honoured **exactly**: the cap price is derived locally via
205
- * `midnightPriceFromApy`. Prefer this when a user pins a max rate.
206
- * - otherwise `slippagePercent`, the API's own knob. Note it is a **price**-level slippage, not APY points:
207
- * near maturity the annualisation factor (365 / ttmDays) multiplies it heavily, so on a 22-day market a
208
- * slippage of 0.5 permitted an APY ~9pp above the estimate, not 0.5pp. It also saturates at the book's
209
- * cheapest bid. `maxRate` therefore reports what the cap actually permits, derived from the cap price.
210
- *
211
- * A `maxBorrowRate` below `estBorrowRate` yields `maxUnits < newUnits` — the borrow would revert on-chain.
212
- * Compare the two before submitting and tell the user their ceiling is under the market rate.
213
- *
214
- * Tenor-hosted markets (see `isTenorMidnightMarket`) are quoted against Tenor's router instead of Morpho's
215
- * book API. Slippage is applied locally to `maxUnits`; `taker` is the position owner (the smart wallet).
216
- */
217
- const getMorphoMidnightBorrowQuote = (marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker) => __awaiter(void 0, void 0, void 0, function* () {
199
+ const getMorphoMidnightBorrowQuote = (marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker, rateSlippagePercent) => __awaiter(void 0, void 0, void 0, function* () {
218
200
  if ((0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
219
- return (0, tenor_1.getTenorBorrowQuote)(marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker);
201
+ return (0, tenor_1.getTenorBorrowQuote)(marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker, rateSlippagePercent);
220
202
  }
221
203
  const quote = yield fetchMorphoMidnightQuote(marketId, 'bids', { assets: assetsRaw }, slippagePercent);
222
- const { bestPrice, worstPrice } = quote;
204
+ const { bestPrice } = quote;
223
205
  const ttmDays = (0, rate_1.midnightTimeToMaturityDays)(maturity);
224
206
  const estBorrowRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
225
207
  // Price the cap sits at, and the rate that price represents — one derivation, so `maxRate` and
226
208
  // `maxUnits` can never disagree about what the user is protected at.
227
- const capPrice = maxBorrowRate !== undefined && new decimal_js_1.default(maxBorrowRate).gt(0)
228
- ? (0, rate_1.midnightPriceFromApy)(maxBorrowRate, ttmDays)
229
- : worstPrice;
209
+ const capPrice = (0, rate_1.midnightBoundPrice)(estBorrowRate, ttmDays, 'ceiling', maxBorrowRate, rateSlippagePercent);
230
210
  const maxRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
231
211
  const newUnits = new decimal_js_1.default(bestPrice).lte(0) ? '0' : new decimal_js_1.default(assetsRaw).div(bestPrice).toFixed(0);
232
212
  const maxUnits = new decimal_js_1.default(capPrice).lte(0) ? '0' : new decimal_js_1.default(assetsRaw).div(capPrice).toFixed(0);
@@ -236,35 +216,15 @@ const getMorphoMidnightBorrowQuote = (marketId, assetsRaw, slippagePercent, matu
236
216
  maxUnits });
237
217
  });
238
218
  exports.getMorphoMidnightBorrowQuote = getMorphoMidnightBorrowQuote;
239
- /**
240
- * Quote a prospective payback against the ask side of the Midnight order book: the rate the repayment
241
- * retires debt at, the debt units it buys, and the `minUnits` floor sent on-chain to protect the user if
242
- * the cheap offers get taken first. `assetsRaw` is the amount **spent** (raw loan-token base units) —
243
- * matching `MidnightPaybackFromOrders`, whose `amount` is what leaves the wallet; the units bought, and
244
- * therefore the debt retired, exceed it because a unit costs less than one loan token before maturity.
245
- * Throws if the book can't fill the amount (caller handles).
246
- *
247
- * The mirror image of the borrow quote in every respect. A repayer wants a *high* rate, i.e. cheap units,
248
- * so the guard is a floor rather than a ceiling:
249
- * - `minPaybackRate` — an absolute APY floor, honoured **exactly** via `midnightPriceFromApy`. Prefer
250
- * this when a user pins a min rate.
251
- * - otherwise `slippagePercent`, the API's own price-level knob, whose APY effect is amplified by the
252
- * annualisation factor near maturity. `minRate` reports what the floor actually permits.
253
- *
254
- * A `minPaybackRate` above `estPaybackRate` yields `minUnits > newUnits` — the payback would revert
255
- * on-chain. Compare the two before submitting and tell the user their floor is over the market rate.
256
- */
257
- const getMorphoMidnightPaybackQuote = (marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker) => __awaiter(void 0, void 0, void 0, function* () {
219
+ const getMorphoMidnightPaybackQuote = (marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent) => __awaiter(void 0, void 0, void 0, function* () {
258
220
  if ((0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
259
- return (0, tenor_1.getTenorPaybackQuote)(marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker);
221
+ return (0, tenor_1.getTenorPaybackQuote)(marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent);
260
222
  }
261
223
  const quote = yield fetchMorphoMidnightQuote(marketId, 'asks', { assets: assetsRaw }, slippagePercent);
262
- const { bestPrice, worstPrice } = quote;
224
+ const { bestPrice } = quote;
263
225
  const ttmDays = (0, rate_1.midnightTimeToMaturityDays)(maturity);
264
226
  const estPaybackRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
265
- const capPrice = minPaybackRate !== undefined && new decimal_js_1.default(minPaybackRate).gt(0)
266
- ? (0, rate_1.midnightPriceFromApy)(minPaybackRate, ttmDays)
267
- : worstPrice;
227
+ const capPrice = (0, rate_1.midnightBoundPrice)(estPaybackRate, ttmDays, 'floor', minPaybackRate, rateSlippagePercent);
268
228
  const minRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
269
229
  // Rounded down on both counts: `newUnits` must not overstate the debt the user sees retired, and a
270
230
  // `minUnits` rounded up would be a stricter floor than asked for and revert a payback that was fine.
@@ -276,32 +236,15 @@ const getMorphoMidnightPaybackQuote = (marketId, assetsRaw, slippagePercent, mat
276
236
  minUnits });
277
237
  });
278
238
  exports.getMorphoMidnightPaybackQuote = getMorphoMidnightPaybackQuote;
279
- /**
280
- * Payback quoted against a **units** target instead of a spend: "retire exactly these debt units, and tell
281
- * me what that costs". The sibling of `getMorphoMidnightPaybackQuote` in every other respect — same ask
282
- * side, same rate floor, same offer list — but with the two amounts swapped, so the on-chain guard becomes
283
- * a ceiling on assets spent rather than a floor on units bought.
284
- *
285
- * This is what a **full close** must be sized with. Retiring N units costs less than N loan tokens before
286
- * maturity, so quoting the close as a spend of the debt's face value asks the book for more depth than the
287
- * close needs (and can be refused for liquidity that is in fact there), and caps the taker's spend at more
288
- * than the position is worth. Callers that cannot refund an overspend — a taker calling the bundler
289
- * directly, rather than through an action contract that sweeps the remainder back — need this quote.
290
- *
291
- * A `minPaybackRate` above `estPaybackRate` yields `maxAssets < newAssets`: the ceiling is under what the
292
- * buy costs and it would revert on-chain, the mirror of the assets-target quote's `minUnits > newUnits`.
293
- */
294
- const getMorphoMidnightPaybackUnitsQuote = (marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker) => __awaiter(void 0, void 0, void 0, function* () {
239
+ const getMorphoMidnightPaybackUnitsQuote = (marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent) => __awaiter(void 0, void 0, void 0, function* () {
295
240
  if ((0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
296
- return (0, tenor_1.getTenorPaybackUnitsQuote)(marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker);
241
+ return (0, tenor_1.getTenorPaybackUnitsQuote)(marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent);
297
242
  }
298
243
  const quote = yield fetchMorphoMidnightQuote(marketId, 'asks', { units: unitsRaw }, slippagePercent);
299
- const { bestPrice, worstPrice } = quote;
244
+ const { bestPrice } = quote;
300
245
  const ttmDays = (0, rate_1.midnightTimeToMaturityDays)(maturity);
301
246
  const estPaybackRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
302
- const capPrice = minPaybackRate !== undefined && new decimal_js_1.default(minPaybackRate).gt(0)
303
- ? (0, rate_1.midnightPriceFromApy)(minPaybackRate, ttmDays)
304
- : worstPrice;
247
+ const capPrice = (0, rate_1.midnightBoundPrice)(estPaybackRate, ttmDays, 'floor', minPaybackRate, rateSlippagePercent);
305
248
  const minRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
306
249
  // Rounded UP on both counts — the mirror of the assets-target quote's ROUND_DOWN. Here the figures are
307
250
  // what the taker SPENDS, so a value rounded down understates the cost by a base unit and would leave the
@@ -7,5 +7,9 @@ export declare const midnightApyFromPrice: (price: Dec.Value, ttmDays: Dec.Value
7
7
  * price = (1 + rate)^(−ttmDays / 365).
8
8
  */
9
9
  export declare const midnightPriceFromApy: (ratePercent: Dec.Value, ttmDays: Dec.Value) => string;
10
+ export declare const MIDNIGHT_DEFAULT_RATE_SLIPPAGE = 0.1;
11
+ /** Which side of the estimate a guard sits on: a ceiling for borrows, a floor for paybacks. */
12
+ export type MidnightRateBoundKind = 'ceiling' | 'floor';
13
+ export declare const midnightBoundPrice: (estRate: Dec.Value, ttmDays: Dec.Value, kind: MidnightRateBoundKind, boundRate?: Dec.Value, rateSlippagePercent?: Dec.Value) => string;
10
14
  export declare const midnightBookBestFirst: (side: MorphoMidnightBookSide) => 1 | -1;
11
15
  export declare const buildMidnightParsedBook: (offers: MorphoMidnightBookOffer[], side: MorphoMidnightBookSide) => MorphoMidnightParsedBook | null;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.buildMidnightParsedBook = exports.midnightBookBestFirst = exports.midnightPriceFromApy = exports.midnightApyFromPrice = exports.midnightTimeToMaturityDays = void 0;
6
+ exports.buildMidnightParsedBook = exports.midnightBookBestFirst = exports.midnightBoundPrice = exports.MIDNIGHT_DEFAULT_RATE_SLIPPAGE = exports.midnightPriceFromApy = exports.midnightApyFromPrice = exports.midnightTimeToMaturityDays = void 0;
7
7
  const decimal_js_1 = __importDefault(require("decimal.js"));
8
8
  const constants_1 = require("../../constants");
9
9
  const nowInSeconds = () => Math.floor(Date.now() / 1000);
@@ -34,6 +34,19 @@ const midnightPriceFromApy = (ratePercent, ttmDays) => {
34
34
  return new decimal_js_1.default(1).div(new decimal_js_1.default(1).add(rate.div(100)).pow(ttm.div(365))).toString();
35
35
  };
36
36
  exports.midnightPriceFromApy = midnightPriceFromApy;
37
+ exports.MIDNIGHT_DEFAULT_RATE_SLIPPAGE = 0.1;
38
+ const MIDNIGHT_MIN_FLOOR_RATIO = 0.5;
39
+ const midnightBoundPrice = (estRate, ttmDays, kind, boundRate, rateSlippagePercent = exports.MIDNIGHT_DEFAULT_RATE_SLIPPAGE) => {
40
+ if (boundRate !== undefined && new decimal_js_1.default(boundRate).gt(0))
41
+ return (0, exports.midnightPriceFromApy)(boundRate, ttmDays);
42
+ const est = new decimal_js_1.default(estRate);
43
+ const slippage = new decimal_js_1.default(rateSlippagePercent);
44
+ const bound = kind === 'ceiling'
45
+ ? est.add(slippage)
46
+ : decimal_js_1.default.max(est.sub(slippage), est.mul(MIDNIGHT_MIN_FLOOR_RATIO));
47
+ return (0, exports.midnightPriceFromApy)(bound, ttmDays);
48
+ };
49
+ exports.midnightBoundPrice = midnightBoundPrice;
37
50
  const midnightBookBestFirst = (side) => (side === 'asks' ? -1 : 1);
38
51
  exports.midnightBookBestFirst = midnightBookBestFirst;
39
52
  const buildMidnightParsedBook = (offers, side) => {
@@ -4,7 +4,6 @@ import type { MorphoMidnightBorrowQuote, MorphoMidnightPaybackQuote, MorphoMidni
4
4
  type TenorBookKey = 'asks' | 'bids';
5
5
  export declare const tenorBookKeyFor: (side: MorphoMidnightBookSide) => TenorBookKey;
6
6
  export declare const tenorBookRateToApyPercent: (rate: Dec.Value) => string;
7
- export declare const tenorCapPrice: (bestPrice: string, slippagePercent: Dec.Value, direction: 1 | -1, ttmDays: Dec.Value, boundRate?: Dec.Value) => string;
8
7
  interface TenorOfferCollateral {
9
8
  token: string;
10
9
  lltv: string | number;
@@ -119,7 +118,12 @@ export declare const parseTenorBookSide: (json: TenorBookResponse, side: MorphoM
119
118
  }[];
120
119
  export declare const parseTenorOrderBook: (json: TenorBookResponse, side: MorphoMidnightBookSide, loanSymbol: string) => MorphoMidnightParsedBook | null;
121
120
  export declare const getTenorMarketBook: (market: MorphoMidnightMarketData, network: NetworkNumber, side?: MorphoMidnightBookSide) => Promise<MorphoMidnightParsedBook | null>;
122
- export declare const getTenorBorrowQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, maxBorrowRate?: Dec.Value, taker?: string, network?: NetworkNumber) => Promise<MorphoMidnightBorrowQuote>;
123
- export declare const getTenorPaybackQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, network?: NetworkNumber) => Promise<MorphoMidnightPaybackQuote>;
124
- export declare const getTenorPaybackUnitsQuote: (marketId: string, unitsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, network?: NetworkNumber) => Promise<MorphoMidnightPaybackUnitsQuote>;
121
+ /**
122
+ * Tenor's router takes no slippage of its own — it prices the fill and hands back the offers. `slippagePercent`
123
+ * is therefore accepted only to keep the signature aligned with the Morpho-hosted quote that `index.ts`
124
+ * forwards to positionally; the guard comes from `rateSlippagePercent` via `midnightBoundPrice`.
125
+ */
126
+ export declare const getTenorBorrowQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, maxBorrowRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value, network?: NetworkNumber) => Promise<MorphoMidnightBorrowQuote>;
127
+ export declare const getTenorPaybackQuote: (marketId: string, assetsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value, network?: NetworkNumber) => Promise<MorphoMidnightPaybackQuote>;
128
+ export declare const getTenorPaybackUnitsQuote: (marketId: string, unitsRaw: string, slippagePercent: Dec.Value, maturity: number, minPaybackRate?: Dec.Value, taker?: string, rateSlippagePercent?: Dec.Value, network?: NetworkNumber) => Promise<MorphoMidnightPaybackUnitsQuote>;
125
129
  export {};
@@ -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.getTenorPaybackUnitsQuote = exports.getTenorPaybackQuote = exports.getTenorBorrowQuote = exports.getTenorMarketBook = exports.parseTenorOrderBook = exports.parseTenorBookSide = exports.tenorOfferFillToApiFill = exports.tenorOfferToApiOffer = exports.tenorCapPrice = exports.tenorBookRateToApyPercent = exports.tenorBookKeyFor = void 0;
15
+ exports.getTenorPaybackUnitsQuote = exports.getTenorPaybackQuote = exports.getTenorBorrowQuote = exports.getTenorMarketBook = exports.parseTenorOrderBook = exports.parseTenorBookSide = exports.tenorOfferFillToApiFill = exports.tenorOfferToApiOffer = exports.tenorBookRateToApyPercent = exports.tenorBookKeyFor = void 0;
16
16
  const decimal_js_1 = __importDefault(require("decimal.js"));
17
17
  const tokens_1 = require("@defisaver/tokens");
18
18
  const constants_1 = require("../../constants");
@@ -31,13 +31,6 @@ exports.tenorBookKeyFor = tenorBookKeyFor;
31
31
  const tenorBookRateToApyPercent = (rate) => new decimal_js_1.default(rate || 0).div(100).toString();
32
32
  exports.tenorBookRateToApyPercent = tenorBookRateToApyPercent;
33
33
  const tenorFillPrice = (assets, units) => (new decimal_js_1.default(units).lte(0) ? '0' : new decimal_js_1.default(assets).div(units).toString());
34
- const tenorCapPrice = (bestPrice, slippagePercent, direction, ttmDays, boundRate) => {
35
- if (boundRate !== undefined && new decimal_js_1.default(boundRate).gt(0))
36
- return (0, rate_1.midnightPriceFromApy)(boundRate, ttmDays);
37
- const band = new decimal_js_1.default(1).add(new decimal_js_1.default(slippagePercent || 0).div(100).mul(direction));
38
- return decimal_js_1.default.max(0, new decimal_js_1.default(bestPrice).mul(band)).toString();
39
- };
40
- exports.tenorCapPrice = tenorCapPrice;
41
34
  /**
42
35
  * Tenor's offer JSON is flat (market fields live on the offer). Morpho's is nested, and that nested
43
36
  * shape is what the app encodes for `Midnight.take`. Map Tenor into that shape so recipes stay on one encoder.
@@ -166,7 +159,12 @@ const fetchTenorQuote = (_a) => __awaiter(void 0, [_a], void 0, function* ({ mar
166
159
  };
167
160
  });
168
161
  const TENOR_NO_AVAILABLE_UNITS = '0';
169
- const getTenorBorrowQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, maxBorrowRate_1, taker_1, ...args_1) => __awaiter(void 0, [marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, maxBorrowRate_1, taker_1, ...args_1], void 0, function* (marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker, network = types_1.NetworkNumber.Base) {
162
+ /**
163
+ * Tenor's router takes no slippage of its own — it prices the fill and hands back the offers. `slippagePercent`
164
+ * is therefore accepted only to keep the signature aligned with the Morpho-hosted quote that `index.ts`
165
+ * forwards to positionally; the guard comes from `rateSlippagePercent` via `midnightBoundPrice`.
166
+ */
167
+ const getTenorBorrowQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, maxBorrowRate_1, taker_1, rateSlippagePercent_1, ...args_1) => __awaiter(void 0, [marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, maxBorrowRate_1, taker_1, rateSlippagePercent_1, ...args_1], void 0, function* (marketId, assetsRaw, slippagePercent, maturity, maxBorrowRate, taker, rateSlippagePercent, network = types_1.NetworkNumber.Base) {
170
168
  if (!(0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
171
169
  throw new Error(tenorQuoteError(`Not a Tenor Midnight market: ${marketId}`));
172
170
  }
@@ -179,7 +177,7 @@ const getTenorBorrowQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturit
179
177
  const ttmDays = (0, rate_1.midnightTimeToMaturityDays)(maturity);
180
178
  const bestPrice = tenorFillPrice(assetsRaw, quote.units);
181
179
  const estBorrowRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
182
- const capPrice = (0, exports.tenorCapPrice)(bestPrice, slippagePercent, -1, ttmDays, maxBorrowRate);
180
+ const capPrice = (0, rate_1.midnightBoundPrice)(estBorrowRate, ttmDays, 'ceiling', maxBorrowRate, rateSlippagePercent);
183
181
  const maxRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
184
182
  const maxUnits = new decimal_js_1.default(capPrice).lte(0) ? '0' : new decimal_js_1.default(assetsRaw).div(capPrice).toFixed(0);
185
183
  return {
@@ -195,7 +193,7 @@ const getTenorBorrowQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturit
195
193
  };
196
194
  });
197
195
  exports.getTenorBorrowQuote = getTenorBorrowQuote;
198
- const getTenorPaybackQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, ...args_1) => __awaiter(void 0, [marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, ...args_1], void 0, function* (marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker, network = types_1.NetworkNumber.Base) {
196
+ const getTenorPaybackQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, rateSlippagePercent_1, ...args_1) => __awaiter(void 0, [marketId_1, assetsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, rateSlippagePercent_1, ...args_1], void 0, function* (marketId, assetsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent, network = types_1.NetworkNumber.Base) {
199
197
  if (!(0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
200
198
  throw new Error(tenorQuoteError(`Not a Tenor Midnight market: ${marketId}`));
201
199
  }
@@ -208,7 +206,7 @@ const getTenorPaybackQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturi
208
206
  const ttmDays = (0, rate_1.midnightTimeToMaturityDays)(maturity);
209
207
  const bestPrice = tenorFillPrice(assetsRaw, quote.units);
210
208
  const estPaybackRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
211
- const capPrice = (0, exports.tenorCapPrice)(bestPrice, slippagePercent, 1, ttmDays, minPaybackRate);
209
+ const capPrice = (0, rate_1.midnightBoundPrice)(estPaybackRate, ttmDays, 'floor', minPaybackRate, rateSlippagePercent);
212
210
  const minRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
213
211
  const minUnits = new decimal_js_1.default(capPrice).lte(0) ? '0' : new decimal_js_1.default(assetsRaw).div(capPrice).toFixed(0, decimal_js_1.default.ROUND_DOWN);
214
212
  return {
@@ -224,7 +222,7 @@ const getTenorPaybackQuote = (marketId_1, assetsRaw_1, slippagePercent_1, maturi
224
222
  };
225
223
  });
226
224
  exports.getTenorPaybackQuote = getTenorPaybackQuote;
227
- const getTenorPaybackUnitsQuote = (marketId_1, unitsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, ...args_1) => __awaiter(void 0, [marketId_1, unitsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, ...args_1], void 0, function* (marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker, network = types_1.NetworkNumber.Base) {
225
+ const getTenorPaybackUnitsQuote = (marketId_1, unitsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, rateSlippagePercent_1, ...args_1) => __awaiter(void 0, [marketId_1, unitsRaw_1, slippagePercent_1, maturity_1, minPaybackRate_1, taker_1, rateSlippagePercent_1, ...args_1], void 0, function* (marketId, unitsRaw, slippagePercent, maturity, minPaybackRate, taker, rateSlippagePercent, network = types_1.NetworkNumber.Base) {
228
226
  if (!(0, morphoMidnight_1.isTenorMidnightMarket)(marketId)) {
229
227
  throw new Error(tenorQuoteError(`Not a Tenor Midnight market: ${marketId}`));
230
228
  }
@@ -238,7 +236,7 @@ const getTenorPaybackUnitsQuote = (marketId_1, unitsRaw_1, slippagePercent_1, ma
238
236
  const newAssets = quote.buyerAssets;
239
237
  const bestPrice = tenorFillPrice(newAssets, unitsRaw);
240
238
  const estPaybackRate = (0, rate_1.midnightApyFromPrice)(bestPrice, ttmDays);
241
- const capPrice = (0, exports.tenorCapPrice)(bestPrice, slippagePercent, 1, ttmDays, minPaybackRate);
239
+ const capPrice = (0, rate_1.midnightBoundPrice)(estPaybackRate, ttmDays, 'floor', minPaybackRate, rateSlippagePercent);
242
240
  const minRate = (0, rate_1.midnightApyFromPrice)(capPrice, ttmDays);
243
241
  const maxAssets = new decimal_js_1.default(unitsRaw).mul(capPrice).toFixed(0, decimal_js_1.default.ROUND_UP);
244
242
  return {
package/cjs/index.d.ts CHANGED
@@ -18,9 +18,8 @@ import * as exchange from './exchange';
18
18
  import * as morphoBlue from './morphoBlue';
19
19
  import * as morphoMidnight from './morphoMidnight';
20
20
  import * as llamaLend from './llamaLend';
21
- import * as eulerV2 from './eulerV2';
22
21
  import * as portfolio from './portfolio';
23
22
  import * as claiming from './claiming';
24
23
  import * as savings from './savings';
25
24
  export * from './types';
26
- export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, morphoMidnight, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
25
+ export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, morphoMidnight, llamaLend, fluid, portfolio, claiming, savings, };
package/cjs/index.js CHANGED
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.savings = exports.claiming = exports.portfolio = exports.fluid = exports.eulerV2 = exports.llamaLend = exports.morphoMidnight = exports.morphoBlue = exports.helpers = exports.markets = exports.moneymarket = exports.staking = exports.exchange = exports.maker = exports.liquityV2 = exports.liquity = exports.curveUsd = exports.spark = exports.compoundV3 = exports.compoundV2 = exports.aaveV4 = exports.aaveV3 = exports.aaveV2 = void 0;
39
+ exports.savings = exports.claiming = exports.portfolio = exports.fluid = exports.llamaLend = exports.morphoMidnight = exports.morphoBlue = exports.helpers = exports.markets = exports.moneymarket = exports.staking = exports.exchange = exports.maker = exports.liquityV2 = exports.liquity = exports.curveUsd = exports.spark = exports.compoundV3 = exports.compoundV2 = exports.aaveV4 = exports.aaveV3 = exports.aaveV2 = void 0;
40
40
  require("./setup");
41
41
  const fluid = __importStar(require("./fluid"));
42
42
  exports.fluid = fluid;
@@ -76,8 +76,6 @@ const morphoMidnight = __importStar(require("./morphoMidnight"));
76
76
  exports.morphoMidnight = morphoMidnight;
77
77
  const llamaLend = __importStar(require("./llamaLend"));
78
78
  exports.llamaLend = llamaLend;
79
- const eulerV2 = __importStar(require("./eulerV2"));
80
- exports.eulerV2 = eulerV2;
81
79
  const portfolio = __importStar(require("./portfolio"));
82
80
  exports.portfolio = portfolio;
83
81
  const claiming = __importStar(require("./claiming"));
@@ -6,6 +6,5 @@ export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
6
6
  export { MorphoMidnightMarkets, findMorphoMidnightMarket, isTenorMidnightMarket, morphoMidnightMarketCollateralParams, } from './morphoMidnight';
7
7
  export { LlamaLendMarkets } from './llamaLend';
8
8
  export { LiquityV2Markets, findLiquityV2MarketByAddress } from './liquityV2';
9
- export { EulerV2Markets } from './euler';
10
9
  export { FluidMarkets, getFluidVersionsDataForNetwork, getFluidMarketInfoById, getFTokenAddress, getFluidMarketInfoByAddress, } from './fluid';
11
10
  export { AaveV4Spokes, findAaveV4SpokeByAddress } from './aaveV4';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAaveV4SpokeByAddress = exports.AaveV4Spokes = exports.getFluidMarketInfoByAddress = exports.getFTokenAddress = exports.getFluidMarketInfoById = exports.getFluidVersionsDataForNetwork = exports.FluidMarkets = exports.EulerV2Markets = exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LlamaLendMarkets = exports.morphoMidnightMarketCollateralParams = exports.isTenorMidnightMarket = exports.findMorphoMidnightMarket = exports.MorphoMidnightMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
3
+ exports.findAaveV4SpokeByAddress = exports.AaveV4Spokes = exports.getFluidMarketInfoByAddress = exports.getFTokenAddress = exports.getFluidMarketInfoById = exports.getFluidVersionsDataForNetwork = exports.FluidMarkets = exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LlamaLendMarkets = exports.morphoMidnightMarketCollateralParams = exports.isTenorMidnightMarket = exports.findMorphoMidnightMarket = exports.MorphoMidnightMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
4
4
  var aave_1 = require("./aave");
5
5
  Object.defineProperty(exports, "AaveMarkets", { enumerable: true, get: function () { return aave_1.AaveMarkets; } });
6
6
  Object.defineProperty(exports, "aaveV1AssetsDefaultMarket", { enumerable: true, get: function () { return aave_1.aaveV1AssetsDefaultMarket; } });
@@ -32,8 +32,6 @@ Object.defineProperty(exports, "LlamaLendMarkets", { enumerable: true, get: func
32
32
  var liquityV2_1 = require("./liquityV2");
33
33
  Object.defineProperty(exports, "LiquityV2Markets", { enumerable: true, get: function () { return liquityV2_1.LiquityV2Markets; } });
34
34
  Object.defineProperty(exports, "findLiquityV2MarketByAddress", { enumerable: true, get: function () { return liquityV2_1.findLiquityV2MarketByAddress; } });
35
- var euler_1 = require("./euler");
36
- Object.defineProperty(exports, "EulerV2Markets", { enumerable: true, get: function () { return euler_1.EulerV2Markets; } });
37
35
  var fluid_1 = require("./fluid");
38
36
  Object.defineProperty(exports, "FluidMarkets", { enumerable: true, get: function () { return fluid_1.FluidMarkets; } });
39
37
  Object.defineProperty(exports, "getFluidVersionsDataForNetwork", { enumerable: true, get: function () { return fluid_1.getFluidVersionsDataForNetwork; } });
@@ -65,6 +65,8 @@ export declare const MORPHO_BLUE_WBTC_USDT_860: (networkId?: NetworkNumber) => M
65
65
  export declare const MORPHO_BLUE_WSTETH_USDT_860: (networkId?: NetworkNumber) => MorphoBlueMarketData;
66
66
  export declare const MORPHO_BLUE_SYRUPUSDC_RLUSD_915: (networkId?: NetworkNumber) => MorphoBlueMarketData;
67
67
  export declare const MORPHO_BLUE_WEETH_USDC_770: (networkId?: NetworkNumber) => MorphoBlueMarketData;
68
+ export declare const MORPHO_BLUE_WEETH_USDC_860: (networkId?: NetworkNumber) => MorphoBlueMarketData;
69
+ export declare const MORPHO_BLUE_WEETH_USDC_860_85252BB8: (networkId?: NetworkNumber) => MorphoBlueMarketData;
68
70
  export declare const MORPHO_BLUE_ETH_USDC_860_94B823E6: (networkId?: NetworkNumber) => MorphoBlueMarketData;
69
71
  export declare const MORPHO_BLUE_USD3_USDC_915: (networkId?: NetworkNumber) => MorphoBlueMarketData;
70
72
  export declare const MORPHO_BLUE_STUSDS_USDC_860: (networkId?: NetworkNumber) => MorphoBlueMarketData;
@@ -72,6 +74,7 @@ export declare const MORPHO_BLUE_CBBTC_RLUSD_860: (networkId?: NetworkNumber) =>
72
74
  export declare const MORPHO_BLUE_WBTC_ETH_915: (networkId?: NetworkNumber) => MorphoBlueMarketData;
73
75
  export declare const MORPHO_BLUE_CBBTC_ETH_915_12DBF493: (networkId?: NetworkNumber) => MorphoBlueMarketData;
74
76
  export declare const MORPHO_BLUE_WEETH_USDT_860: (networkId?: NetworkNumber) => MorphoBlueMarketData;
77
+ export declare const MORPHO_BLUE_WEETH_USDT_860_A6A4C1F1: (networkId?: NetworkNumber) => MorphoBlueMarketData;
75
78
  export declare const MORPHO_BLUE_SYRUPUSDT_USDT_915: (networkId?: NetworkNumber) => MorphoBlueMarketData;
76
79
  export declare const MORPHO_BLUE_CBBTC_PYUSD_860: (networkId?: NetworkNumber) => MorphoBlueMarketData;
77
80
  export declare const MORPHO_BLUE_WEETH_USDT_770: (networkId?: NetworkNumber) => MorphoBlueMarketData;
@@ -185,6 +188,8 @@ export declare const MorphoBlueMarkets: (networkId: NetworkNumber) => {
185
188
  readonly morphobluewstethusdt_860: MorphoBlueMarketData;
186
189
  readonly morphobluesyrupusdcrlusd_915: MorphoBlueMarketData;
187
190
  readonly morphoblueweethusdc_770: MorphoBlueMarketData;
191
+ readonly morphoblueweethusdc_860: MorphoBlueMarketData;
192
+ readonly morphoblueweethusdc_860_85252bb8: MorphoBlueMarketData;
188
193
  readonly morphoblueethusdc_860_94b823e6: MorphoBlueMarketData;
189
194
  readonly morphoblueusd3usdc_915: MorphoBlueMarketData;
190
195
  readonly morphobluestusdsusdc_860: MorphoBlueMarketData;
@@ -192,6 +197,7 @@ export declare const MorphoBlueMarkets: (networkId: NetworkNumber) => {
192
197
  readonly morphobluewbtceth_915: MorphoBlueMarketData;
193
198
  readonly morphobluecbbtceth_915_12dbf493: MorphoBlueMarketData;
194
199
  readonly morphoblueweethusdt_860: MorphoBlueMarketData;
200
+ readonly morphoblueweethusdt_860_a6a4c1f1: MorphoBlueMarketData;
195
201
  readonly morphobluesyrupusdtusdt_915: MorphoBlueMarketData;
196
202
  readonly morphobluecbbtcpyusd_860: MorphoBlueMarketData;
197
203
  readonly morphoblueweethusdt_770: MorphoBlueMarketData;