@1delta/margin-fetcher 5.0.74 → 5.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2024,7 +2024,13 @@ interface MorphoMarket {
2024
2024
  * MARKET-LEVEL menu, valid only when the lender key has ONE borrowable asset
2025
2025
  * (every isolated-market fixed-term lender). CROSS-MARGIN multi-asset
2026
2026
  * lenders — Exactly — carry a menu PER ASSET on `data[*].terms` instead,
2027
- * since each asset has its own fixed pools. */
2027
+ * since each asset has its own fixed pools.
2028
+ *
2029
+ * A market-level card still has to be ATTRIBUTED to a row, and matching
2030
+ * `loanAddress` against each row's asset is wrong the moment the loan token
2031
+ * is also a collateral leg (Morpho Midnight permits it). So Midnight ALSO
2032
+ * puts the card on its loan row (`data[<loan uid>].terms`); prefer the row's
2033
+ * own card wherever one is present and treat this as the fallback. */
2028
2034
  terms?: MarketTermEntry[];
2029
2035
  /**
2030
2036
  * Canonical cross-protocol fixed-term descriptor (Lista brokered + Morpho
@@ -2090,9 +2096,15 @@ interface MorphoGeneralPublicResponse {
2090
2096
  * PER-ASSET fixed-term rate menu, for CROSS-MARGIN multi-asset fixed-term
2091
2097
  * lenders (Exactly): one lender key covers every asset, and each asset has
2092
2098
  * its own fixed pools, so the menu cannot live on `params.market`.
2093
- * Isolated-market fixed-term lenders (Midnight, Term, Lista broker,
2094
- * TermMax, Teller) keep using `params.market.terms` — read that as the
2095
- * fallback when this is absent.
2099
+ * Isolated-market fixed-term lenders (Term, Lista broker, TermMax,
2100
+ * Teller) keep using `params.market.terms` — read that as the fallback
2101
+ * when this is absent. Morpho Midnight emits BOTH: the card sits on its
2102
+ * loan row as well, so a consumer never has to decide which row of the
2103
+ * market is the borrow side (a loan token can also be a collateral leg
2104
+ * there, and a `loanAddress` match then picks two rows).
2105
+ *
2106
+ * Invariant, whichever level it is read from: a rate card describes a
2107
+ * BORROW side. A row with `borrowingEnabled: false` never carries one.
2096
2108
  */
2097
2109
  terms?: MarketTermEntry[];
2098
2110
  /**
package/dist/index.js CHANGED
@@ -21531,6 +21531,14 @@ function convertMidnightMarketsToResponse(raw, chainId, prices = {}, _additional
21531
21531
  // Midnight is fixed-rate: expose the fixed borrow APR on stableBorrowRate
21532
21532
  // too, so fixed-rate consumers pick it up like a term product.
21533
21533
  stableBorrowRate: borrowAprPct,
21534
+ // The rate card is a BORROW-side fact, so it lives on the row that has a
21535
+ // borrow side — natively, not by a consumer matching `loanAddress`
21536
+ // against each row's asset. That match is what broke when the loan token
21537
+ // was also a collateral leg: the leg row carries the same token, so it
21538
+ // matched too and was served a "Fixed from X %" it cannot offer.
21539
+ // `params.market.terms` still carries the same card for readers of the
21540
+ // market-level shape; the collateral legs below never carry one.
21541
+ terms,
21534
21542
  intrinsicYield: 0,
21535
21543
  rewards: void 0,
21536
21544
  decimals: config.loanDecimals,