@defisaver/positions-sdk 2.1.150-cirbtc-dev → 2.1.151-midnight-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 (38) hide show
  1. package/cjs/claiming/compV3.js +0 -1
  2. package/cjs/config/contracts.d.ts +4 -0
  3. package/cjs/config/contracts.js +4 -0
  4. package/cjs/helpers/morphoMidnightHelpers/tenor.d.ts +6 -2
  5. package/cjs/helpers/morphoMidnightHelpers/tenor.js +5 -1
  6. package/cjs/markets/index.d.ts +1 -1
  7. package/cjs/markets/index.js +2 -1
  8. package/cjs/markets/morphoBlue/index.js +122 -122
  9. package/cjs/markets/morphoMidnight/index.d.ts +44 -10
  10. package/cjs/markets/morphoMidnight/index.js +380 -59
  11. package/cjs/morphoMidnight/index.js +11 -1
  12. package/cjs/portfolio/index.js +3 -27
  13. package/cjs/types/morphoMidnight.d.ts +35 -4
  14. package/cjs/types/morphoMidnight.js +23 -0
  15. package/esm/claiming/compV3.js +0 -1
  16. package/esm/config/contracts.d.ts +4 -0
  17. package/esm/config/contracts.js +4 -0
  18. package/esm/helpers/morphoMidnightHelpers/tenor.d.ts +6 -2
  19. package/esm/helpers/morphoMidnightHelpers/tenor.js +6 -2
  20. package/esm/markets/index.d.ts +1 -1
  21. package/esm/markets/index.js +1 -1
  22. package/esm/markets/morphoBlue/index.js +122 -122
  23. package/esm/markets/morphoMidnight/index.d.ts +44 -10
  24. package/esm/markets/morphoMidnight/index.js +356 -58
  25. package/esm/morphoMidnight/index.js +11 -1
  26. package/esm/portfolio/index.js +4 -28
  27. package/esm/types/morphoMidnight.d.ts +35 -4
  28. package/esm/types/morphoMidnight.js +23 -0
  29. package/package.json +1 -1
  30. package/src/claiming/compV3.ts +0 -1
  31. package/src/config/contracts.ts +4 -0
  32. package/src/helpers/morphoMidnightHelpers/tenor.ts +6 -2
  33. package/src/markets/index.ts +1 -0
  34. package/src/markets/morphoBlue/index.ts +122 -122
  35. package/src/markets/morphoMidnight/index.ts +446 -60
  36. package/src/morphoMidnight/index.ts +8 -1
  37. package/src/portfolio/index.ts +3 -27
  38. package/src/types/morphoMidnight.ts +37 -3
@@ -4,17 +4,33 @@ import {
4
4
  import { ZERO_ADDRESS } from '../../constants';
5
5
 
6
6
  /**
7
- * Morpho Midnight core contract on Base. Every Midnight market trades against this one, whoever curates
8
- * its order book — it is part of the market struct the id is hashed from, and it is what offer tuples
9
- * encode for `Midnight.take`.
7
+ * Morpho Midnight core contract, one per chain. Every Midnight market on a chain trades against its core,
8
+ * whoever curates the order book — it is part of the market struct the id is hashed from, and it is what
9
+ * offer tuples encode for `Midnight.take`. Listed at
10
+ * https://docs.morpho.org/get-started/resources/addresses/.
10
11
  */
11
12
  export const MIDNIGHT_BASE = '0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A' as const;
13
+ export const MIDNIGHT_ETH = '0x471686c42792F93528B000beF54bC10E3aa2045f' as const;
14
+
15
+ export const midnightCoreAddress = (network: NetworkNumber) => (
16
+ network === NetworkNumber.Eth ? MIDNIGHT_ETH : MIDNIGHT_BASE
17
+ );
12
18
 
13
19
  const USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' as const;
14
20
  const WETH_BASE = '0x4200000000000000000000000000000000000006' as const;
15
21
  const CBBTC_BASE = '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' as const;
16
22
  const CBETH_BASE = '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22' as const;
17
23
 
24
+ const USDC_ETH = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' as const;
25
+ const WETH_ETH = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' as const;
26
+ const WBTC_ETH = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' as const;
27
+ const CBBTC_ETH = '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' as const;
28
+ const STRUSD_ETH = '0x280839980a7eD0D7717F64125fE241012E5F5815' as const;
29
+ const WSRUSD_ETH = '0xd3fD63209FA2D55B07A0f6db36C2f43900be3094' as const;
30
+ const USD3_ETH = '0x056B269Eb1f75477a8666ae8C7fE01b64dD55eCc' as const;
31
+ const REUSD_ETH = '0x5086bf358635B81D8C47C66d1C8b9E567Db70c72' as const;
32
+ const SIUSD_ETH = '0xDBDC1Ef57537E34680B898E1FEBD3D68c7389bCB' as const;
33
+
18
34
  // Tenor's ERC-4626 collateral vaults, one per pair and shared by that pair's whole maturity ladder. Each
19
35
  // is a collateral of its markets on-chain without being an asset the app deals in — see the note above
20
36
  // the Tenor markets below, and https://www.docs.tenor.finance/technical-docs/addresses/#vaults.
@@ -22,6 +38,13 @@ const TENOR_CBBTC_USDC_VAULT_BASE = '0xf6a70085b7f79FA76B04EbF7A2D7D87C3c5c04BC'
22
38
  const TENOR_WETH_USDC_VAULT_BASE = '0xe690a58EF52854513462745237F6A213a0d54dF1' as const;
23
39
  const TENOR_CBETH_WETH_VAULT_BASE = '0xFa750DD0099eAdB72d401244De73ce7B89edf90F' as const;
24
40
 
41
+ const TENOR_WETH_USDC_VAULT_ETH = '0x7579a75658A7A0b7d277296dFaEecF4018746091' as const;
42
+ const TENOR_STRUSD_USDC_VAULT_ETH = '0xef6955d886fce26D87753dA45192eA50F59dc91c' as const;
43
+ const TENOR_WSRUSD_USDC_VAULT_ETH = '0x09409fa71bCfd3f433571dbeec0C0A9C19B0d30E' as const;
44
+ const TENOR_USD3_USDC_VAULT_ETH = '0x26C46ACb48B46cC99ccB3cf6C365BdaFa2556E80' as const;
45
+ const TENOR_REUSD_USDC_VAULT_ETH = '0xe3891d8cA7E00Bc42157D9bb5797C88D9159AAC6' as const;
46
+ const TENOR_SIUSD_USDC_VAULT_ETH = '0x226ecbf4755a5F81ed721E18c3fDA11f004Ea9e0' as const;
47
+
25
48
 
26
49
  // Sourced from the official listing at https://markets.morpho.org/fixed/base
27
50
 
@@ -197,19 +220,20 @@ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20270129 = (networkId = NetworkNumbe
197
220
  // = Tenor's `fixedMarketIdentifier`; they come back `listed: false`, meaning Tenor — not Morpho — serves
198
221
  // the book.
199
222
  //
200
- // Every market below is verified against `MidnightView.toMarket(marketId)` on Base: core address,
201
- // maturity, rcfThreshold, loan token, gates and collaterals all match. On-chain each market carries **two**
202
- // collaterals the pair's own token at index 0, and Tenor's ERC-4626 vault at index 1 (98% LLTV; the
203
- // `metadata.vault` of the parent tenor market, listed at
204
- // https://www.docs.tenor.finance/technical-docs/addresses/#vaults). The vault is not an asset the app
205
- // deals in, so it is split out into `hiddenCollaterals` instead of `collaterals`: everything that renders
206
- // or prices a position sees a single-collateral market, and because the vault stays the *suffix* of the
207
- // set, the SDK's positional `prices[i]` / `collateral[i]` reads stay aligned with `collaterals`.
223
+ // Every market below is verified by replaying `MidnightView.toId` over the struct these fields build:
224
+ // core address, maturity, rcfThreshold, loan token, gates and the whole ordered collateral set have to
225
+ // match or the hash does not come back as the recorded `marketId`. On-chain each market carries **two**
226
+ // collaterals the pair's own token, and Tenor's ERC-4626 vault at 98% LLTV (the `metadata.vault` of the
227
+ // parent tenor market, listed at https://www.docs.tenor.finance/technical-docs/addresses/#vaults). The
228
+ // vault is not an asset the app deals in, so it carries `hidden: true`: everything that renders or prices
229
+ // a position skips it and sees a single-collateral market.
208
230
  //
209
- // It is only split out, never dropped: the market id is the hash of the full struct, so a `Market` handed
210
- // to the core has to be `[...collaterals, ...hiddenCollaterals]` or the call addresses a market of its own
211
- // making. The take path builds no structoffer tuples carry the market's full collateral set straight
212
- // from the router's offer JSON.
231
+ // It is only flagged, never dropped or reordered: the market id is the hash of the full struct, so a
232
+ // `Market` handed to the core has to carry the complete set in the chain's own order or the call
233
+ // addresses a market of its own makingwhich does not revert, because markets are permissionless. On
234
+ // Base the vault happens to come last every time; on mainnet the order varies per market, which is why
235
+ // the flag lives on the entry rather than in a second list. The take path builds no struct — offer
236
+ // tuples carry the market's full collateral set straight from the router's offer JSON.
213
237
 
214
238
  export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20260827 = (networkId = NetworkNumber.Base): MorphoMidnightMarketData => ({
215
239
  chainIds: [NetworkNumber.Base],
@@ -224,12 +248,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20260827 = (networkId = Networ
224
248
  lltv: 0.86,
225
249
  liquidationCursor: '300000000000000000',
226
250
  oracle: '0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9',
227
- }],
228
- hiddenCollaterals: [{
251
+ }, {
229
252
  token: TENOR_CBBTC_USDC_VAULT_BASE,
230
253
  lltv: 0.98,
231
254
  liquidationCursor: '300000000000000000',
232
255
  oracle: '0x4a24e4bf269cE26aAD2dF00437e7730d25FCdE26',
256
+ hidden: true,
233
257
  }],
234
258
  maturity: 1787788800, // 2026-08-27T00:00:00Z
235
259
  rcfThreshold: '3000000000',
@@ -253,12 +277,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20260924 = (networkId = Networ
253
277
  lltv: 0.86,
254
278
  liquidationCursor: '300000000000000000',
255
279
  oracle: '0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9',
256
- }],
257
- hiddenCollaterals: [{
280
+ }, {
258
281
  token: TENOR_CBBTC_USDC_VAULT_BASE,
259
282
  lltv: 0.98,
260
283
  liquidationCursor: '300000000000000000',
261
284
  oracle: '0x4a24e4bf269cE26aAD2dF00437e7730d25FCdE26',
285
+ hidden: true,
262
286
  }],
263
287
  maturity: 1790208000, // 2026-09-24T00:00:00Z
264
288
  rcfThreshold: '3000000000',
@@ -282,12 +306,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20261022 = (networkId = Networ
282
306
  lltv: 0.86,
283
307
  liquidationCursor: '300000000000000000',
284
308
  oracle: '0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9',
285
- }],
286
- hiddenCollaterals: [{
309
+ }, {
287
310
  token: TENOR_CBBTC_USDC_VAULT_BASE,
288
311
  lltv: 0.98,
289
312
  liquidationCursor: '300000000000000000',
290
313
  oracle: '0x4a24e4bf269cE26aAD2dF00437e7730d25FCdE26',
314
+ hidden: true,
291
315
  }],
292
316
  maturity: 1792627200, // 2026-10-22T00:00:00Z
293
317
  rcfThreshold: '3000000000',
@@ -311,12 +335,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20261119 = (networkId = Networ
311
335
  lltv: 0.86,
312
336
  liquidationCursor: '300000000000000000',
313
337
  oracle: '0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9',
314
- }],
315
- hiddenCollaterals: [{
338
+ }, {
316
339
  token: TENOR_CBBTC_USDC_VAULT_BASE,
317
340
  lltv: 0.98,
318
341
  liquidationCursor: '300000000000000000',
319
342
  oracle: '0x4a24e4bf269cE26aAD2dF00437e7730d25FCdE26',
343
+ hidden: true,
320
344
  }],
321
345
  maturity: 1795046400, // 2026-11-19T00:00:00Z
322
346
  rcfThreshold: '3000000000',
@@ -340,12 +364,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBBTC_USDC_860_20261217 = (networkId = Networ
340
364
  lltv: 0.86,
341
365
  liquidationCursor: '300000000000000000',
342
366
  oracle: '0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9',
343
- }],
344
- hiddenCollaterals: [{
367
+ }, {
345
368
  token: TENOR_CBBTC_USDC_VAULT_BASE,
346
369
  lltv: 0.98,
347
370
  liquidationCursor: '300000000000000000',
348
371
  oracle: '0x4a24e4bf269cE26aAD2dF00437e7730d25FCdE26',
372
+ hidden: true,
349
373
  }],
350
374
  maturity: 1797465600, // 2026-12-17T00:00:00Z
351
375
  rcfThreshold: '3000000000',
@@ -369,12 +393,12 @@ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20260827 = (networkId = Network
369
393
  lltv: 0.86,
370
394
  liquidationCursor: '300000000000000000',
371
395
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
372
- }],
373
- hiddenCollaterals: [{
396
+ }, {
374
397
  token: TENOR_WETH_USDC_VAULT_BASE,
375
398
  lltv: 0.98,
376
399
  liquidationCursor: '300000000000000000',
377
400
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
401
+ hidden: true,
378
402
  }],
379
403
  maturity: 1787788800,
380
404
  rcfThreshold: '3000000000',
@@ -398,12 +422,12 @@ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20260924 = (networkId = Network
398
422
  lltv: 0.86,
399
423
  liquidationCursor: '300000000000000000',
400
424
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
401
- }],
402
- hiddenCollaterals: [{
425
+ }, {
403
426
  token: TENOR_WETH_USDC_VAULT_BASE,
404
427
  lltv: 0.98,
405
428
  liquidationCursor: '300000000000000000',
406
429
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
430
+ hidden: true,
407
431
  }],
408
432
  maturity: 1790208000,
409
433
  rcfThreshold: '3000000000',
@@ -427,12 +451,12 @@ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20261022 = (networkId = Network
427
451
  lltv: 0.86,
428
452
  liquidationCursor: '300000000000000000',
429
453
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
430
- }],
431
- hiddenCollaterals: [{
454
+ }, {
432
455
  token: TENOR_WETH_USDC_VAULT_BASE,
433
456
  lltv: 0.98,
434
457
  liquidationCursor: '300000000000000000',
435
458
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
459
+ hidden: true,
436
460
  }],
437
461
  maturity: 1792627200,
438
462
  rcfThreshold: '3000000000',
@@ -456,12 +480,12 @@ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20261119 = (networkId = Network
456
480
  lltv: 0.86,
457
481
  liquidationCursor: '300000000000000000',
458
482
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
459
- }],
460
- hiddenCollaterals: [{
483
+ }, {
461
484
  token: TENOR_WETH_USDC_VAULT_BASE,
462
485
  lltv: 0.98,
463
486
  liquidationCursor: '300000000000000000',
464
487
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
488
+ hidden: true,
465
489
  }],
466
490
  maturity: 1795046400,
467
491
  rcfThreshold: '3000000000',
@@ -485,12 +509,12 @@ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20261217 = (networkId = Network
485
509
  lltv: 0.86,
486
510
  liquidationCursor: '300000000000000000',
487
511
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
488
- }],
489
- hiddenCollaterals: [{
512
+ }, {
490
513
  token: TENOR_WETH_USDC_VAULT_BASE,
491
514
  lltv: 0.98,
492
515
  liquidationCursor: '300000000000000000',
493
516
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
517
+ hidden: true,
494
518
  }],
495
519
  maturity: 1797465600,
496
520
  rcfThreshold: '3000000000',
@@ -514,12 +538,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20260827 = (networkId = Networ
514
538
  lltv: 0.945,
515
539
  liquidationCursor: '300000000000000000',
516
540
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
517
- }],
518
- hiddenCollaterals: [{
541
+ }, {
519
542
  token: TENOR_CBETH_WETH_VAULT_BASE,
520
543
  lltv: 0.98,
521
544
  liquidationCursor: '300000000000000000',
522
545
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
546
+ hidden: true,
523
547
  }],
524
548
  maturity: 1787788800,
525
549
  rcfThreshold: '4000000000000000000',
@@ -543,12 +567,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20260924 = (networkId = Networ
543
567
  lltv: 0.945,
544
568
  liquidationCursor: '300000000000000000',
545
569
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
546
- }],
547
- hiddenCollaterals: [{
570
+ }, {
548
571
  token: TENOR_CBETH_WETH_VAULT_BASE,
549
572
  lltv: 0.98,
550
573
  liquidationCursor: '300000000000000000',
551
574
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
575
+ hidden: true,
552
576
  }],
553
577
  maturity: 1790208000,
554
578
  rcfThreshold: '4000000000000000000',
@@ -572,12 +596,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20261022 = (networkId = Networ
572
596
  lltv: 0.945,
573
597
  liquidationCursor: '300000000000000000',
574
598
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
575
- }],
576
- hiddenCollaterals: [{
599
+ }, {
577
600
  token: TENOR_CBETH_WETH_VAULT_BASE,
578
601
  lltv: 0.98,
579
602
  liquidationCursor: '300000000000000000',
580
603
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
604
+ hidden: true,
581
605
  }],
582
606
  maturity: 1792627200,
583
607
  rcfThreshold: '4000000000000000000',
@@ -601,12 +625,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20261119 = (networkId = Networ
601
625
  lltv: 0.945,
602
626
  liquidationCursor: '300000000000000000',
603
627
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
604
- }],
605
- hiddenCollaterals: [{
628
+ }, {
606
629
  token: TENOR_CBETH_WETH_VAULT_BASE,
607
630
  lltv: 0.98,
608
631
  liquidationCursor: '300000000000000000',
609
632
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
633
+ hidden: true,
610
634
  }],
611
635
  maturity: 1795046400,
612
636
  rcfThreshold: '4000000000000000000',
@@ -630,12 +654,12 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20261217 = (networkId = Networ
630
654
  lltv: 0.945,
631
655
  liquidationCursor: '300000000000000000',
632
656
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
633
- }],
634
- hiddenCollaterals: [{
657
+ }, {
635
658
  token: TENOR_CBETH_WETH_VAULT_BASE,
636
659
  lltv: 0.98,
637
660
  liquidationCursor: '300000000000000000',
638
661
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
662
+ hidden: true,
639
663
  }],
640
664
  maturity: 1797465600,
641
665
  rcfThreshold: '4000000000000000000',
@@ -666,12 +690,12 @@ const createTenorWethUsdcRollingMarket = (
666
690
  lltv: 0.86,
667
691
  liquidationCursor: '300000000000000000',
668
692
  oracle: '0xFEa2D58cEfCb9fcb597723c6bAE66fFE4193aFE4',
669
- }],
670
- hiddenCollaterals: [{
693
+ }, {
671
694
  token: TENOR_WETH_USDC_VAULT_BASE,
672
695
  lltv: 0.98,
673
696
  liquidationCursor: '300000000000000000',
674
697
  oracle: '0x784519B1b59A1e1498f077066bB9336672bcc3EE',
698
+ hidden: true,
675
699
  }],
676
700
  maturity,
677
701
  rcfThreshold: '3000000000',
@@ -700,12 +724,12 @@ const createTenorCbEthWethRollingMarket = (
700
724
  lltv: 0.945,
701
725
  liquidationCursor: '300000000000000000',
702
726
  oracle: '0xB03855Ad5AFD6B8db8091DD5551CAC4ed621d9E6',
703
- }],
704
- hiddenCollaterals: [{
727
+ }, {
705
728
  token: TENOR_CBETH_WETH_VAULT_BASE,
706
729
  lltv: 0.98,
707
730
  liquidationCursor: '300000000000000000',
708
731
  oracle: '0xa02f629871be35d6db0F88C944cF955554Ec87c0',
732
+ hidden: true,
709
733
  }],
710
734
  maturity,
711
735
  rcfThreshold: '4000000000000000000',
@@ -778,6 +802,338 @@ export const MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20270129 = () => createTenorCb
778
802
  '0x3cfda244eeec7e5cda2a07ef23e2a5e3fe6ba17882417cafbf3f3c432377ff1d',
779
803
  );
780
804
 
805
+ // ── ETHEREUM ─────────────────────────────────────────────────────────────────────────────────────
806
+
807
+ const createWBTCUsdcEthMarket = (
808
+ value: MorphoMidnightVersions,
809
+ url: string,
810
+ maturity: number,
811
+ marketId: string,
812
+ ): MorphoMidnightMarketData => ({
813
+ chainIds: [NetworkNumber.Eth],
814
+ label: 'Morpho Midnight WBTC/USDC',
815
+ shortLabel: 'WBTC/USDC',
816
+ url,
817
+ value,
818
+ midnight: MIDNIGHT_ETH,
819
+ loanToken: USDC_ETH,
820
+ collaterals: [{
821
+ token: WBTC_ETH,
822
+ lltv: 0.86,
823
+ liquidationCursor: '300000000000000000',
824
+ oracle: '0xDddd770BADd886dF3864029e4B377B5F6a2B6b83',
825
+ }, {
826
+ token: USDC_ETH,
827
+ lltv: 0.98,
828
+ liquidationCursor: '300000000000000000',
829
+ oracle: '0x8d1A84515B54C58bAc3b18315B6b1f17dA5cf6ca',
830
+ hidden: true,
831
+ }],
832
+ maturity,
833
+ rcfThreshold: '300000000000',
834
+ enterGate: ZERO_ADDRESS,
835
+ liquidatorGate: ZERO_ADDRESS,
836
+ marketId,
837
+ protocolName: 'morpho-midnight',
838
+ curator: 'Morpho',
839
+ });
840
+
841
+ const createCbBTCUsdcEthMarket = (
842
+ value: MorphoMidnightVersions,
843
+ url: string,
844
+ maturity: number,
845
+ marketId: string,
846
+ ): MorphoMidnightMarketData => ({
847
+ chainIds: [NetworkNumber.Eth],
848
+ label: 'Morpho Midnight cbBTC/USDC',
849
+ shortLabel: 'cbBTC/USDC',
850
+ url,
851
+ value,
852
+ midnight: MIDNIGHT_ETH,
853
+ loanToken: USDC_ETH,
854
+ collaterals: [{
855
+ token: USDC_ETH,
856
+ lltv: 0.98,
857
+ liquidationCursor: '300000000000000000',
858
+ oracle: '0x8d1A84515B54C58bAc3b18315B6b1f17dA5cf6ca',
859
+ hidden: true,
860
+ }, {
861
+ token: CBBTC_ETH,
862
+ lltv: 0.86,
863
+ liquidationCursor: '300000000000000000',
864
+ oracle: '0xA6D6950c9F177F1De7f7757FB33539e3Ec60182a',
865
+ }],
866
+ maturity,
867
+ rcfThreshold: '300000000000',
868
+ enterGate: ZERO_ADDRESS,
869
+ liquidatorGate: ZERO_ADDRESS,
870
+ marketId,
871
+ protocolName: 'morpho-midnight',
872
+ curator: 'Morpho',
873
+ });
874
+
875
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20260925_ETH = () => createWBTCUsdcEthMarket(
876
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20260925_Eth,
877
+ 'wbtc-usdc-20260925',
878
+ 1790348400, // 2026-09-25T15:00:00Z
879
+ '0x6dae37424723dd8cef0da2db84fd2819f7dfa4e3a98e602ccc3c65ee1fac61c2',
880
+ );
881
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20261030_ETH = () => createWBTCUsdcEthMarket(
882
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261030_Eth,
883
+ 'wbtc-usdc-20261030',
884
+ 1793372400, // 2026-10-30T15:00:00Z
885
+ '0xe5e6fbd5d81875dbfb0c94866cb0d300e1c7b9aacc0a458e63dccbcc0ce278c8',
886
+ );
887
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20261127_ETH = () => createWBTCUsdcEthMarket(
888
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261127_Eth,
889
+ 'wbtc-usdc-20261127',
890
+ 1795791600, // 2026-11-27T15:00:00Z
891
+ '0xe0efc89dc1f747ba502f6a4100b6b1db9ebd0d57569fd5a54771d3a026b6a27b',
892
+ );
893
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20261225_ETH = () => createWBTCUsdcEthMarket(
894
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261225_Eth,
895
+ 'wbtc-usdc-20261225',
896
+ 1798210800, // 2026-12-25T15:00:00Z
897
+ '0x3323abf2d2a3ec804f46552db920d900bb9c7ffd3f48143ab879a918fd6c0977',
898
+ );
899
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20270129_ETH = () => createWBTCUsdcEthMarket(
900
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270129_Eth,
901
+ 'wbtc-usdc-20270129',
902
+ 1801234800, // 2027-01-29T15:00:00Z
903
+ '0xf8052f557ce70d39cf9da1bd6e37e44a49f51757afb5dc881f675490ca6b3e9f',
904
+ );
905
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20270226_ETH = () => createWBTCUsdcEthMarket(
906
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270226_Eth,
907
+ 'wbtc-usdc-20270226',
908
+ 1803654000, // 2027-02-26T15:00:00Z
909
+ '0x7e399db474781e92b22b5a647d811959f65997b1e2bb68deaade674d8afbbdbd',
910
+ );
911
+ export const MORPHO_MIDNIGHT_WBTC_USDC_860_20270326_ETH = () => createWBTCUsdcEthMarket(
912
+ MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270326_Eth,
913
+ 'wbtc-usdc-20270326',
914
+ 1806073200, // 2027-03-26T15:00:00Z
915
+ '0x54a722a6dbaa237cfe088afd295417091bfb792fe3fac96999af41635977b2b0',
916
+ );
917
+
918
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20260925_ETH = () => createCbBTCUsdcEthMarket(
919
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20260925_Eth,
920
+ 'cbbtc-usdc-20260925',
921
+ 1790348400, // 2026-09-25T15:00:00Z
922
+ '0x2a9ae59053a64e409e819d3b76750948e06065b3164278915eb80cb1b7474b65',
923
+ );
924
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20261030_ETH = () => createCbBTCUsdcEthMarket(
925
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261030_Eth,
926
+ 'cbbtc-usdc-20261030',
927
+ 1793372400, // 2026-10-30T15:00:00Z
928
+ '0xeea94e3f7185bb8cfcdf41aca2c9776788e86d6c14de345b911b04f75cd49959',
929
+ );
930
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20261127_ETH = () => createCbBTCUsdcEthMarket(
931
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261127_Eth,
932
+ 'cbbtc-usdc-20261127',
933
+ 1795791600, // 2026-11-27T15:00:00Z
934
+ '0xa6454499939a47927d3d27d65dce18486cc2aabbf75f8f5f8482e93567f4a183',
935
+ );
936
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20261225_ETH = () => createCbBTCUsdcEthMarket(
937
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261225_Eth,
938
+ 'cbbtc-usdc-20261225',
939
+ 1798210800, // 2026-12-25T15:00:00Z
940
+ '0xcf447db8cff164867b02edbf7ee7af06d241d4f3a44b34d6e3a3ea872ddea5d6',
941
+ );
942
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20270129_ETH = () => createCbBTCUsdcEthMarket(
943
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270129_Eth,
944
+ 'cbbtc-usdc-20270129',
945
+ 1801234800, // 2027-01-29T15:00:00Z
946
+ '0x9ea83106928cf45829a89c02cea7c73cb3a066d2429d7ca2fcdc0015dc191df1',
947
+ );
948
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20270226_ETH = () => createCbBTCUsdcEthMarket(
949
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270226_Eth,
950
+ 'cbbtc-usdc-20270226',
951
+ 1803654000, // 2027-02-26T15:00:00Z
952
+ '0xf9c1a9849863863a87600beb24394985a04ad3256b0c750baee0841f35f7f0e2',
953
+ );
954
+ export const MORPHO_MIDNIGHT_CBBTC_USDC_860_20270326_ETH = () => createCbBTCUsdcEthMarket(
955
+ MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270326_Eth,
956
+ 'cbbtc-usdc-20270326',
957
+ 1806073200, // 2027-03-26T15:00:00Z
958
+ '0xb00767d2cc7d5d9e27501a14e7912a089e34da675a2eb9e030072233db2c4c3b',
959
+ );
960
+
961
+ // ETHEREUM — Tenor-curated
962
+
963
+ export const MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20260925_ETH = (): MorphoMidnightMarketData => ({
964
+ chainIds: [NetworkNumber.Eth],
965
+ label: 'Tenor WETH/USDC',
966
+ shortLabel: 'Tenor WETH/USDC',
967
+ url: 'tenor-weth-usdc-20260925',
968
+ value: MorphoMidnightVersions.MorphoMidnightTenorWETHUSDC_20260925_Eth,
969
+ midnight: MIDNIGHT_ETH,
970
+ loanToken: USDC_ETH,
971
+ collaterals: [{
972
+ token: TENOR_WETH_USDC_VAULT_ETH,
973
+ lltv: 0.98,
974
+ liquidationCursor: '300000000000000000',
975
+ oracle: '0x5c4fd2864C21F0b81730B4EC74030130aA2193Ca',
976
+ hidden: true,
977
+ }, {
978
+ token: WETH_ETH,
979
+ lltv: 0.86,
980
+ liquidationCursor: '300000000000000000',
981
+ oracle: '0x0F948CBa8231Db7898ef36A4212581Ad7b1B4580',
982
+ }],
983
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
984
+ rcfThreshold: '300000000000',
985
+ enterGate: ZERO_ADDRESS,
986
+ liquidatorGate: ZERO_ADDRESS,
987
+ marketId: '0x6a463fa464b97f7ba86516be7de82761bfa411522701ede713a269c2c385c70a',
988
+ protocolName: 'morpho-midnight',
989
+ curator: 'Tenor',
990
+ });
991
+
992
+ export const MORPHO_MIDNIGHT_TENOR_STRUSD_USDC_860_20260925_ETH = (): MorphoMidnightMarketData => ({
993
+ chainIds: [NetworkNumber.Eth],
994
+ label: 'Tenor strUSD/USDC',
995
+ shortLabel: 'Tenor strUSD/USDC',
996
+ url: 'tenor-strusd-usdc-20260925',
997
+ value: MorphoMidnightVersions.MorphoMidnightTenorStrUSDUSDC_20260925_Eth,
998
+ midnight: MIDNIGHT_ETH,
999
+ loanToken: USDC_ETH,
1000
+ collaterals: [{
1001
+ token: STRUSD_ETH,
1002
+ lltv: 0.86,
1003
+ liquidationCursor: '300000000000000000',
1004
+ oracle: '0x1506c98cE61aC63c8438B710C054a51c5dD9A6A4',
1005
+ }, {
1006
+ token: TENOR_STRUSD_USDC_VAULT_ETH,
1007
+ lltv: 0.98,
1008
+ liquidationCursor: '300000000000000000',
1009
+ oracle: '0x361904890a43d4af2D1b8cF642A6C5e661Da5641',
1010
+ hidden: true,
1011
+ }],
1012
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
1013
+ rcfThreshold: '300000000000',
1014
+ enterGate: ZERO_ADDRESS,
1015
+ liquidatorGate: ZERO_ADDRESS,
1016
+ marketId: '0xa46399e45fe90b7d3c0488c4c73e9b361f758c4481734832a43d764ccdde0c64',
1017
+ protocolName: 'morpho-midnight',
1018
+ curator: 'Tenor',
1019
+ });
1020
+
1021
+ export const MORPHO_MIDNIGHT_TENOR_WSRUSD_USDC_945_20260925_ETH = (): MorphoMidnightMarketData => ({
1022
+ chainIds: [NetworkNumber.Eth],
1023
+ label: 'Tenor wsrUSD/USDC',
1024
+ shortLabel: 'Tenor wsrUSD/USDC',
1025
+ url: 'tenor-wsrusd-usdc-20260925',
1026
+ value: MorphoMidnightVersions.MorphoMidnightTenorWsrUSDUSDC_20260925_Eth,
1027
+ midnight: MIDNIGHT_ETH,
1028
+ loanToken: USDC_ETH,
1029
+ collaterals: [{
1030
+ token: TENOR_WSRUSD_USDC_VAULT_ETH,
1031
+ lltv: 0.98,
1032
+ liquidationCursor: '300000000000000000',
1033
+ oracle: '0x7C997e4dddF1D4B7C0D5f290B92d0909ba227c14',
1034
+ hidden: true,
1035
+ }, {
1036
+ token: WSRUSD_ETH,
1037
+ lltv: 0.945,
1038
+ liquidationCursor: '300000000000000000',
1039
+ oracle: '0x938D2eDb20425cF80F008E7ec314Eb456940Da15',
1040
+ }],
1041
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
1042
+ rcfThreshold: '700000000000',
1043
+ enterGate: ZERO_ADDRESS,
1044
+ liquidatorGate: ZERO_ADDRESS,
1045
+ marketId: '0xc028a0b50ba0c606fbf83e5620018f23019b1fb5d1d15b4a5a0d17cc72edcfeb',
1046
+ protocolName: 'morpho-midnight',
1047
+ curator: 'Tenor',
1048
+ });
1049
+
1050
+ export const MORPHO_MIDNIGHT_TENOR_USD3_USDC_915_20260925_ETH = (): MorphoMidnightMarketData => ({
1051
+ chainIds: [NetworkNumber.Eth],
1052
+ label: 'Tenor USD3/USDC',
1053
+ shortLabel: 'Tenor USD3/USDC',
1054
+ url: 'tenor-usd3-usdc-20260925',
1055
+ value: MorphoMidnightVersions.MorphoMidnightTenorUSD3USDC_20260925_Eth,
1056
+ midnight: MIDNIGHT_ETH,
1057
+ loanToken: USDC_ETH,
1058
+ collaterals: [{
1059
+ token: USD3_ETH,
1060
+ lltv: 0.915,
1061
+ liquidationCursor: '300000000000000000',
1062
+ oracle: '0x68b4c2B2b2e245AB54a3bD55DfD5A9d84f029C06',
1063
+ }, {
1064
+ token: TENOR_USD3_USDC_VAULT_ETH,
1065
+ lltv: 0.98,
1066
+ liquidationCursor: '300000000000000000',
1067
+ oracle: '0x2C198EC459e0a035078565dEdc3c206604b57d4D',
1068
+ hidden: true,
1069
+ }],
1070
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
1071
+ rcfThreshold: '500000000000',
1072
+ enterGate: ZERO_ADDRESS,
1073
+ liquidatorGate: ZERO_ADDRESS,
1074
+ marketId: '0x1edea0a3875af341ea885fc7eac7e02bfce90c534a1602dbd40fefccfe4c24d4',
1075
+ protocolName: 'morpho-midnight',
1076
+ curator: 'Tenor',
1077
+ });
1078
+
1079
+ export const MORPHO_MIDNIGHT_TENOR_REUSD_USDC_915_20260925_ETH = (): MorphoMidnightMarketData => ({
1080
+ chainIds: [NetworkNumber.Eth],
1081
+ label: 'Tenor reUSD/USDC',
1082
+ shortLabel: 'Tenor reUSD/USDC',
1083
+ url: 'tenor-reusd-usdc-20260925',
1084
+ value: MorphoMidnightVersions.MorphoMidnightTenorReUSDUSDC_20260925_Eth,
1085
+ midnight: MIDNIGHT_ETH,
1086
+ loanToken: USDC_ETH,
1087
+ collaterals: [{
1088
+ token: REUSD_ETH,
1089
+ lltv: 0.915,
1090
+ liquidationCursor: '300000000000000000',
1091
+ oracle: '0xA66a4F03Fd8031973f8C7718904ce32385f54E70',
1092
+ }, {
1093
+ token: TENOR_REUSD_USDC_VAULT_ETH,
1094
+ lltv: 0.98,
1095
+ liquidationCursor: '300000000000000000',
1096
+ oracle: '0xE5f7f5A74E6f4dA2F68b1aa017F204a1883eC0df',
1097
+ hidden: true,
1098
+ }],
1099
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
1100
+ rcfThreshold: '500000000000',
1101
+ enterGate: ZERO_ADDRESS,
1102
+ liquidatorGate: ZERO_ADDRESS,
1103
+ marketId: '0xdba251b941d135577e1b423301b2eb6a76dfe11479c843185d20bee9208e7393',
1104
+ protocolName: 'morpho-midnight',
1105
+ curator: 'Tenor',
1106
+ });
1107
+
1108
+ export const MORPHO_MIDNIGHT_TENOR_SIUSD_USDC_915_20260925_ETH = (): MorphoMidnightMarketData => ({
1109
+ chainIds: [NetworkNumber.Eth],
1110
+ label: 'Tenor siUSD/USDC',
1111
+ shortLabel: 'Tenor siUSD/USDC',
1112
+ url: 'tenor-siusd-usdc-20260925',
1113
+ value: MorphoMidnightVersions.MorphoMidnightTenorSiUSDUSDC_20260925_Eth,
1114
+ midnight: MIDNIGHT_ETH,
1115
+ loanToken: USDC_ETH,
1116
+ collaterals: [{
1117
+ token: TENOR_SIUSD_USDC_VAULT_ETH,
1118
+ lltv: 0.98,
1119
+ liquidationCursor: '300000000000000000',
1120
+ oracle: '0xE872d1d33b13B52aE7cD9A0CDD4102468350e5fa',
1121
+ hidden: true,
1122
+ }, {
1123
+ token: SIUSD_ETH,
1124
+ lltv: 0.915,
1125
+ liquidationCursor: '300000000000000000',
1126
+ oracle: '0xd2cC46b9B2D761502eF933320ecf0268EC0dfa6d',
1127
+ }],
1128
+ maturity: 1790348400, // 2026-09-25T15:00:00Z
1129
+ rcfThreshold: '500000000000',
1130
+ enterGate: ZERO_ADDRESS,
1131
+ liquidatorGate: ZERO_ADDRESS,
1132
+ marketId: '0x48d95ace842493ce2c1c474c0cb60ac208e9d8a714258e278af9c8ae01a88fa5',
1133
+ protocolName: 'morpho-midnight',
1134
+ curator: 'Tenor',
1135
+ });
1136
+
781
1137
  export const MorphoMidnightMarkets = (networkId: NetworkNumber) => ({
782
1138
  // BASE — Morpho-curated
783
1139
  [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20260731_Base]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20260731(networkId),
@@ -813,9 +1169,35 @@ export const MorphoMidnightMarkets = (networkId: NetworkNumber) => ({
813
1169
  [MorphoMidnightVersions.MorphoMidnightTenorCbETHWETH_20261127_Base]: MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20261127(),
814
1170
  [MorphoMidnightVersions.MorphoMidnightTenorCbETHWETH_20261225_Base]: MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20261225(),
815
1171
  [MorphoMidnightVersions.MorphoMidnightTenorCbETHWETH_20270129_Base]: MORPHO_MIDNIGHT_TENOR_CBETH_WETH_945_20270129(),
1172
+ // ETHEREUM — Morpho-curated
1173
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20260925_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20260925_ETH(),
1174
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261030_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20261030_ETH(),
1175
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261127_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20261127_ETH(),
1176
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20261225_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20261225_ETH(),
1177
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270129_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20270129_ETH(),
1178
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270226_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20270226_ETH(),
1179
+ [MorphoMidnightVersions.MorphoMidnightWBTCUSDC_860_20270326_Eth]: MORPHO_MIDNIGHT_WBTC_USDC_860_20270326_ETH(),
1180
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20260925_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20260925_ETH(),
1181
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261030_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20261030_ETH(),
1182
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261127_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20261127_ETH(),
1183
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20261225_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20261225_ETH(),
1184
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270129_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20270129_ETH(),
1185
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270226_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20270226_ETH(),
1186
+ [MorphoMidnightVersions.MorphoMidnightCbBTCUSDC_860_20270326_Eth]: MORPHO_MIDNIGHT_CBBTC_USDC_860_20270326_ETH(),
1187
+ // ETHEREUM — Tenor-curated
1188
+ [MorphoMidnightVersions.MorphoMidnightTenorWETHUSDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_WETH_USDC_860_20260925_ETH(),
1189
+ [MorphoMidnightVersions.MorphoMidnightTenorUSD3USDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_USD3_USDC_915_20260925_ETH(),
1190
+ // ── Pending `@defisaver/tokens` ────────────────────────────────────────────────────────────────
1191
+ // Collateralised by stablecoins the app does not carry yet, so `getAssetInfoByAddress` hands back the
1192
+ // `?` proto and the market renders an unnamed collateral at a NaN price. The definitions below are
1193
+ // verified against the chain and complete — this map is the only place they are withheld from, so
1194
+ // uncommenting these four lines is the whole re-enable once the assets ship.
1195
+ // [MorphoMidnightVersions.MorphoMidnightTenorStrUSDUSDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_STRUSD_USDC_860_20260925_ETH(),
1196
+ // [MorphoMidnightVersions.MorphoMidnightTenorWsrUSDUSDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_WSRUSD_USDC_945_20260925_ETH(),
1197
+ // [MorphoMidnightVersions.MorphoMidnightTenorReUSDUSDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_REUSD_USDC_915_20260925_ETH(),
1198
+ // [MorphoMidnightVersions.MorphoMidnightTenorSiUSDUSDC_20260925_Eth]: MORPHO_MIDNIGHT_TENOR_SIUSD_USDC_915_20260925_ETH(),
816
1199
  }) as const;
817
1200
 
818
- // Which markets Tenor's router quotes, by id, for the quote helpers that only receive one.
819
1201
  const TENOR_MARKET_IDS = new Set(
820
1202
  Object.values(MorphoMidnightMarkets(NetworkNumber.Base))
821
1203
  .filter((market) => market.curator === 'Tenor')
@@ -828,16 +1210,20 @@ export const isTenorMidnightMarket = (market: Pick<MorphoMidnightMarketData, 'cu
828
1210
  : market.curator === 'Tenor'
829
1211
  );
830
1212
 
831
- export const findMorphoMidnightMarket = (marketId: string, network: NetworkNumber = NetworkNumber.Base): MorphoMidnightMarketData | undefined => Object.values(MorphoMidnightMarkets(network)).find(
832
- (market) => market.marketId.toLowerCase() === marketId.toLowerCase(),
1213
+ export const findMorphoMidnightMarket = (marketId: string, network?: NetworkNumber): MorphoMidnightMarketData | undefined => (
1214
+ Object.values(MorphoMidnightMarkets(network ?? NetworkNumber.Base))
1215
+ .find((market) => market.marketId.toLowerCase() === marketId.toLowerCase()
1216
+ && (network === undefined || market.chainIds.includes(network)))
833
1217
  );
834
1218
 
835
- /**
836
- * The market's collateral set as the chain knows it: the listed collaterals followed by the curator's
837
- * hidden ones. This — not `collaterals` — is what a `Market` struct takes, since the market id is the hash
838
- * of that struct. Anything assembling one for a contract call goes through here so it can't quietly build
839
- * a market of its own instead.
840
- */
841
1219
  export const morphoMidnightMarketCollateralParams = (
842
- market: Pick<MorphoMidnightMarketData, 'collaterals' | 'hiddenCollaterals'>,
843
- ): MorphoMidnightCollateralParams[] => [...market.collaterals, ...(market.hiddenCollaterals || [])];
1220
+ market: Pick<MorphoMidnightMarketData, 'collaterals'>,
1221
+ ): MorphoMidnightCollateralParams[] => market.collaterals.map(({
1222
+ token, lltv, liquidationCursor, oracle,
1223
+ }) => ({
1224
+ token, lltv, liquidationCursor, oracle,
1225
+ }));
1226
+
1227
+ export const morphoMidnightVisibleCollaterals = (
1228
+ market: Pick<MorphoMidnightMarketData, 'collaterals'>,
1229
+ ): MorphoMidnightCollateralParams[] => market.collaterals.filter((collateral) => !collateral.hidden);