@morpho-dev/router 0.11.0 → 0.12.1

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 (48) hide show
  1. package/README.md +20 -5
  2. package/dist/cli.js +12198 -6809
  3. package/dist/drizzle/migrations/0034_chain-checkpoints.sql +1 -0
  4. package/dist/drizzle/migrations/0035_chain-tip-hash-cas.sql +1 -0
  5. package/dist/drizzle/migrations/0036_pending-links.sql +22 -0
  6. package/dist/drizzle/migrations/0037_chain-finalized-anchor.sql +2 -0
  7. package/dist/drizzle/migrations/0038_add-obligation-rcf-threshold.sql +2 -0
  8. package/dist/drizzle/migrations/0039_add-offers-composite-indexes.sql +2 -0
  9. package/dist/drizzle/migrations/0040_drop-redundant-offers-indexes.sql +2 -0
  10. package/dist/drizzle/migrations/0041_add-group-winner-expression-index.sql +10 -0
  11. package/dist/drizzle/migrations/0042_contract-sync-v1.14.sql +284 -0
  12. package/dist/drizzle/migrations/0043_add-obligation-side-tick-index.sql +1 -0
  13. package/dist/drizzle/migrations/0044_index-audit-cleanup.sql +27 -0
  14. package/dist/drizzle/migrations/0045_add-lots-offsets-availability-indexes.sql +5 -0
  15. package/dist/drizzle/migrations/0046_add-offers-active-tick-index.sql +1 -0
  16. package/dist/drizzle/migrations/0047_add-offers-book-winners-index.sql +1 -0
  17. package/dist/drizzle/migrations/0048_covering-indexes-for-winners-queries.sql +34 -0
  18. package/dist/drizzle/migrations/0049_contract-sync-v1.15.sql +305 -0
  19. package/dist/drizzle/migrations/0050_contract-sync-v1.16.sql +305 -0
  20. package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
  21. package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
  22. package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
  23. package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
  24. package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
  25. package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
  26. package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
  27. package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
  28. package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
  29. package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
  30. package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
  31. package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
  32. package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
  33. package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
  34. package/dist/drizzle/migrations/meta/0050_snapshot.json +2035 -0
  35. package/dist/drizzle/migrations/meta/_journal.json +119 -0
  36. package/dist/evm/bytecode/morpho.txt +1 -1
  37. package/dist/index.browser.d.mts +611 -282
  38. package/dist/index.browser.d.mts.map +1 -1
  39. package/dist/index.browser.mjs +735 -448
  40. package/dist/index.browser.mjs.map +1 -1
  41. package/dist/index.node.d.mts +1525 -614
  42. package/dist/index.node.d.mts.map +1 -1
  43. package/dist/index.node.mjs +9493 -5238
  44. package/dist/index.node.mjs.map +1 -1
  45. package/dist/server-DNFuP89-.js +9573 -0
  46. package/dist/server.js +9617 -0
  47. package/docs/integrator.md +14 -24
  48. package/package.json +7 -4
@@ -5,7 +5,7 @@ import * as z$1 from "zod";
5
5
  import { Client } from "openapi-fetch";
6
6
  import { AbiEvent, Address, ChainContract, ChainFormatters, GetLogsReturnType, Hex, MulticallParameters, PublicClient, Transport, WalletClient } from "viem";
7
7
  import { Chain } from "viem/chains";
8
- import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
8
+ import { SimpleMerkleTree } from "@openzeppelin/merkle-tree";
9
9
  import "@electric-sql/pglite";
10
10
  import "drizzle-orm/node-postgres";
11
11
  import "drizzle-orm/pglite";
@@ -18,12 +18,12 @@ declare namespace BookResponse_d_exports {
18
18
  type BookLevelResponse = {
19
19
  tick: number;
20
20
  price: string;
21
- assets: string;
21
+ max_units: string;
22
22
  count: number;
23
23
  };
24
24
  type Input$1 = {
25
25
  tick: number;
26
- assets: bigint;
26
+ maxUnits: bigint;
27
27
  count: number;
28
28
  };
29
29
  declare function from$15(level: Input$1): BookLevelResponse;
@@ -229,34 +229,36 @@ declare const MorphoV2: readonly [{
229
229
  readonly stateMutability: "nonpayable";
230
230
  readonly inputs: readonly [];
231
231
  }, {
232
- readonly name: "collateralOf";
232
+ readonly name: "activatedCollaterals";
233
233
  readonly type: "function";
234
234
  readonly stateMutability: "view";
235
235
  readonly inputs: readonly [{
236
- readonly type: "bytes20";
236
+ readonly type: "bytes32";
237
237
  readonly name: "id";
238
238
  }, {
239
239
  readonly type: "address";
240
240
  readonly name: "user";
241
- }, {
242
- readonly type: "uint256";
243
- readonly name: "collateralIndex";
244
241
  }];
245
242
  readonly outputs: readonly [{
246
243
  readonly type: "uint128";
247
244
  }];
248
245
  }, {
249
- readonly name: "consume";
246
+ readonly name: "collateralOf";
250
247
  readonly type: "function";
251
- readonly stateMutability: "nonpayable";
248
+ readonly stateMutability: "view";
252
249
  readonly inputs: readonly [{
253
250
  readonly type: "bytes32";
254
- readonly name: "group";
251
+ readonly name: "id";
252
+ }, {
253
+ readonly type: "address";
254
+ readonly name: "user";
255
255
  }, {
256
256
  readonly type: "uint256";
257
- readonly name: "amount";
257
+ readonly name: "index";
258
+ }];
259
+ readonly outputs: readonly [{
260
+ readonly type: "uint128";
258
261
  }];
259
- readonly outputs: readonly [];
260
262
  }, {
261
263
  readonly name: "consumed";
262
264
  readonly type: "function";
@@ -271,12 +273,40 @@ declare const MorphoV2: readonly [{
271
273
  readonly outputs: readonly [{
272
274
  readonly type: "uint256";
273
275
  }];
276
+ }, {
277
+ readonly name: "creditAfterSlashing";
278
+ readonly type: "function";
279
+ readonly stateMutability: "view";
280
+ readonly inputs: readonly [{
281
+ readonly type: "bytes32";
282
+ readonly name: "id";
283
+ }, {
284
+ readonly type: "address";
285
+ readonly name: "user";
286
+ }];
287
+ readonly outputs: readonly [{
288
+ readonly type: "uint256";
289
+ }];
290
+ }, {
291
+ readonly name: "creditOf";
292
+ readonly type: "function";
293
+ readonly stateMutability: "view";
294
+ readonly inputs: readonly [{
295
+ readonly type: "bytes32";
296
+ readonly name: "id";
297
+ }, {
298
+ readonly type: "address";
299
+ readonly name: "user";
300
+ }];
301
+ readonly outputs: readonly [{
302
+ readonly type: "uint256";
303
+ }];
274
304
  }, {
275
305
  readonly name: "debtOf";
276
306
  readonly type: "function";
277
307
  readonly stateMutability: "view";
278
308
  readonly inputs: readonly [{
279
- readonly type: "bytes20";
309
+ readonly type: "bytes32";
280
310
  readonly name: "id";
281
311
  }, {
282
312
  readonly type: "address";
@@ -294,7 +324,6 @@ declare const MorphoV2: readonly [{
294
324
  readonly name: "loanToken";
295
325
  }, {
296
326
  readonly type: "uint256";
297
- readonly name: "index";
298
327
  }];
299
328
  readonly outputs: readonly [{
300
329
  readonly type: "uint16";
@@ -312,11 +341,11 @@ declare const MorphoV2: readonly [{
312
341
  readonly type: "function";
313
342
  readonly stateMutability: "view";
314
343
  readonly inputs: readonly [{
315
- readonly type: "bytes20";
344
+ readonly type: "bytes32";
316
345
  readonly name: "id";
317
346
  }];
318
347
  readonly outputs: readonly [{
319
- readonly type: "uint16[6]";
348
+ readonly type: "uint16[7]";
320
349
  }];
321
350
  }, {
322
351
  readonly name: "flashLoan";
@@ -336,6 +365,20 @@ declare const MorphoV2: readonly [{
336
365
  readonly name: "data";
337
366
  }];
338
367
  readonly outputs: readonly [];
368
+ }, {
369
+ readonly name: "isAuthorized";
370
+ readonly type: "function";
371
+ readonly stateMutability: "view";
372
+ readonly inputs: readonly [{
373
+ readonly type: "address";
374
+ readonly name: "authorizer";
375
+ }, {
376
+ readonly type: "address";
377
+ readonly name: "authorized";
378
+ }];
379
+ readonly outputs: readonly [{
380
+ readonly type: "bool";
381
+ }];
339
382
  }, {
340
383
  readonly name: "isHealthy";
341
384
  readonly type: "function";
@@ -353,6 +396,9 @@ declare const MorphoV2: readonly [{
353
396
  }, {
354
397
  readonly type: "uint256";
355
398
  readonly name: "lltv";
399
+ }, {
400
+ readonly type: "uint256";
401
+ readonly name: "maxLif";
356
402
  }, {
357
403
  readonly type: "address";
358
404
  readonly name: "oracle";
@@ -363,11 +409,11 @@ declare const MorphoV2: readonly [{
363
409
  readonly name: "maturity";
364
410
  }, {
365
411
  readonly type: "uint256";
366
- readonly name: "minCollatValue";
412
+ readonly name: "rcfThreshold";
367
413
  }];
368
414
  readonly name: "obligation";
369
415
  }, {
370
- readonly type: "bytes20";
416
+ readonly type: "bytes32";
371
417
  readonly name: "id";
372
418
  }, {
373
419
  readonly type: "address";
@@ -393,6 +439,9 @@ declare const MorphoV2: readonly [{
393
439
  }, {
394
440
  readonly type: "uint256";
395
441
  readonly name: "lltv";
442
+ }, {
443
+ readonly type: "uint256";
444
+ readonly name: "maxLif";
396
445
  }, {
397
446
  readonly type: "address";
398
447
  readonly name: "oracle";
@@ -403,7 +452,7 @@ declare const MorphoV2: readonly [{
403
452
  readonly name: "maturity";
404
453
  }, {
405
454
  readonly type: "uint256";
406
- readonly name: "minCollatValue";
455
+ readonly name: "rcfThreshold";
407
456
  }];
408
457
  readonly name: "obligation";
409
458
  }, {
@@ -427,6 +476,64 @@ declare const MorphoV2: readonly [{
427
476
  }, {
428
477
  readonly type: "uint256";
429
478
  }];
479
+ }, {
480
+ readonly name: "maxCollateralPerUser";
481
+ readonly type: "function";
482
+ readonly stateMutability: "view";
483
+ readonly inputs: readonly [{
484
+ readonly type: "address";
485
+ readonly name: "collateralToken";
486
+ }];
487
+ readonly outputs: readonly [{
488
+ readonly type: "uint256";
489
+ }];
490
+ }, {
491
+ readonly name: "maxLif";
492
+ readonly type: "function";
493
+ readonly stateMutability: "pure";
494
+ readonly inputs: readonly [{
495
+ readonly type: "uint256";
496
+ readonly name: "lltv";
497
+ }, {
498
+ readonly type: "uint256";
499
+ readonly name: "cursor";
500
+ }];
501
+ readonly outputs: readonly [{
502
+ readonly type: "uint256";
503
+ }];
504
+ }, {
505
+ readonly name: "maxTakeableAssets";
506
+ readonly type: "function";
507
+ readonly stateMutability: "view";
508
+ readonly inputs: readonly [{
509
+ readonly type: "address";
510
+ readonly name: "loanToken";
511
+ }];
512
+ readonly outputs: readonly [{
513
+ readonly type: "uint256";
514
+ }];
515
+ }, {
516
+ readonly name: "maxTotalUnits";
517
+ readonly type: "function";
518
+ readonly stateMutability: "view";
519
+ readonly inputs: readonly [{
520
+ readonly type: "address";
521
+ readonly name: "loanToken";
522
+ }];
523
+ readonly outputs: readonly [{
524
+ readonly type: "uint128";
525
+ }];
526
+ }, {
527
+ readonly name: "maxTradingFee";
528
+ readonly type: "function";
529
+ readonly stateMutability: "pure";
530
+ readonly inputs: readonly [{
531
+ readonly type: "uint256";
532
+ readonly name: "index";
533
+ }];
534
+ readonly outputs: readonly [{
535
+ readonly type: "uint256";
536
+ }];
430
537
  }, {
431
538
  readonly name: "multicall";
432
539
  readonly type: "function";
@@ -441,7 +548,7 @@ declare const MorphoV2: readonly [{
441
548
  readonly type: "function";
442
549
  readonly stateMutability: "view";
443
550
  readonly inputs: readonly [{
444
- readonly type: "bytes20";
551
+ readonly type: "bytes32";
445
552
  readonly name: "id";
446
553
  }];
447
554
  readonly outputs: readonly [{
@@ -452,24 +559,21 @@ declare const MorphoV2: readonly [{
452
559
  readonly type: "function";
453
560
  readonly stateMutability: "view";
454
561
  readonly inputs: readonly [{
455
- readonly type: "bytes20";
562
+ readonly type: "bytes32";
456
563
  readonly name: "id";
457
564
  }];
458
565
  readonly outputs: readonly [{
459
566
  readonly type: "uint128";
460
567
  readonly name: "totalUnits";
461
- }, {
462
- readonly type: "uint128";
463
- readonly name: "totalShares";
464
568
  }, {
465
569
  readonly type: "uint256";
466
570
  readonly name: "withdrawable";
571
+ }, {
572
+ readonly type: "uint128";
573
+ readonly name: "lossIndex";
467
574
  }, {
468
575
  readonly type: "bool";
469
576
  readonly name: "created";
470
- }, {
471
- readonly type: "uint16[6]";
472
- readonly name: "fees";
473
577
  }];
474
578
  }, {
475
579
  readonly name: "owner";
@@ -496,6 +600,9 @@ declare const MorphoV2: readonly [{
496
600
  }, {
497
601
  readonly type: "uint256";
498
602
  readonly name: "lltv";
603
+ }, {
604
+ readonly type: "uint256";
605
+ readonly name: "maxLif";
499
606
  }, {
500
607
  readonly type: "address";
501
608
  readonly name: "oracle";
@@ -506,12 +613,12 @@ declare const MorphoV2: readonly [{
506
613
  readonly name: "maturity";
507
614
  }, {
508
615
  readonly type: "uint256";
509
- readonly name: "minCollatValue";
616
+ readonly name: "rcfThreshold";
510
617
  }];
511
618
  readonly name: "obligation";
512
619
  }, {
513
620
  readonly type: "uint256";
514
- readonly name: "obligationUnits";
621
+ readonly name: "units";
515
622
  }, {
516
623
  readonly type: "address";
517
624
  readonly name: "onBehalf";
@@ -528,6 +635,21 @@ declare const MorphoV2: readonly [{
528
635
  readonly outputs: readonly [{
529
636
  readonly type: "bytes32";
530
637
  }];
638
+ }, {
639
+ readonly name: "setConsumed";
640
+ readonly type: "function";
641
+ readonly stateMutability: "nonpayable";
642
+ readonly inputs: readonly [{
643
+ readonly type: "bytes32";
644
+ readonly name: "group";
645
+ }, {
646
+ readonly type: "uint256";
647
+ readonly name: "amount";
648
+ }, {
649
+ readonly type: "address";
650
+ readonly name: "onBehalf";
651
+ }];
652
+ readonly outputs: readonly [];
531
653
  }, {
532
654
  readonly name: "setDefaultTradingFee";
533
655
  readonly type: "function";
@@ -552,12 +674,63 @@ declare const MorphoV2: readonly [{
552
674
  readonly name: "newFeeSetter";
553
675
  }];
554
676
  readonly outputs: readonly [];
677
+ }, {
678
+ readonly name: "setIsAuthorized";
679
+ readonly type: "function";
680
+ readonly stateMutability: "nonpayable";
681
+ readonly inputs: readonly [{
682
+ readonly type: "address";
683
+ readonly name: "onBehalf";
684
+ }, {
685
+ readonly type: "address";
686
+ readonly name: "authorized";
687
+ }, {
688
+ readonly type: "bool";
689
+ readonly name: "newIsAuthorized";
690
+ }];
691
+ readonly outputs: readonly [];
692
+ }, {
693
+ readonly name: "setMaxCollateralPerUser";
694
+ readonly type: "function";
695
+ readonly stateMutability: "nonpayable";
696
+ readonly inputs: readonly [{
697
+ readonly type: "address";
698
+ readonly name: "collateralToken";
699
+ }, {
700
+ readonly type: "uint256";
701
+ readonly name: "newMaxCollateralPerUser";
702
+ }];
703
+ readonly outputs: readonly [];
704
+ }, {
705
+ readonly name: "setMaxTakeableAssets";
706
+ readonly type: "function";
707
+ readonly stateMutability: "nonpayable";
708
+ readonly inputs: readonly [{
709
+ readonly type: "address";
710
+ readonly name: "loanToken";
711
+ }, {
712
+ readonly type: "uint256";
713
+ readonly name: "newMaxTakeableAssets";
714
+ }];
715
+ readonly outputs: readonly [];
716
+ }, {
717
+ readonly name: "setMaxTotalUnits";
718
+ readonly type: "function";
719
+ readonly stateMutability: "nonpayable";
720
+ readonly inputs: readonly [{
721
+ readonly type: "address";
722
+ readonly name: "loanToken";
723
+ }, {
724
+ readonly type: "uint128";
725
+ readonly name: "newMaxTotalUnits";
726
+ }];
727
+ readonly outputs: readonly [];
555
728
  }, {
556
729
  readonly name: "setObligationTradingFee";
557
730
  readonly type: "function";
558
731
  readonly stateMutability: "nonpayable";
559
732
  readonly inputs: readonly [{
560
- readonly type: "bytes20";
733
+ readonly type: "bytes32";
561
734
  readonly name: "id";
562
735
  }, {
563
736
  readonly type: "uint256";
@@ -586,24 +759,25 @@ declare const MorphoV2: readonly [{
586
759
  }];
587
760
  readonly outputs: readonly [];
588
761
  }, {
589
- readonly name: "sharesOf";
762
+ readonly name: "shuffleSession";
590
763
  readonly type: "function";
591
- readonly stateMutability: "view";
764
+ readonly stateMutability: "nonpayable";
592
765
  readonly inputs: readonly [{
593
- readonly type: "bytes20";
594
- readonly name: "id";
595
- }, {
596
766
  readonly type: "address";
597
- readonly name: "user";
598
- }];
599
- readonly outputs: readonly [{
600
- readonly type: "uint256";
767
+ readonly name: "onBehalf";
601
768
  }];
769
+ readonly outputs: readonly [];
602
770
  }, {
603
- readonly name: "shuffleSession";
771
+ readonly name: "slash";
604
772
  readonly type: "function";
605
773
  readonly stateMutability: "nonpayable";
606
- readonly inputs: readonly [];
774
+ readonly inputs: readonly [{
775
+ readonly type: "bytes32";
776
+ readonly name: "id";
777
+ }, {
778
+ readonly type: "address";
779
+ readonly name: "user";
780
+ }];
607
781
  readonly outputs: readonly [];
608
782
  }, {
609
783
  readonly name: "supplyCollateral";
@@ -622,6 +796,9 @@ declare const MorphoV2: readonly [{
622
796
  }, {
623
797
  readonly type: "uint256";
624
798
  readonly name: "lltv";
799
+ }, {
800
+ readonly type: "uint256";
801
+ readonly name: "maxLif";
625
802
  }, {
626
803
  readonly type: "address";
627
804
  readonly name: "oracle";
@@ -632,7 +809,7 @@ declare const MorphoV2: readonly [{
632
809
  readonly name: "maturity";
633
810
  }, {
634
811
  readonly type: "uint256";
635
- readonly name: "minCollatValue";
812
+ readonly name: "rcfThreshold";
636
813
  }];
637
814
  readonly name: "obligation";
638
815
  }, {
@@ -652,16 +829,7 @@ declare const MorphoV2: readonly [{
652
829
  readonly stateMutability: "nonpayable";
653
830
  readonly inputs: readonly [{
654
831
  readonly type: "uint256";
655
- readonly name: "buyerAssets";
656
- }, {
657
- readonly type: "uint256";
658
- readonly name: "sellerAssets";
659
- }, {
660
- readonly type: "uint256";
661
- readonly name: "obligationUnits";
662
- }, {
663
- readonly type: "uint256";
664
- readonly name: "obligationShares";
832
+ readonly name: "units";
665
833
  }, {
666
834
  readonly type: "address";
667
835
  readonly name: "taker";
@@ -689,6 +857,9 @@ declare const MorphoV2: readonly [{
689
857
  }, {
690
858
  readonly type: "uint256";
691
859
  readonly name: "lltv";
860
+ }, {
861
+ readonly type: "uint256";
862
+ readonly name: "maxLif";
692
863
  }, {
693
864
  readonly type: "address";
694
865
  readonly name: "oracle";
@@ -699,7 +870,7 @@ declare const MorphoV2: readonly [{
699
870
  readonly name: "maturity";
700
871
  }, {
701
872
  readonly type: "uint256";
702
- readonly name: "minCollatValue";
873
+ readonly name: "rcfThreshold";
703
874
  }];
704
875
  readonly name: "obligation";
705
876
  }, {
@@ -710,13 +881,7 @@ declare const MorphoV2: readonly [{
710
881
  readonly name: "maker";
711
882
  }, {
712
883
  readonly type: "uint256";
713
- readonly name: "assets";
714
- }, {
715
- readonly type: "uint256";
716
- readonly name: "obligationUnits";
717
- }, {
718
- readonly type: "uint256";
719
- readonly name: "obligationShares";
884
+ readonly name: "maxUnits";
720
885
  }, {
721
886
  readonly type: "uint256";
722
887
  readonly name: "start";
@@ -741,6 +906,9 @@ declare const MorphoV2: readonly [{
741
906
  }, {
742
907
  readonly type: "address";
743
908
  readonly name: "receiverIfMakerIsSeller";
909
+ }, {
910
+ readonly type: "bool";
911
+ readonly name: "exitOnly";
744
912
  }];
745
913
  readonly name: "offer";
746
914
  }, {
@@ -769,8 +937,6 @@ declare const MorphoV2: readonly [{
769
937
  readonly type: "uint256";
770
938
  }, {
771
939
  readonly type: "uint256";
772
- }, {
773
- readonly type: "uint256";
774
940
  }];
775
941
  }, {
776
942
  readonly name: "toId";
@@ -789,6 +955,9 @@ declare const MorphoV2: readonly [{
789
955
  }, {
790
956
  readonly type: "uint256";
791
957
  readonly name: "lltv";
958
+ }, {
959
+ readonly type: "uint256";
960
+ readonly name: "maxLif";
792
961
  }, {
793
962
  readonly type: "address";
794
963
  readonly name: "oracle";
@@ -799,19 +968,19 @@ declare const MorphoV2: readonly [{
799
968
  readonly name: "maturity";
800
969
  }, {
801
970
  readonly type: "uint256";
802
- readonly name: "minCollatValue";
971
+ readonly name: "rcfThreshold";
803
972
  }];
804
973
  readonly name: "obligation";
805
974
  }];
806
975
  readonly outputs: readonly [{
807
- readonly type: "bytes20";
976
+ readonly type: "bytes32";
808
977
  }];
809
978
  }, {
810
979
  readonly name: "toObligation";
811
980
  readonly type: "function";
812
981
  readonly stateMutability: "view";
813
982
  readonly inputs: readonly [{
814
- readonly type: "bytes20";
983
+ readonly type: "bytes32";
815
984
  readonly name: "id";
816
985
  }];
817
986
  readonly outputs: readonly [{
@@ -827,6 +996,9 @@ declare const MorphoV2: readonly [{
827
996
  }, {
828
997
  readonly type: "uint256";
829
998
  readonly name: "lltv";
999
+ }, {
1000
+ readonly type: "uint256";
1001
+ readonly name: "maxLif";
830
1002
  }, {
831
1003
  readonly type: "address";
832
1004
  readonly name: "oracle";
@@ -837,26 +1009,15 @@ declare const MorphoV2: readonly [{
837
1009
  readonly name: "maturity";
838
1010
  }, {
839
1011
  readonly type: "uint256";
840
- readonly name: "minCollatValue";
1012
+ readonly name: "rcfThreshold";
841
1013
  }];
842
1014
  }];
843
- }, {
844
- readonly name: "totalShares";
845
- readonly type: "function";
846
- readonly stateMutability: "view";
847
- readonly inputs: readonly [{
848
- readonly type: "bytes20";
849
- readonly name: "id";
850
- }];
851
- readonly outputs: readonly [{
852
- readonly type: "uint256";
853
- }];
854
1015
  }, {
855
1016
  readonly name: "totalUnits";
856
1017
  readonly type: "function";
857
1018
  readonly stateMutability: "view";
858
1019
  readonly inputs: readonly [{
859
- readonly type: "bytes20";
1020
+ readonly type: "bytes32";
860
1021
  readonly name: "id";
861
1022
  }];
862
1023
  readonly outputs: readonly [{
@@ -879,6 +1040,9 @@ declare const MorphoV2: readonly [{
879
1040
  }, {
880
1041
  readonly type: "uint256";
881
1042
  readonly name: "lltv";
1043
+ }, {
1044
+ readonly type: "uint256";
1045
+ readonly name: "maxLif";
882
1046
  }, {
883
1047
  readonly type: "address";
884
1048
  readonly name: "oracle";
@@ -889,19 +1053,19 @@ declare const MorphoV2: readonly [{
889
1053
  readonly name: "maturity";
890
1054
  }, {
891
1055
  readonly type: "uint256";
892
- readonly name: "minCollatValue";
1056
+ readonly name: "rcfThreshold";
893
1057
  }];
894
1058
  readonly name: "obligation";
895
1059
  }];
896
1060
  readonly outputs: readonly [{
897
- readonly type: "bytes20";
1061
+ readonly type: "bytes32";
898
1062
  }];
899
1063
  }, {
900
1064
  readonly name: "tradingFee";
901
1065
  readonly type: "function";
902
1066
  readonly stateMutability: "view";
903
1067
  readonly inputs: readonly [{
904
- readonly type: "bytes20";
1068
+ readonly type: "bytes32";
905
1069
  readonly name: "id";
906
1070
  }, {
907
1071
  readonly type: "uint256";
@@ -918,6 +1082,20 @@ declare const MorphoV2: readonly [{
918
1082
  readonly outputs: readonly [{
919
1083
  readonly type: "address";
920
1084
  }];
1085
+ }, {
1086
+ readonly name: "userLossIndex";
1087
+ readonly type: "function";
1088
+ readonly stateMutability: "view";
1089
+ readonly inputs: readonly [{
1090
+ readonly type: "bytes32";
1091
+ readonly name: "id";
1092
+ }, {
1093
+ readonly type: "address";
1094
+ readonly name: "user";
1095
+ }];
1096
+ readonly outputs: readonly [{
1097
+ readonly type: "uint128";
1098
+ }];
921
1099
  }, {
922
1100
  readonly name: "withdraw";
923
1101
  readonly type: "function";
@@ -935,6 +1113,9 @@ declare const MorphoV2: readonly [{
935
1113
  }, {
936
1114
  readonly type: "uint256";
937
1115
  readonly name: "lltv";
1116
+ }, {
1117
+ readonly type: "uint256";
1118
+ readonly name: "maxLif";
938
1119
  }, {
939
1120
  readonly type: "address";
940
1121
  readonly name: "oracle";
@@ -945,15 +1126,12 @@ declare const MorphoV2: readonly [{
945
1126
  readonly name: "maturity";
946
1127
  }, {
947
1128
  readonly type: "uint256";
948
- readonly name: "minCollatValue";
1129
+ readonly name: "rcfThreshold";
949
1130
  }];
950
1131
  readonly name: "obligation";
951
1132
  }, {
952
1133
  readonly type: "uint256";
953
- readonly name: "obligationUnits";
954
- }, {
955
- readonly type: "uint256";
956
- readonly name: "shares";
1134
+ readonly name: "units";
957
1135
  }, {
958
1136
  readonly type: "address";
959
1137
  readonly name: "onBehalf";
@@ -961,11 +1139,7 @@ declare const MorphoV2: readonly [{
961
1139
  readonly type: "address";
962
1140
  readonly name: "receiver";
963
1141
  }];
964
- readonly outputs: readonly [{
965
- readonly type: "uint256";
966
- }, {
967
- readonly type: "uint256";
968
- }];
1142
+ readonly outputs: readonly [];
969
1143
  }, {
970
1144
  readonly name: "withdrawCollateral";
971
1145
  readonly type: "function";
@@ -983,6 +1157,9 @@ declare const MorphoV2: readonly [{
983
1157
  }, {
984
1158
  readonly type: "uint256";
985
1159
  readonly name: "lltv";
1160
+ }, {
1161
+ readonly type: "uint256";
1162
+ readonly name: "maxLif";
986
1163
  }, {
987
1164
  readonly type: "address";
988
1165
  readonly name: "oracle";
@@ -993,7 +1170,7 @@ declare const MorphoV2: readonly [{
993
1170
  readonly name: "maturity";
994
1171
  }, {
995
1172
  readonly type: "uint256";
996
- readonly name: "minCollatValue";
1173
+ readonly name: "rcfThreshold";
997
1174
  }];
998
1175
  readonly name: "obligation";
999
1176
  }, {
@@ -1015,7 +1192,7 @@ declare const MorphoV2: readonly [{
1015
1192
  readonly type: "function";
1016
1193
  readonly stateMutability: "view";
1017
1194
  readonly inputs: readonly [{
1018
- readonly type: "bytes20";
1195
+ readonly type: "bytes32";
1019
1196
  readonly name: "id";
1020
1197
  }];
1021
1198
  readonly outputs: readonly [{
@@ -1029,21 +1206,6 @@ declare const MorphoV2: readonly [{
1029
1206
  readonly name: "owner";
1030
1207
  readonly indexed: true;
1031
1208
  }];
1032
- }, {
1033
- readonly name: "Consume";
1034
- readonly type: "event";
1035
- readonly inputs: readonly [{
1036
- readonly type: "address";
1037
- readonly name: "user";
1038
- readonly indexed: true;
1039
- }, {
1040
- readonly type: "bytes32";
1041
- readonly name: "group";
1042
- readonly indexed: true;
1043
- }, {
1044
- readonly type: "uint256";
1045
- readonly name: "amount";
1046
- }];
1047
1209
  }, {
1048
1210
  readonly name: "FlashLoan";
1049
1211
  readonly type: "event";
@@ -1067,7 +1229,7 @@ declare const MorphoV2: readonly [{
1067
1229
  readonly name: "caller";
1068
1230
  readonly indexed: true;
1069
1231
  }, {
1070
- readonly type: "bytes20";
1232
+ readonly type: "bytes32";
1071
1233
  readonly name: "id_";
1072
1234
  readonly indexed: true;
1073
1235
  }, {
@@ -1086,12 +1248,15 @@ declare const MorphoV2: readonly [{
1086
1248
  }, {
1087
1249
  readonly type: "uint256";
1088
1250
  readonly name: "badDebt";
1251
+ }, {
1252
+ readonly type: "uint256";
1253
+ readonly name: "latestLossIndex";
1089
1254
  }];
1090
1255
  }, {
1091
1256
  readonly name: "ObligationCreated";
1092
1257
  readonly type: "event";
1093
1258
  readonly inputs: readonly [{
1094
- readonly type: "bytes20";
1259
+ readonly type: "bytes32";
1095
1260
  readonly name: "id_";
1096
1261
  readonly indexed: true;
1097
1262
  }, {
@@ -1107,6 +1272,9 @@ declare const MorphoV2: readonly [{
1107
1272
  }, {
1108
1273
  readonly type: "uint256";
1109
1274
  readonly name: "lltv";
1275
+ }, {
1276
+ readonly type: "uint256";
1277
+ readonly name: "maxLif";
1110
1278
  }, {
1111
1279
  readonly type: "address";
1112
1280
  readonly name: "oracle";
@@ -1117,7 +1285,7 @@ declare const MorphoV2: readonly [{
1117
1285
  readonly name: "maturity";
1118
1286
  }, {
1119
1287
  readonly type: "uint256";
1120
- readonly name: "minCollatValue";
1288
+ readonly name: "rcfThreshold";
1121
1289
  }];
1122
1290
  readonly name: "obligation";
1123
1291
  }];
@@ -1129,17 +1297,36 @@ declare const MorphoV2: readonly [{
1129
1297
  readonly name: "caller";
1130
1298
  readonly indexed: true;
1131
1299
  }, {
1132
- readonly type: "bytes20";
1300
+ readonly type: "bytes32";
1133
1301
  readonly name: "id_";
1134
1302
  readonly indexed: true;
1135
1303
  }, {
1136
1304
  readonly type: "uint256";
1137
- readonly name: "obligationUnits";
1305
+ readonly name: "units";
1138
1306
  }, {
1139
1307
  readonly type: "address";
1140
1308
  readonly name: "onBehalf";
1141
1309
  readonly indexed: true;
1142
1310
  }];
1311
+ }, {
1312
+ readonly name: "SetConsumed";
1313
+ readonly type: "event";
1314
+ readonly inputs: readonly [{
1315
+ readonly type: "address";
1316
+ readonly name: "caller";
1317
+ readonly indexed: true;
1318
+ }, {
1319
+ readonly type: "address";
1320
+ readonly name: "onBehalf";
1321
+ readonly indexed: true;
1322
+ }, {
1323
+ readonly type: "bytes32";
1324
+ readonly name: "group";
1325
+ readonly indexed: true;
1326
+ }, {
1327
+ readonly type: "uint256";
1328
+ readonly name: "amount";
1329
+ }];
1143
1330
  }, {
1144
1331
  readonly name: "SetDefaultTradingFee";
1145
1332
  readonly type: "event";
@@ -1163,11 +1350,63 @@ declare const MorphoV2: readonly [{
1163
1350
  readonly name: "feeSetter";
1164
1351
  readonly indexed: true;
1165
1352
  }];
1353
+ }, {
1354
+ readonly name: "SetIsAuthorized";
1355
+ readonly type: "event";
1356
+ readonly inputs: readonly [{
1357
+ readonly type: "address";
1358
+ readonly name: "caller";
1359
+ readonly indexed: true;
1360
+ }, {
1361
+ readonly type: "address";
1362
+ readonly name: "onBehalf";
1363
+ readonly indexed: true;
1364
+ }, {
1365
+ readonly type: "address";
1366
+ readonly name: "authorized";
1367
+ readonly indexed: true;
1368
+ }, {
1369
+ readonly type: "bool";
1370
+ readonly name: "newIsAuthorized";
1371
+ }];
1372
+ }, {
1373
+ readonly name: "SetMaxCollateralPerUser";
1374
+ readonly type: "event";
1375
+ readonly inputs: readonly [{
1376
+ readonly type: "address";
1377
+ readonly name: "collateralToken";
1378
+ readonly indexed: true;
1379
+ }, {
1380
+ readonly type: "uint256";
1381
+ readonly name: "maxCollateralPerUser";
1382
+ }];
1383
+ }, {
1384
+ readonly name: "SetMaxTakeableAssets";
1385
+ readonly type: "event";
1386
+ readonly inputs: readonly [{
1387
+ readonly type: "address";
1388
+ readonly name: "loanToken";
1389
+ readonly indexed: true;
1390
+ }, {
1391
+ readonly type: "uint256";
1392
+ readonly name: "maxTakeableAssets";
1393
+ }];
1394
+ }, {
1395
+ readonly name: "SetMaxTotalUnits";
1396
+ readonly type: "event";
1397
+ readonly inputs: readonly [{
1398
+ readonly type: "address";
1399
+ readonly name: "loanToken";
1400
+ readonly indexed: true;
1401
+ }, {
1402
+ readonly type: "uint128";
1403
+ readonly name: "maxTotalUnits";
1404
+ }];
1166
1405
  }, {
1167
1406
  readonly name: "SetObligationTradingFee";
1168
1407
  readonly type: "event";
1169
1408
  readonly inputs: readonly [{
1170
- readonly type: "bytes20";
1409
+ readonly type: "bytes32";
1171
1410
  readonly name: "id_";
1172
1411
  readonly indexed: true;
1173
1412
  }, {
@@ -1199,12 +1438,37 @@ declare const MorphoV2: readonly [{
1199
1438
  readonly type: "event";
1200
1439
  readonly inputs: readonly [{
1201
1440
  readonly type: "address";
1202
- readonly name: "user";
1441
+ readonly name: "caller";
1442
+ readonly indexed: true;
1443
+ }, {
1444
+ readonly type: "address";
1445
+ readonly name: "onBehalf";
1203
1446
  readonly indexed: true;
1204
1447
  }, {
1205
1448
  readonly type: "bytes32";
1206
1449
  readonly name: "session";
1207
1450
  }];
1451
+ }, {
1452
+ readonly name: "Slash";
1453
+ readonly type: "event";
1454
+ readonly inputs: readonly [{
1455
+ readonly type: "address";
1456
+ readonly name: "caller";
1457
+ }, {
1458
+ readonly type: "bytes32";
1459
+ readonly name: "id_";
1460
+ readonly indexed: true;
1461
+ }, {
1462
+ readonly type: "address";
1463
+ readonly name: "user";
1464
+ readonly indexed: true;
1465
+ }, {
1466
+ readonly type: "uint256";
1467
+ readonly name: "credit";
1468
+ }, {
1469
+ readonly type: "uint256";
1470
+ readonly name: "latestLossIndex";
1471
+ }];
1208
1472
  }, {
1209
1473
  readonly name: "SupplyCollateral";
1210
1474
  readonly type: "event";
@@ -1212,7 +1476,7 @@ declare const MorphoV2: readonly [{
1212
1476
  readonly type: "address";
1213
1477
  readonly name: "caller";
1214
1478
  }, {
1215
- readonly type: "bytes20";
1479
+ readonly type: "bytes32";
1216
1480
  readonly name: "id_";
1217
1481
  readonly indexed: true;
1218
1482
  }, {
@@ -1234,7 +1498,7 @@ declare const MorphoV2: readonly [{
1234
1498
  readonly type: "address";
1235
1499
  readonly name: "caller";
1236
1500
  }, {
1237
- readonly type: "bytes20";
1501
+ readonly type: "bytes32";
1238
1502
  readonly name: "id_";
1239
1503
  readonly indexed: true;
1240
1504
  }, {
@@ -1256,16 +1520,7 @@ declare const MorphoV2: readonly [{
1256
1520
  readonly name: "sellerAssets";
1257
1521
  }, {
1258
1522
  readonly type: "uint256";
1259
- readonly name: "obligationUnits";
1260
- }, {
1261
- readonly type: "uint256";
1262
- readonly name: "obligationShares";
1263
- }, {
1264
- readonly type: "bool";
1265
- readonly name: "buyerIsLender";
1266
- }, {
1267
- readonly type: "bool";
1268
- readonly name: "sellerIsBorrower";
1523
+ readonly name: "units";
1269
1524
  }, {
1270
1525
  readonly type: "address";
1271
1526
  readonly name: "sellerReceiver";
@@ -1275,6 +1530,9 @@ declare const MorphoV2: readonly [{
1275
1530
  }, {
1276
1531
  readonly type: "uint256";
1277
1532
  readonly name: "consumed";
1533
+ }, {
1534
+ readonly type: "uint256";
1535
+ readonly name: "totalUnits";
1278
1536
  }];
1279
1537
  }, {
1280
1538
  readonly name: "Withdraw";
@@ -1283,15 +1541,12 @@ declare const MorphoV2: readonly [{
1283
1541
  readonly type: "address";
1284
1542
  readonly name: "caller";
1285
1543
  }, {
1286
- readonly type: "bytes20";
1544
+ readonly type: "bytes32";
1287
1545
  readonly name: "id_";
1288
1546
  readonly indexed: true;
1289
1547
  }, {
1290
1548
  readonly type: "uint256";
1291
- readonly name: "obligationUnits";
1292
- }, {
1293
- readonly type: "uint256";
1294
- readonly name: "shares";
1549
+ readonly name: "units";
1295
1550
  }, {
1296
1551
  readonly type: "address";
1297
1552
  readonly name: "onBehalf";
@@ -1308,7 +1563,7 @@ declare const MorphoV2: readonly [{
1308
1563
  readonly type: "address";
1309
1564
  readonly name: "caller";
1310
1565
  }, {
1311
- readonly type: "bytes20";
1566
+ readonly type: "bytes32";
1312
1567
  readonly name: "id_";
1313
1568
  readonly indexed: true;
1314
1569
  }, {
@@ -1630,7 +1885,8 @@ declare namespace Collateral_d_exports {
1630
1885
  }
1631
1886
  type Collateral = {
1632
1887
  /** Asset being used as collateral. */asset: Address; /** Liquidation Loan-to-Value of the collateral. */
1633
- lltv: LLTV; /** Oracle contract used to price the collateral. */
1888
+ lltv: LLTV; /** Maximum Liquidation Incentive Factor for this collateral. */
1889
+ maxLif: bigint; /** Oracle contract used to price the collateral. */
1634
1890
  oracle: Address;
1635
1891
  };
1636
1892
  declare const abi$1: readonly [{
@@ -1639,6 +1895,9 @@ declare const abi$1: readonly [{
1639
1895
  }, {
1640
1896
  readonly type: "uint256";
1641
1897
  readonly name: "lltv";
1898
+ }, {
1899
+ readonly type: "uint256";
1900
+ readonly name: "maxLif";
1642
1901
  }, {
1643
1902
  readonly type: "address";
1644
1903
  readonly name: "oracle";
@@ -1647,17 +1906,20 @@ declare const CollateralSchema: z$1.ZodObject<{
1647
1906
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1648
1907
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1649
1908
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
1909
+ maxLif: z$1.ZodBigInt;
1650
1910
  }, z$1.core.$strip>;
1651
1911
  declare const CollateralsSchema: z$1.ZodArray<z$1.ZodObject<{
1652
1912
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1653
1913
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1654
1914
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
1915
+ maxLif: z$1.ZodBigInt;
1655
1916
  }, z$1.core.$strip>>;
1656
1917
  declare const from$13: (parameters: from$13.Parameters) => from$13.ReturnType;
1657
1918
  declare namespace from$13 {
1658
1919
  type Parameters = {
1659
1920
  asset: Address;
1660
1921
  lltv: Options | bigint;
1922
+ maxLif: bigint;
1661
1923
  oracle: Address;
1662
1924
  };
1663
1925
  type ReturnType = Collateral;
@@ -1837,8 +2099,8 @@ declare namespace Obligation_d_exports {
1837
2099
  type Obligation$1 = {
1838
2100
  /** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
1839
2101
  collaterals: Collateral[]; /** The maturity of the obligation. */
1840
- maturity: Maturity; /** Minimum collateral value (quoted in loan token) to maintain on collateral updates. */
1841
- minCollatValue: bigint;
2102
+ maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
2103
+ rcfThreshold: bigint;
1842
2104
  };
1843
2105
  declare const ObligationSchema: z$1.ZodObject<{
1844
2106
  loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
@@ -1846,9 +2108,10 @@ declare const ObligationSchema: z$1.ZodObject<{
1846
2108
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1847
2109
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1848
2110
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
2111
+ maxLif: z$1.ZodBigInt;
1849
2112
  }, z$1.core.$strip>>;
1850
2113
  maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
1851
- minCollatValue: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2114
+ rcfThreshold: z$1.ZodBigInt;
1852
2115
  }, z$1.core.$strip>;
1853
2116
  declare const abi: readonly [{
1854
2117
  readonly type: "address";
@@ -1862,6 +2125,9 @@ declare const abi: readonly [{
1862
2125
  }, {
1863
2126
  readonly type: "uint256";
1864
2127
  readonly name: "lltv";
2128
+ }, {
2129
+ readonly type: "uint256";
2130
+ readonly name: "maxLif";
1865
2131
  }, {
1866
2132
  readonly type: "address";
1867
2133
  readonly name: "oracle";
@@ -1871,7 +2137,7 @@ declare const abi: readonly [{
1871
2137
  readonly name: "maturity";
1872
2138
  }, {
1873
2139
  readonly type: "uint256";
1874
- readonly name: "minCollatValue";
2140
+ readonly name: "rcfThreshold";
1875
2141
  }];
1876
2142
  declare const tupleAbi: readonly [{
1877
2143
  readonly type: "tuple";
@@ -1887,6 +2153,9 @@ declare const tupleAbi: readonly [{
1887
2153
  }, {
1888
2154
  readonly type: "uint256";
1889
2155
  readonly name: "lltv";
2156
+ }, {
2157
+ readonly type: "uint256";
2158
+ readonly name: "maxLif";
1890
2159
  }, {
1891
2160
  readonly type: "address";
1892
2161
  readonly name: "oracle";
@@ -1896,7 +2165,7 @@ declare const tupleAbi: readonly [{
1896
2165
  readonly name: "maturity";
1897
2166
  }, {
1898
2167
  readonly type: "uint256";
1899
- readonly name: "minCollatValue";
2168
+ readonly name: "rcfThreshold";
1900
2169
  }];
1901
2170
  }];
1902
2171
  /**
@@ -1914,10 +2183,12 @@ declare const tupleAbi: readonly [{
1914
2183
  * Collateral.from({
1915
2184
  * asset: privateKeyToAccount(generatePrivateKey()).address,
1916
2185
  * oracle: privateKeyToAccount(generatePrivateKey()).address,
1917
- * lltv: 0.965
2186
+ * lltv: 0.965,
2187
+ * maxLif: 0n,
1918
2188
  * }),
1919
2189
  * ],
1920
2190
  * maturity: Maturity.from("end_of_next_quarter"),
2191
+ * rcfThreshold: 0n,
1921
2192
  * });
1922
2193
  * ```
1923
2194
  */
@@ -1926,8 +2197,8 @@ declare namespace from$11 {
1926
2197
  type Parameters = {
1927
2198
  /** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
1928
2199
  collaterals: from$13.Parameters[] | readonly from$13.Parameters[]; /** The maturity of the obligation. */
1929
- maturity: from$12.Parameters; /** Minimum collateral value (quoted in loan token). @default 0 */
1930
- minCollatValue?: bigint;
2200
+ maturity: from$12.Parameters; /** Recovery-close-factor threshold in obligation units. */
2201
+ rcfThreshold: bigint;
1931
2202
  };
1932
2203
  type ReturnType = Obligation$1;
1933
2204
  type ErrorType = InvalidObligationError;
@@ -1940,17 +2211,14 @@ declare namespace from$11 {
1940
2211
  */
1941
2212
  declare function fromSnakeCase$2(input: fromSnakeCase$2.Parameters): fromSnakeCase$2.ReturnType;
1942
2213
  declare namespace fromSnakeCase$2 {
1943
- type SnakeCaseParameters = Omit<Obligation$1, "minCollatValue"> & {
1944
- minCollatValue?: bigint;
1945
- };
2214
+ type SnakeCaseParameters = Obligation$1;
1946
2215
  type Parameters = Snake<SnakeCaseParameters>;
1947
2216
  type ReturnType = Obligation$1;
1948
2217
  type ErrorType = InvalidObligationError;
1949
2218
  }
1950
2219
  /**
1951
2220
  * Calculates a canonical key for an obligation payload.
1952
- * The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity, minCollatValue)).
1953
- * If omitted, `minCollatValue` defaults to `0`.
2221
+ * The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity, rcfThreshold)).
1954
2222
  * @throws If the collaterals are not sorted alphabetically by address. {@link CollateralsAreNotSortedError}
1955
2223
  * @param parameters - {@link key.Parameters}
1956
2224
  * @returns The obligation key as a 32-byte hex string. {@link key.ReturnType}
@@ -1969,10 +2237,11 @@ declare namespace key$1 {
1969
2237
  collaterals: {
1970
2238
  asset: Address;
1971
2239
  lltv: bigint;
2240
+ maxLif: bigint;
1972
2241
  oracle: Address;
1973
2242
  }[];
1974
2243
  maturity: number;
1975
- minCollatValue?: bigint;
2244
+ rcfThreshold: bigint;
1976
2245
  };
1977
2246
  type ReturnType = Hex;
1978
2247
  type ErrorType = CollateralsAreNotSortedError;
@@ -1999,7 +2268,6 @@ declare namespace random$2 {
1999
2268
  */
2000
2269
  declare function fromOffer$1(offer: Offer): fromOffer$1.ReturnType;
2001
2270
  declare namespace fromOffer$1 {
2002
- type Parameters = Offer;
2003
2271
  type ReturnType = Obligation$1;
2004
2272
  }
2005
2273
  declare class InvalidObligationError extends BaseError<z$1.ZodError | Error> {
@@ -2033,11 +2301,10 @@ declare namespace creationCode {
2033
2301
  }
2034
2302
  /**
2035
2303
  * Computes the same id as `IdLib.toId` in Solidity using the CREATE2 preimage:
2036
- * `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))`,
2037
- * then truncates to the lower 20 bytes.
2304
+ * `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))`.
2038
2305
  *
2039
2306
  * @param parameters - {@link toId.Parameters}
2040
- * @returns The obligation id. {@link toId.ReturnType}
2307
+ * @returns The 32-byte obligation id. {@link toId.ReturnType}
2041
2308
  */
2042
2309
  declare function toId(parameters: toId.Parameters): toId.ReturnType;
2043
2310
  declare namespace toId {
@@ -2141,15 +2408,14 @@ declare function generateMarketLiquidityPoolId(parameters: {
2141
2408
  marketId: string;
2142
2409
  }): string;
2143
2410
  declare namespace Offer_d_exports {
2144
- export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, obligationId, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
2411
+ export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
2145
2412
  }
2146
2413
  type Offer = {
2147
- /** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
2148
- readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
2149
- readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
2150
- readonly obligationShares: bigint; /** The offer tick. */
2414
+ /** The address that made the offer. */readonly maker: Address; /** The max units to trade. */
2415
+ readonly maxUnits: bigint; /** The offer tick. */
2151
2416
  readonly tick: number; /** The date at which all interests will be paid. */
2152
- readonly maturity: Maturity; /** The date at which the offer will expire. */
2417
+ readonly maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
2418
+ readonly rcfThreshold: bigint; /** The date at which the offer will expire. */
2153
2419
  readonly expiry: number; /** The date at which the offer will start. */
2154
2420
  readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
2155
2421
  readonly group: Hex; /** The session. Used for session-based offer management. */
@@ -2161,7 +2427,8 @@ type Offer = {
2161
2427
  readonly address: Address;
2162
2428
  readonly data: Hex;
2163
2429
  }; /** Receiver of loan token proceeds when maker is seller on `take()`. */
2164
- readonly receiverIfMakerIsSeller: Address;
2430
+ readonly receiverIfMakerIsSeller: Address; /** Whether this offer can only reduce existing positions, not create new ones. */
2431
+ readonly exitOnly: boolean;
2165
2432
  };
2166
2433
  declare enum Status {
2167
2434
  VALID = "VALID",
@@ -2174,11 +2441,10 @@ type Validation = {
2174
2441
  };
2175
2442
  declare const OfferSchema: () => z$1.ZodObject<{
2176
2443
  maker: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2177
- assets: z$1.ZodBigInt;
2178
- obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2179
- obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2444
+ maxUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2180
2445
  tick: z$1.ZodCoercedNumber<unknown>;
2181
2446
  maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
2447
+ rcfThreshold: z$1.ZodBigInt;
2182
2448
  expiry: z$1.ZodNumber;
2183
2449
  start: z$1.ZodNumber;
2184
2450
  group: z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBigInt]>, z$1.ZodTransform<`0x${string}`, string | number | bigint>>;
@@ -2189,12 +2455,14 @@ declare const OfferSchema: () => z$1.ZodObject<{
2189
2455
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2190
2456
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2191
2457
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
2458
+ maxLif: z$1.ZodBigInt;
2192
2459
  }, z$1.core.$strip>>;
2193
2460
  callback: z$1.ZodObject<{
2194
2461
  address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2195
2462
  data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2196
2463
  }, z$1.core.$strip>;
2197
2464
  receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2465
+ exitOnly: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
2198
2466
  }, z$1.core.$strip>;
2199
2467
  /**
2200
2468
  * Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
@@ -2207,12 +2475,13 @@ declare const OfferSchema: () => z$1.ZodObject<{
2207
2475
  *
2208
2476
  * All values validated to be non-negative and within bytes32 range.
2209
2477
  */
2210
- type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "obligationShares" | "receiverIfMakerIsSeller"> & {
2478
+ type OfferInput = Compute<Omit<Offer, "group" | "session" | "maxUnits" | "rcfThreshold" | "receiverIfMakerIsSeller" | "exitOnly"> & {
2211
2479
  group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
2212
- session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
2213
- obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
2214
- obligationShares?: bigint; /** Optional: defaults to maker for backward compatibility. */
2215
- receiverIfMakerIsSeller?: Address;
2480
+ session?: Hex | bigint | number | string; /** Optional: defaults to 0n. */
2481
+ maxUnits?: bigint; /** Recovery-close-factor threshold in obligation units. */
2482
+ rcfThreshold: bigint; /** Optional: defaults to maker for backward compatibility. */
2483
+ receiverIfMakerIsSeller?: Address; /** Optional: defaults to false. */
2484
+ exitOnly?: boolean;
2216
2485
  }>;
2217
2486
  /**
2218
2487
  * Creates an offer from a plain object.
@@ -2249,11 +2518,10 @@ declare function toSnakeCase(offer: Offer): Snake<Offer>;
2249
2518
  */
2250
2519
  declare const serialize: (offer: Offer) => {
2251
2520
  maker: `0x${string}`;
2252
- assets: string;
2253
- obligationUnits: string;
2254
- obligationShares: string;
2521
+ maxUnits: string;
2255
2522
  tick: number;
2256
2523
  maturity: number;
2524
+ rcfThreshold: string;
2257
2525
  expiry: number;
2258
2526
  start: number;
2259
2527
  group: `0x${string}`;
@@ -2264,12 +2532,14 @@ declare const serialize: (offer: Offer) => {
2264
2532
  asset: `0x${string}`;
2265
2533
  oracle: `0x${string}`;
2266
2534
  lltv: string;
2535
+ maxLif: string;
2267
2536
  }[];
2268
2537
  callback: {
2269
2538
  address: `0x${string}`;
2270
2539
  data: `0x${string}`;
2271
2540
  };
2272
2541
  receiverIfMakerIsSeller: `0x${string}`;
2542
+ exitOnly: boolean;
2273
2543
  hash: `0x${string}`;
2274
2544
  };
2275
2545
  type RandomConfig = {
@@ -2277,11 +2547,10 @@ type RandomConfig = {
2277
2547
  collateralTokens?: Address[];
2278
2548
  assetsDecimals?: Record<Address, number>;
2279
2549
  buy?: boolean;
2280
- assets?: bigint;
2281
- obligationUnits?: bigint;
2282
- obligationShares?: bigint;
2550
+ maxUnits?: bigint;
2283
2551
  maker?: Address;
2284
2552
  maturity?: Maturity;
2553
+ rcfThreshold?: bigint;
2285
2554
  start?: number;
2286
2555
  expiry?: number;
2287
2556
  group?: Hex | bigint | number | string;
@@ -2293,6 +2562,7 @@ type RandomConfig = {
2293
2562
  };
2294
2563
  receiverIfMakerIsSeller?: Address;
2295
2564
  collaterals?: readonly Collateral[];
2565
+ exitOnly?: boolean;
2296
2566
  };
2297
2567
  /**
2298
2568
  * Generates a random Offer.
@@ -2309,21 +2579,6 @@ declare function random$1(config?: RandomConfig): Offer;
2309
2579
  * @returns 32-byte offer hash.
2310
2580
  */
2311
2581
  declare function hash(offer: Offer): Hex;
2312
- /**
2313
- * Calculates the onchain obligation id for an offer.
2314
- * The id is computed with {@link Id.toId}.
2315
- * @param offer - The offer to calculate the obligation id for.
2316
- * @param parameters - The chain context used by the onchain id function.
2317
- * @returns The obligation id as a 20-byte hex string.
2318
- */
2319
- declare function obligationId(offer: Offer, parameters: obligationId.Parameters): obligationId.ReturnType;
2320
- declare namespace obligationId {
2321
- type Parameters = {
2322
- chainId: Id;
2323
- morphoV2: Address;
2324
- };
2325
- type ReturnType = Hex;
2326
- }
2327
2582
  declare function encode$1(offer: Offer): `0x${string}`;
2328
2583
  declare function decode$1(data: Hex): Offer;
2329
2584
  type OfferConsumed = {
@@ -2347,9 +2602,9 @@ declare const takeEvent: {
2347
2602
  readonly internalType: "address";
2348
2603
  }, {
2349
2604
  readonly name: "id_";
2350
- readonly type: "bytes20";
2605
+ readonly type: "bytes32";
2351
2606
  readonly indexed: true;
2352
- readonly internalType: "bytes20";
2607
+ readonly internalType: "bytes32";
2353
2608
  }, {
2354
2609
  readonly name: "maker";
2355
2610
  readonly type: "address";
@@ -2376,25 +2631,10 @@ declare const takeEvent: {
2376
2631
  readonly indexed: false;
2377
2632
  readonly internalType: "uint256";
2378
2633
  }, {
2379
- readonly name: "obligationUnits";
2380
- readonly type: "uint256";
2381
- readonly indexed: false;
2382
- readonly internalType: "uint256";
2383
- }, {
2384
- readonly name: "obligationShares";
2634
+ readonly name: "units";
2385
2635
  readonly type: "uint256";
2386
2636
  readonly indexed: false;
2387
2637
  readonly internalType: "uint256";
2388
- }, {
2389
- readonly name: "buyerIsLender";
2390
- readonly type: "bool";
2391
- readonly indexed: false;
2392
- readonly internalType: "bool";
2393
- }, {
2394
- readonly name: "sellerIsBorrower";
2395
- readonly type: "bool";
2396
- readonly indexed: false;
2397
- readonly internalType: "bool";
2398
2638
  }, {
2399
2639
  readonly name: "sellerReceiver";
2400
2640
  readonly type: "address";
@@ -2410,17 +2650,27 @@ declare const takeEvent: {
2410
2650
  readonly type: "uint256";
2411
2651
  readonly indexed: false;
2412
2652
  readonly internalType: "uint256";
2653
+ }, {
2654
+ readonly name: "totalUnits";
2655
+ readonly type: "uint256";
2656
+ readonly indexed: false;
2657
+ readonly internalType: "uint256";
2413
2658
  }];
2414
2659
  readonly anonymous: false;
2415
2660
  };
2416
2661
  /**
2417
- * ABI for the Consume event emitted by the Obligation contract.
2662
+ * ABI for the SetConsumed event emitted by the Morpho V2 contract.
2418
2663
  */
2419
2664
  declare const consumedEvent: {
2420
2665
  readonly type: "event";
2421
- readonly name: "Consume";
2666
+ readonly name: "SetConsumed";
2422
2667
  readonly inputs: readonly [{
2423
- readonly name: "user";
2668
+ readonly name: "caller";
2669
+ readonly type: "address";
2670
+ readonly indexed: true;
2671
+ readonly internalType: "address";
2672
+ }, {
2673
+ readonly name: "onBehalf";
2424
2674
  readonly type: "address";
2425
2675
  readonly indexed: true;
2426
2676
  readonly internalType: "address";
@@ -2450,11 +2700,11 @@ declare const repayEvent: {
2450
2700
  readonly internalType: "address";
2451
2701
  }, {
2452
2702
  readonly name: "id_";
2453
- readonly type: "bytes20";
2703
+ readonly type: "bytes32";
2454
2704
  readonly indexed: true;
2455
- readonly internalType: "bytes20";
2705
+ readonly internalType: "bytes32";
2456
2706
  }, {
2457
- readonly name: "obligationUnits";
2707
+ readonly name: "units";
2458
2708
  readonly type: "uint256";
2459
2709
  readonly indexed: false;
2460
2710
  readonly internalType: "uint256";
@@ -2479,9 +2729,9 @@ declare const liquidateEvent: {
2479
2729
  readonly internalType: "address";
2480
2730
  }, {
2481
2731
  readonly name: "id_";
2482
- readonly type: "bytes20";
2732
+ readonly type: "bytes32";
2483
2733
  readonly indexed: true;
2484
- readonly internalType: "bytes20";
2734
+ readonly internalType: "bytes32";
2485
2735
  }, {
2486
2736
  readonly name: "collateralIndex";
2487
2737
  readonly type: "uint256";
@@ -2507,6 +2757,11 @@ declare const liquidateEvent: {
2507
2757
  readonly type: "uint256";
2508
2758
  readonly indexed: false;
2509
2759
  readonly internalType: "uint256";
2760
+ }, {
2761
+ readonly name: "latestLossIndex";
2762
+ readonly type: "uint256";
2763
+ readonly indexed: false;
2764
+ readonly internalType: "uint256";
2510
2765
  }];
2511
2766
  readonly anonymous: false;
2512
2767
  };
@@ -2523,9 +2778,9 @@ declare const supplyCollateralEvent: {
2523
2778
  readonly internalType: "address";
2524
2779
  }, {
2525
2780
  readonly name: "id_";
2526
- readonly type: "bytes20";
2781
+ readonly type: "bytes32";
2527
2782
  readonly indexed: true;
2528
- readonly internalType: "bytes20";
2783
+ readonly internalType: "bytes32";
2529
2784
  }, {
2530
2785
  readonly name: "collateral";
2531
2786
  readonly type: "address";
@@ -2557,9 +2812,9 @@ declare const withdrawCollateralEvent: {
2557
2812
  readonly internalType: "address";
2558
2813
  }, {
2559
2814
  readonly name: "id_";
2560
- readonly type: "bytes20";
2815
+ readonly type: "bytes32";
2561
2816
  readonly indexed: true;
2562
- readonly internalType: "bytes20";
2817
+ readonly internalType: "bytes32";
2563
2818
  }, {
2564
2819
  readonly name: "collateral";
2565
2820
  readonly type: "address";
@@ -2831,7 +3086,7 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
2831
3086
  constructor(error: z$1.ZodError | Error);
2832
3087
  }
2833
3088
  declare namespace Tick_d_exports {
2834
- export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
3089
+ export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, assetsToUnits, priceToTick, tickToPrice, unitsToAssets };
2835
3090
  }
2836
3091
  /** Tick domain supported by Morpho V2. */
2837
3092
  declare const TICK_RANGE = 990;
@@ -2857,6 +3112,31 @@ declare function priceToTick(price: bigint): number;
2857
3112
  declare namespace priceToTick {
2858
3113
  type ErrorType = InvalidPriceError;
2859
3114
  }
3115
+ /**
3116
+ * Converts units into maker-side assets using the raw tick price surface.
3117
+ * This is the public forward conversion used by the router for lot sizing and other maker-facing capacity math.
3118
+ * - `buy = true` -> `floor(units * price / WAD)`
3119
+ * - `buy = false` -> `ceil(units * price / WAD)`
3120
+ * @param units - The units to convert.
3121
+ * @param tick - The offer tick.
3122
+ * @param buy - Whether the maker side of the offer is buy (`true`) or sell (`false`).
3123
+ * @returns The equivalent amount in maker-side assets.
3124
+ */
3125
+ declare function unitsToAssets(units: bigint, tick: number, buy: boolean): bigint;
3126
+ /**
3127
+ * Converts a maker-side asset cap into a safe units cap using the raw tick price.
3128
+ * Buy offers use the max-safe inverse of `floor(units * price / WAD)`.
3129
+ * Sell offers use the max-safe inverse of `ceil(units * price / WAD)`.
3130
+ * The result is clamped to the remaining offer size because the asset cap may have been rounded before inversion.
3131
+ * Zero integer asset caps can still admit positive units on floor-rounded sub-WAD buy ticks, and tick=0 keeps the
3132
+ * whole remaining interval safe because the raw maker-asset surface stays at zero.
3133
+ * @param assets - The integer maker-side asset cap.
3134
+ * @param tick - The offer tick.
3135
+ * @param buy - Whether the maker side of the offer is buy (`true`) or sell (`false`).
3136
+ * @param remainingUnits - The maximum units still available on the offer.
3137
+ * @returns The greatest safe units amount under the maker-side raw-price surface.
3138
+ */
3139
+ declare function assetsToUnits(assets: bigint, tick: number, buy: boolean, remainingUnits: bigint): bigint;
2860
3140
  declare class InvalidTickError extends BaseError {
2861
3141
  readonly name = "Tick.InvalidTickError";
2862
3142
  constructor(tick: number);
@@ -2870,15 +3150,15 @@ declare namespace TradingFee_d_exports {
2870
3150
  }
2871
3151
  /**
2872
3152
  * Time breakpoints in seconds for piecewise linear fee interpolation.
2873
- * Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d.
3153
+ * Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d, 360d.
2874
3154
  */
2875
- declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n];
3155
+ declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n, 31104000n];
2876
3156
  /** WAD constant (1e18) for fee scaling. */
2877
3157
  declare const WAD: bigint;
2878
- /** Tuple type for the 6 fee values at each breakpoint. */
2879
- type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint];
3158
+ /** Tuple type for the 7 fee values at each breakpoint. */
3159
+ type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint];
2880
3160
  /**
2881
- * TradingFee represents a piecewise linear fee curve with 6 breakpoints.
3161
+ * TradingFee represents a piecewise linear fee curve with 7 breakpoints.
2882
3162
  * The internal storage mimics on-chain bitmap behavior but uses a struct for clarity.
2883
3163
  */
2884
3164
  type TradingFee = {
@@ -2886,12 +3166,12 @@ type TradingFee = {
2886
3166
  readonly _fees: Fees;
2887
3167
  } & Brand<"TradingFee">;
2888
3168
  /**
2889
- * Create a TradingFee from an activation flag and 6 fee values.
3169
+ * Create a TradingFee from an activation flag and 7 fee values.
2890
3170
  * @param activated - Whether the fee is active.
2891
- * @param fees - Tuple of 6 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d).
3171
+ * @param fees - Tuple of 7 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d, 360d).
2892
3172
  * @returns A new TradingFee instance.
2893
3173
  * @throws {@link InvalidFeeError} if any fee exceeds WAD (100%).
2894
- * @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 6 elements.
3174
+ * @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 7 elements.
2895
3175
  */
2896
3176
  declare function from$6(activated: boolean, fees: Fees): TradingFee;
2897
3177
  declare namespace from$6 {
@@ -2925,7 +3205,7 @@ declare function deactivate(tradingFee: TradingFee): TradingFee;
2925
3205
  /**
2926
3206
  * Get the fee values at each breakpoint.
2927
3207
  * @param tradingFee - The TradingFee instance.
2928
- * @returns The tuple of 6 fee values.
3208
+ * @returns The tuple of 7 fee values.
2929
3209
  */
2930
3210
  declare function getFees(tradingFee: TradingFee): Fees;
2931
3211
  /** Error thrown when a fee value is invalid (negative or exceeds WAD). */
@@ -2933,7 +3213,7 @@ declare class InvalidFeeError extends BaseError {
2933
3213
  readonly name = "TradingFee.InvalidFeeError";
2934
3214
  constructor(fee: bigint, index: number);
2935
3215
  }
2936
- /** Error thrown when fees array doesn't have exactly 6 elements. */
3216
+ /** Error thrown when fees array doesn't have exactly 7 elements. */
2937
3217
  declare class InvalidFeesLengthError extends BaseError {
2938
3218
  readonly name = "TradingFee.InvalidFeesLengthError";
2939
3219
  constructor(length: number);
@@ -2980,13 +3260,13 @@ declare namespace from$5 {
2980
3260
  type ReturnType = Transfer;
2981
3261
  }
2982
3262
  declare namespace Tree_d_exports {
2983
- export { DecodeError, EncodeError, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION, decode, encode, encodeUnsigned, from$4 as from, proofs, signatureDomain, signatureTypes };
3263
+ export { DecodeError, EncodeError, MAX_COMPRESSED_OFFERS_BYTES, MAX_DECOMPRESSED_OFFERS_BYTES, MAX_OFFERS_PER_TREE, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION, decode, encode, encodeUnsigned, from$4 as from, proofs, signatureDomain, signatureTypes };
2984
3264
  }
2985
3265
  /**
2986
3266
  * A merkle tree of offers built from offer hashes.
2987
3267
  * Constructed via {@link from}. The tree root can be signed for onchain broadcast.
2988
3268
  */
2989
- type Tree = Compute<StandardMerkleTree<[Hex]> & {
3269
+ type Tree = Compute<SimpleMerkleTree & {
2990
3270
  /** The offers in the tree. */offers: Offer[]; /** The root of the tree. */
2991
3271
  root: Hex;
2992
3272
  }>;
@@ -2994,7 +3274,10 @@ type Proof = {
2994
3274
  /** The offer that the proof is for. */offer: Offer; /** The merkle proof path for the offer. */
2995
3275
  path: Hex[];
2996
3276
  };
2997
- declare const VERSION = 1;
3277
+ declare const VERSION = 2;
3278
+ declare const MAX_COMPRESSED_OFFERS_BYTES = 1000000;
3279
+ declare const MAX_DECOMPRESSED_OFFERS_BYTES = 4000000;
3280
+ declare const MAX_OFFERS_PER_TREE = 100;
2998
3281
  type SignatureDomain = {
2999
3282
  /** Chain id used in the EIP-712 domain. */chainId: number | bigint; /** MorphoV2 contract address used as verifying contract. */
3000
3283
  verifyingContract: Address;
@@ -3024,11 +3307,10 @@ declare const signatureTypes: {
3024
3307
  * Builds a Merkle tree from a list of offers.
3025
3308
  *
3026
3309
  * Leaves are the offer `hash` values as `bytes32` and are deterministically
3027
- * ordered following the StandardMerkleTree leaf ordering so that the resulting
3028
- * root is stable regardless of the input order.
3310
+ * ordered so that the resulting root is stable regardless of the input order.
3029
3311
  *
3030
3312
  * @param offers - Offers to include in the tree.
3031
- * @returns A `StandardMerkleTree` of `bytes32` leaves representing the offers.
3313
+ * @returns A `SimpleMerkleTree` of offer hashes representing the offers.
3032
3314
  * @throws {TreeError} If tree building fails due to offer inconsistencies.
3033
3315
  */
3034
3316
  declare const from$4: (offers: Offer[]) => Tree;
@@ -3036,7 +3318,7 @@ declare const from$4: (offers: Offer[]) => Tree;
3036
3318
  * Generates merkle proofs for all offers in a tree.
3037
3319
  *
3038
3320
  * Each proof allows independent verification that an offer is included in the tree
3039
- * without requiring the full tree. Proofs are ordered by StandardMerkleTree leaf ordering.
3321
+ * without requiring the full tree.
3040
3322
  *
3041
3323
  * @param tree - The {@link Tree} to generate proofs for.
3042
3324
  * @returns Array of proofs - {@link Proof}
@@ -3117,10 +3399,11 @@ declare const encodeUnsigned: (tree: Tree) => Hex;
3117
3399
  * Returns the tree with separately validated signature and recovered signer address.
3118
3400
  *
3119
3401
  * Validation order:
3120
- * 1. Version check
3402
+ * 1. Version and static size checks
3121
3403
  * 2. Signature verification (fail-fast, before decompression)
3122
- * 3. Decompression (only if signature valid)
3123
- * 4. Root verification (computed from offers vs embedded root)
3404
+ * 3. Streaming decompression with byte cap
3405
+ * 4. JSON array + offer count checks
3406
+ * 5. Root verification (computed from offers vs embedded root)
3124
3407
  *
3125
3408
  * @example
3126
3409
  * ```typescript
@@ -3826,7 +4109,7 @@ interface components {
3826
4109
  * @example 500000000000000000
3827
4110
  */
3828
4111
  price: string; /** @example 369216000000000000000000 */
3829
- assets: string; /** @example 5 */
4112
+ max_units: string; /** @example 5 */
3830
4113
  count: number;
3831
4114
  };
3832
4115
  BadRequestResponse: {
@@ -3944,16 +4227,16 @@ interface components {
3944
4227
  * {
3945
4228
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
3946
4229
  * "lltv": "860000000000000000",
4230
+ * "max_lif": "0",
3947
4231
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
3948
4232
  * }
3949
4233
  * ],
3950
- * "maturity": 1761922799
4234
+ * "maturity": 1761922799,
4235
+ * "rcf_threshold": "0"
3951
4236
  * },
3952
4237
  * "buy": false,
3953
4238
  * "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
3954
- * "assets": "369216000000000000000000",
3955
- * "obligation_units": "0",
3956
- * "obligation_shares": "0",
4239
+ * "max_units": "369216000000000000000000",
3957
4240
  * "start": 1761922790,
3958
4241
  * "expiry": 1761922799,
3959
4242
  * "tick": 495,
@@ -3961,7 +4244,8 @@ interface components {
3961
4244
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
3962
4245
  * "callback": "0x0000000000000000000000000000000000000000",
3963
4246
  * "callback_data": "0x",
3964
- * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
4247
+ * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4248
+ * "exit_only": false
3965
4249
  * },
3966
4250
  * "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
3967
4251
  * "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf79",
@@ -3989,16 +4273,16 @@ interface components {
3989
4273
  * {
3990
4274
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
3991
4275
  * "lltv": "860000000000000000",
4276
+ * "max_lif": "0",
3992
4277
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
3993
4278
  * }
3994
4279
  * ],
3995
- * "maturity": 1761922799
4280
+ * "maturity": 1761922799,
4281
+ * "rcf_threshold": "0"
3996
4282
  * },
3997
4283
  * "buy": false,
3998
4284
  * "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
3999
- * "assets": "369216000000000000000000",
4000
- * "obligation_units": "0",
4001
- * "obligation_shares": "0",
4285
+ * "max_units": "369216000000000000000000",
4002
4286
  * "start": 1761922790,
4003
4287
  * "expiry": 1761922799,
4004
4288
  * "tick": 495,
@@ -4006,7 +4290,8 @@ interface components {
4006
4290
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
4007
4291
  * "callback": "0x0000000000000000000000000000000000000000",
4008
4292
  * "callback_data": "0x",
4009
- * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
4293
+ * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4294
+ * "exit_only": false
4010
4295
  * }
4011
4296
  */
4012
4297
  offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
@@ -4034,18 +4319,18 @@ interface components {
4034
4319
  * {
4035
4320
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4036
4321
  * "lltv": "860000000000000000",
4322
+ * "max_lif": "0",
4037
4323
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4038
4324
  * }
4039
4325
  * ],
4040
- * "maturity": 1761922799
4326
+ * "maturity": 1761922799,
4327
+ * "rcf_threshold": "0"
4041
4328
  * }
4042
4329
  */
4043
4330
  obligation: components["schemas"]["ObligationOfferResponse"]; /** @example false */
4044
4331
  buy: boolean; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
4045
4332
  maker: string; /** @example 369216000000000000000000 */
4046
- assets: string; /** @example 0 */
4047
- obligation_units: string; /** @example 0 */
4048
- obligation_shares: string; /** @example 1761922790 */
4333
+ max_units: string; /** @example 1761922790 */
4049
4334
  start: number; /** @example 1761922799 */
4050
4335
  expiry: number; /** @example 495 */
4051
4336
  tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
@@ -4053,7 +4338,8 @@ interface components {
4053
4338
  session: string; /** @example 0x0000000000000000000000000000000000000000 */
4054
4339
  callback: string; /** @example 0x */
4055
4340
  callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
4056
- receiver_if_maker_is_seller: string;
4341
+ receiver_if_maker_is_seller: string; /** @example false */
4342
+ exit_only: boolean;
4057
4343
  };
4058
4344
  ObligationOfferResponse: {
4059
4345
  /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
@@ -4062,16 +4348,19 @@ interface components {
4062
4348
  * {
4063
4349
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4064
4350
  * "lltv": "860000000000000000",
4351
+ * "max_lif": "0",
4065
4352
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4066
4353
  * }
4067
4354
  * ]
4068
4355
  */
4069
4356
  collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922799 */
4070
- maturity: number;
4357
+ maturity: number; /** @example 0 */
4358
+ rcf_threshold: string;
4071
4359
  };
4072
4360
  CollateralResponse: {
4073
4361
  /** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */token: string; /** @example 860000000000000000 */
4074
- lltv: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
4362
+ lltv: string; /** @example 0 */
4363
+ max_lif: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
4075
4364
  oracle: string;
4076
4365
  };
4077
4366
  ObligationListResponse: {
@@ -4084,7 +4373,8 @@ interface components {
4084
4373
  chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
4085
4374
  loan_token: string;
4086
4375
  collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922800 */
4087
- maturity: number;
4376
+ maturity: number; /** @example 0 */
4377
+ rcf_threshold: string;
4088
4378
  ask: components["schemas"]["AskResponse"];
4089
4379
  bid: components["schemas"]["BidResponse"];
4090
4380
  };
@@ -4208,7 +4498,7 @@ interface components {
4208
4498
  * "chain_id": 1,
4209
4499
  * "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
4210
4500
  * "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4211
- * "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf79",
4501
+ * "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
4212
4502
  * "reserved": "200000000000000000000",
4213
4503
  * "block_number": 21345678
4214
4504
  * }
@@ -4222,7 +4512,7 @@ interface components {
4222
4512
  user: string;
4223
4513
  /**
4224
4514
  * @description Obligation id this reserved amount belongs to, or null if no lots exist.
4225
- * @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf79
4515
+ * @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67
4226
4516
  */
4227
4517
  obligation_id: string | null; /** @example 200000000000000000000 */
4228
4518
  reserved: string; /** @example 21345678 */
@@ -4238,11 +4528,10 @@ interface components {
4238
4528
  };
4239
4529
  ValidateOfferRequest: {
4240
4530
  /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
4241
- assets: string; /** @example 0 */
4242
- obligation_units?: string; /** @example 0 */
4243
- obligation_shares?: string; /** @example 495 */
4531
+ max_units?: string; /** @example 495 */
4244
4532
  tick: number; /** @example 1761922799 */
4245
- maturity: number; /** @example 1761922799 */
4533
+ maturity: number; /** @example 0 */
4534
+ rcf_threshold: string; /** @example 1761922799 */
4246
4535
  expiry: number; /** @example 1761922790 */
4247
4536
  start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
4248
4537
  group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
@@ -4254,7 +4543,8 @@ interface components {
4254
4543
  * {
4255
4544
  * "asset": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4256
4545
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
4257
- * "lltv": "860000000000000000"
4546
+ * "lltv": "860000000000000000",
4547
+ * "max_lif": "0"
4258
4548
  * }
4259
4549
  * ]
4260
4550
  */
@@ -4266,12 +4556,14 @@ interface components {
4266
4556
  * }
4267
4557
  */
4268
4558
  callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
4269
- receiver_if_maker_is_seller: string;
4559
+ receiver_if_maker_is_seller: string; /** @example false */
4560
+ exit_only?: boolean;
4270
4561
  };
4271
4562
  ValidateCollateralRequest: {
4272
4563
  /** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
4273
4564
  oracle: string; /** @example 860000000000000000 */
4274
- lltv: string;
4565
+ lltv: string; /** @example 0 */
4566
+ max_lif: string;
4275
4567
  };
4276
4568
  ValidateCallbackRequest: {
4277
4569
  /** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
@@ -4322,11 +4614,10 @@ type Input = Readonly<{
4322
4614
  hash: Hex;
4323
4615
  obligationId: Hex;
4324
4616
  maker: Address;
4325
- assets: bigint;
4326
- obligationUnits: bigint;
4327
- obligationShares: bigint;
4617
+ maxUnits: bigint;
4328
4618
  tick: number;
4329
4619
  maturity: number;
4620
+ rcfThreshold: bigint;
4330
4621
  expiry: number;
4331
4622
  start: number;
4332
4623
  group: Hex;
@@ -4337,6 +4628,7 @@ type Input = Readonly<{
4337
4628
  collaterals: Readonly<{
4338
4629
  asset: Address;
4339
4630
  lltv: bigint;
4631
+ maxLif: bigint;
4340
4632
  oracle: Address;
4341
4633
  }[]>;
4342
4634
  callback: {
@@ -4344,6 +4636,7 @@ type Input = Readonly<{
4344
4636
  data: Hex;
4345
4637
  };
4346
4638
  receiverIfMakerIsSeller: Address;
4639
+ exitOnly: boolean;
4347
4640
  root?: Hex | undefined;
4348
4641
  proof?: Hex[] | undefined;
4349
4642
  signature?: Hex | undefined;
@@ -4406,8 +4699,9 @@ type GroupsDomain = {
4406
4699
  /**
4407
4700
  * Insert groups (insert-only).
4408
4701
  * @param groups - Groups to insert. {@link GroupInput}
4702
+ * @returns Number of group rows inserted.
4409
4703
  */
4410
- create: (groups: GroupInput[]) => Promise<void>;
4704
+ create: (groups: GroupInput[]) => Promise<number>;
4411
4705
  /**
4412
4706
  * Check which groups already exist in the database.
4413
4707
  * @param groups - Group keys to check. {@link GroupKey}
@@ -4902,7 +5196,7 @@ declare const morphoRules: (parameters: {
4902
5196
  };
4903
5197
  }) => Rule<Offer, string>[];
4904
5198
  declare namespace Rules_d_exports {
4905
- export { amountMutualExclusivity, callback, collateralToken, groupConsistency, groupImmutability, loanToken, maturity, maxCollaterals, minDuration, oracle, sameMaker };
5199
+ export { amountNonZero, callback, collateralToken, groupConsistency, groupImmutability, loanToken, maturity, maxCollaterals, minDuration, oracle, sameMaker };
4906
5200
  }
4907
5201
  declare const maturity: ({
4908
5202
  maturities
@@ -4957,11 +5251,6 @@ declare const oracle: ({
4957
5251
  * This rule is signing-agnostic; signer verification is handled at the collector level.
4958
5252
  */
4959
5253
  declare const sameMaker: () => Rule<Offer, "mixed_maker">;
4960
- /**
4961
- * A validation rule that ensures mutual exclusivity of offer amount fields.
4962
- * At most one of (assets, obligationUnits, obligationShares) can be non-zero.
4963
- * Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
4964
- */
4965
5254
  /**
4966
5255
  * A validation rule that checks if the offer duration (expiry - start) meets a minimum threshold.
4967
5256
  * @param minSeconds - Minimum required duration in seconds.
@@ -4983,10 +5272,16 @@ declare const maxCollaterals: ({
4983
5272
  }: {
4984
5273
  max: number;
4985
5274
  }) => Rule<Offer, "max_collaterals">;
4986
- declare const amountMutualExclusivity: () => Rule<Offer, "amount_mutual_exclusivity">;
5275
+ /**
5276
+ * A validation rule that checks if the offer's maxUnits is non-zero.
5277
+ * The contract requires a positive amount; this rule rejects early.
5278
+ * @returns The issue that was found. If the offer is valid, this will be undefined.
5279
+ */
5280
+ declare const amountNonZero: () => Rule<Offer, "amount_non_zero">;
4987
5281
  /**
4988
5282
  * A batch validation rule that ensures all offers within the same group are consistent.
4989
- * All offers sharing the same group must have the same loan token, assets amount, and side (buy/sell).
5283
+ * All offers sharing the same group must have the same loan token, maxUnits,
5284
+ * and side (buy/sell). The contract tracks consumed per group and requires these to match.
4990
5285
  */
4991
5286
  declare const groupConsistency: () => Rule<Offer, "group_consistency">;
4992
5287
  /**
@@ -5130,6 +5425,20 @@ declare function lazy<T>(pollFn: (emit: (value: T) => void, {
5130
5425
  stop: () => void;
5131
5426
  }) => () => boolean): () => AsyncGenerator<Awaited<NonNullable<T>>, void, unknown>;
5132
5427
  //#endregion
5428
+ //#region src/utils/mapWithConcurrency.d.ts
5429
+ /**
5430
+ * Map values with a bounded number of concurrent async workers.
5431
+ *
5432
+ * Result ordering always matches the input order.
5433
+ * @param parameters - Input values, concurrency limit, and async mapper.
5434
+ * @returns Mapped results in input order.
5435
+ */
5436
+ declare function mapWithConcurrency<value, result>(parameters: {
5437
+ values: value[];
5438
+ limit: number;
5439
+ run: (value: value, index: number) => Promise<result>;
5440
+ }): Promise<result[]>;
5441
+ //#endregion
5133
5442
  //#region src/utils/poll.d.ts
5134
5443
  /**
5135
5444
  * Polls a function at a specified interval.
@@ -5145,8 +5454,19 @@ declare function poll<data>(fn: ({
5145
5454
  interval: () => Promise<number>;
5146
5455
  }): () => boolean;
5147
5456
  declare namespace Random_d_exports {
5148
- export { address, bool, bytes, float, hex, int, seed, withSeed };
5457
+ export { SeededRng, address, bool, bytes, createRng, float, hex, int, seed, withSeed };
5458
+ }
5459
+ /** Isolated RNG instance with convenience methods. */
5460
+ interface SeededRng {
5461
+ float(): number;
5462
+ int(maxExclusive: number, min?: number): number;
5463
+ bool(probability?: number): boolean;
5149
5464
  }
5465
+ /**
5466
+ * Creates an isolated seeded RNG instance — safe for concurrent use.
5467
+ * @param seed - Seed string used to derive the initial RNG state.
5468
+ */
5469
+ declare function createRng(seed: string): SeededRng;
5150
5470
  /**
5151
5471
  * Runs a function with a deterministic RNG derived from the given seed.
5152
5472
  */
@@ -5188,10 +5508,19 @@ declare namespace time_d_exports {
5188
5508
  declare function now(): number;
5189
5509
  declare function max$1(): number;
5190
5510
  //#endregion
5511
+ //#region src/utils/trim.d.ts
5512
+ /**
5513
+ * Keep the last `keep` entries from an array.
5514
+ * @param array - Source array.
5515
+ * @param keep - Number of entries to keep.
5516
+ * @returns Trimmed copy.
5517
+ */
5518
+ declare const trimTail: <entry>(array: readonly entry[], keep: number) => entry[];
5519
+ //#endregion
5191
5520
  //#region src/utils/wait.d.ts
5192
5521
  declare function wait(time: number): Promise<unknown>;
5193
5522
  declare namespace index_d_exports$2 {
5194
- export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, max$2 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
5523
+ export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, mapWithConcurrency, max$2 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, trimTail, wait };
5195
5524
  }
5196
5525
  //#endregion
5197
5526
  export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainRegistry_d_exports as ChainRegistry, Collateral_d_exports as Collateral, Compute, ConfigRule, ConfigRulesPayload, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, Id_d_exports as Id, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Maturity_d_exports as Maturity, MempoolClient_d_exports as Mempool, Obligation_d_exports as Obligation, Offer_d_exports as Offer, Oracle_d_exports as Oracle, Position_d_exports as Position, Quote_d_exports as Quote, index_d_exports$1 as RouterApi, Client_d_exports$1 as RouterClient, Rules_d_exports as Rules, SuccessPayload, Tick_d_exports as Tick, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, index_d_exports$2 as Utils, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules };