@morpho-dev/router 0.7.1 → 0.8.0

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 (70) hide show
  1. package/dist/cli.js +441 -141
  2. package/dist/drizzle/migrations/0000_setup_single_migration_folder.sql +64 -64
  3. package/dist/drizzle/migrations/0001_add-trigger-for-consumed-events.sql +5 -5
  4. package/dist/drizzle/migrations/0002_insert-status-code.sql +1 -1
  5. package/dist/drizzle/migrations/0003_update-triggers-for-consumed-events.sql +1 -1
  6. package/dist/drizzle/migrations/0004_drop-status-offers-foreign-key-constraint.sql +1 -1
  7. package/dist/drizzle/migrations/0005_add-index-to-boost-group-query-and-offer-hash.sql +1 -1
  8. package/dist/drizzle/migrations/0006_add-callbacks-and-positions-relations.sql +11 -11
  9. package/dist/drizzle/migrations/0008_validation.sql +10 -10
  10. package/dist/drizzle/migrations/0009_add-transfers-table.sql +4 -4
  11. package/dist/drizzle/migrations/0010_add-price.sql +1 -1
  12. package/dist/drizzle/migrations/0011_nullable-callback-amount.sql +1 -1
  13. package/dist/drizzle/migrations/0012_add-position-asset.sql +1 -1
  14. package/dist/drizzle/migrations/0013_remove-depecrated-domains.sql +13 -13
  15. package/dist/drizzle/migrations/0014_rename-offers-v2-into-offers.sql +19 -19
  16. package/dist/drizzle/migrations/0015_add-lots-table.sql +3 -3
  17. package/dist/drizzle/migrations/0016_merkle-metadata.sql +7 -7
  18. package/dist/drizzle/migrations/0017_dusty_the_hunter.sql +1 -1
  19. package/dist/drizzle/migrations/0018_add_chain_collector_constraints.sql +3 -3
  20. package/dist/drizzle/migrations/0019_add-obligation-units-shares.sql +2 -2
  21. package/dist/drizzle/migrations/0020_add-session.sql +1 -1
  22. package/dist/drizzle/migrations/0021_drop_chain_collector_epoch_indexes.sql +2 -2
  23. package/dist/drizzle/migrations/0021_migrate-rate-to-price.sql +6 -6
  24. package/dist/drizzle/migrations/0022_consolidate-price.sql +5 -5
  25. package/dist/drizzle/migrations/0023_remove-block-number-for-collaterals.sql +1 -1
  26. package/dist/drizzle/migrations/0024_add-obligation-id-to-lots.sql +8 -0
  27. package/dist/drizzle/migrations/0025_rename-price-to-tick.sql +202 -0
  28. package/dist/drizzle/migrations/meta/0000_snapshot.json +48 -48
  29. package/dist/drizzle/migrations/meta/0001_snapshot.json +48 -48
  30. package/dist/drizzle/migrations/meta/0002_snapshot.json +48 -48
  31. package/dist/drizzle/migrations/meta/0003_snapshot.json +48 -48
  32. package/dist/drizzle/migrations/meta/0004_snapshot.json +47 -47
  33. package/dist/drizzle/migrations/meta/0005_snapshot.json +47 -47
  34. package/dist/drizzle/migrations/meta/0006_snapshot.json +61 -61
  35. package/dist/drizzle/migrations/meta/0008_snapshot.json +62 -62
  36. package/dist/drizzle/migrations/meta/0009_snapshot.json +66 -66
  37. package/dist/drizzle/migrations/meta/0010_snapshot.json +66 -66
  38. package/dist/drizzle/migrations/meta/0013_snapshot.json +48 -48
  39. package/dist/drizzle/migrations/meta/0014_snapshot.json +48 -48
  40. package/dist/drizzle/migrations/meta/0015_snapshot.json +52 -52
  41. package/dist/drizzle/migrations/meta/0016_snapshot.json +61 -61
  42. package/dist/drizzle/migrations/meta/0017_snapshot.json +61 -61
  43. package/dist/drizzle/migrations/meta/0018_snapshot.json +62 -62
  44. package/dist/drizzle/migrations/meta/0019_snapshot.json +62 -62
  45. package/dist/drizzle/migrations/meta/0023_snapshot.json +62 -62
  46. package/dist/drizzle/migrations/meta/0024_snapshot.json +1448 -0
  47. package/dist/drizzle/migrations/meta/0025_snapshot.json +1448 -0
  48. package/dist/drizzle/migrations/meta/_journal.json +14 -0
  49. package/dist/evm/bytecode/erc20.txt +1 -1
  50. package/dist/evm/bytecode/morpho.txt +1 -1
  51. package/dist/evm/bytecode/multicall3.txt +1 -1
  52. package/dist/evm/bytecode/oracle.txt +1 -1
  53. package/dist/evm/bytecode/vault.txt +1 -1
  54. package/dist/index.browser.d.mts +1157 -81
  55. package/dist/index.browser.d.mts.map +1 -1
  56. package/dist/index.browser.d.ts +1157 -81
  57. package/dist/index.browser.d.ts.map +1 -1
  58. package/dist/index.browser.js +371 -151
  59. package/dist/index.browser.js.map +1 -1
  60. package/dist/index.browser.mjs +366 -152
  61. package/dist/index.browser.mjs.map +1 -1
  62. package/dist/index.node.d.mts +1196 -70
  63. package/dist/index.node.d.mts.map +1 -1
  64. package/dist/index.node.d.ts +1196 -70
  65. package/dist/index.node.d.ts.map +1 -1
  66. package/dist/index.node.js +491 -145
  67. package/dist/index.node.js.map +1 -1
  68. package/dist/index.node.mjs +486 -146
  69. package/dist/index.node.mjs.map +1 -1
  70. package/package.json +1 -1
@@ -149,8 +149,1014 @@ declare const MetaMorphoFactory: readonly [{
149
149
  }];
150
150
  }];
151
151
  type MetaMorphoFactory = typeof MetaMorphoFactory;
152
+ //#endregion
153
+ //#region src/core/Abi/MorphoV2.d.ts
154
+ declare const MorphoV2: readonly [{
155
+ readonly type: "constructor";
156
+ readonly stateMutability: "nonpayable";
157
+ readonly inputs: readonly [];
158
+ }, {
159
+ readonly name: "collateralOf";
160
+ readonly type: "function";
161
+ readonly stateMutability: "view";
162
+ readonly inputs: readonly [{
163
+ readonly type: "bytes32";
164
+ readonly name: "id";
165
+ }, {
166
+ readonly type: "address";
167
+ readonly name: "user";
168
+ }, {
169
+ readonly type: "address";
170
+ readonly name: "collateralToken";
171
+ }];
172
+ readonly outputs: readonly [{
173
+ readonly type: "uint256";
174
+ }];
175
+ }, {
176
+ readonly name: "consume";
177
+ readonly type: "function";
178
+ readonly stateMutability: "nonpayable";
179
+ readonly inputs: readonly [{
180
+ readonly type: "bytes32";
181
+ readonly name: "group";
182
+ }, {
183
+ readonly type: "uint256";
184
+ readonly name: "amount";
185
+ }];
186
+ readonly outputs: readonly [];
187
+ }, {
188
+ readonly name: "consumed";
189
+ readonly type: "function";
190
+ readonly stateMutability: "view";
191
+ readonly inputs: readonly [{
192
+ readonly type: "address";
193
+ readonly name: "user";
194
+ }, {
195
+ readonly type: "bytes32";
196
+ readonly name: "group";
197
+ }];
198
+ readonly outputs: readonly [{
199
+ readonly type: "uint256";
200
+ }];
201
+ }, {
202
+ readonly name: "debtOf";
203
+ readonly type: "function";
204
+ readonly stateMutability: "view";
205
+ readonly inputs: readonly [{
206
+ readonly type: "bytes32";
207
+ readonly name: "id";
208
+ }, {
209
+ readonly type: "address";
210
+ readonly name: "user";
211
+ }];
212
+ readonly outputs: readonly [{
213
+ readonly type: "uint256";
214
+ }];
215
+ }, {
216
+ readonly name: "defaultFees";
217
+ readonly type: "function";
218
+ readonly stateMutability: "view";
219
+ readonly inputs: readonly [{
220
+ readonly type: "address";
221
+ readonly name: "loanToken";
222
+ }, {
223
+ readonly type: "uint256";
224
+ readonly name: "index";
225
+ }];
226
+ readonly outputs: readonly [{
227
+ readonly type: "uint16";
228
+ }];
229
+ }, {
230
+ readonly name: "feeSetter";
231
+ readonly type: "function";
232
+ readonly stateMutability: "view";
233
+ readonly inputs: readonly [];
234
+ readonly outputs: readonly [{
235
+ readonly type: "address";
236
+ }];
237
+ }, {
238
+ readonly name: "fees";
239
+ readonly type: "function";
240
+ readonly stateMutability: "view";
241
+ readonly inputs: readonly [{
242
+ readonly type: "bytes32";
243
+ readonly name: "id";
244
+ }];
245
+ readonly outputs: readonly [{
246
+ readonly type: "uint16[6]";
247
+ }];
248
+ }, {
249
+ readonly name: "flashLoan";
250
+ readonly type: "function";
251
+ readonly stateMutability: "nonpayable";
252
+ readonly inputs: readonly [{
253
+ readonly type: "address";
254
+ readonly name: "token";
255
+ }, {
256
+ readonly type: "uint256";
257
+ readonly name: "assets";
258
+ }, {
259
+ readonly type: "address";
260
+ readonly name: "callback";
261
+ }, {
262
+ readonly type: "bytes";
263
+ readonly name: "data";
264
+ }];
265
+ readonly outputs: readonly [];
266
+ }, {
267
+ readonly name: "isHealthy";
268
+ readonly type: "function";
269
+ readonly stateMutability: "view";
270
+ readonly inputs: readonly [{
271
+ readonly type: "tuple";
272
+ readonly components: readonly [{
273
+ readonly type: "address";
274
+ readonly name: "loanToken";
275
+ }, {
276
+ readonly type: "tuple[]";
277
+ readonly components: readonly [{
278
+ readonly type: "address";
279
+ readonly name: "token";
280
+ }, {
281
+ readonly type: "uint256";
282
+ readonly name: "lltv";
283
+ }, {
284
+ readonly type: "address";
285
+ readonly name: "oracle";
286
+ }];
287
+ readonly name: "collaterals";
288
+ }, {
289
+ readonly type: "uint256";
290
+ readonly name: "maturity";
291
+ }];
292
+ readonly name: "obligation";
293
+ }, {
294
+ readonly type: "bytes32";
295
+ readonly name: "id";
296
+ }, {
297
+ readonly type: "address";
298
+ readonly name: "borrower";
299
+ }];
300
+ readonly outputs: readonly [{
301
+ readonly type: "bool";
302
+ }];
303
+ }, {
304
+ readonly name: "liquidate";
305
+ readonly type: "function";
306
+ readonly stateMutability: "nonpayable";
307
+ readonly inputs: readonly [{
308
+ readonly type: "tuple";
309
+ readonly components: readonly [{
310
+ readonly type: "address";
311
+ readonly name: "loanToken";
312
+ }, {
313
+ readonly type: "tuple[]";
314
+ readonly components: readonly [{
315
+ readonly type: "address";
316
+ readonly name: "token";
317
+ }, {
318
+ readonly type: "uint256";
319
+ readonly name: "lltv";
320
+ }, {
321
+ readonly type: "address";
322
+ readonly name: "oracle";
323
+ }];
324
+ readonly name: "collaterals";
325
+ }, {
326
+ readonly type: "uint256";
327
+ readonly name: "maturity";
328
+ }];
329
+ readonly name: "obligation";
330
+ }, {
331
+ readonly type: "tuple[]";
332
+ readonly components: readonly [{
333
+ readonly type: "uint256";
334
+ readonly name: "collateralIndex";
335
+ }, {
336
+ readonly type: "uint256";
337
+ readonly name: "repaid";
338
+ }, {
339
+ readonly type: "uint256";
340
+ readonly name: "seized";
341
+ }];
342
+ readonly name: "seizures";
343
+ }, {
344
+ readonly type: "address";
345
+ readonly name: "borrower";
346
+ }, {
347
+ readonly type: "bytes";
348
+ readonly name: "data";
349
+ }];
350
+ readonly outputs: readonly [{
351
+ readonly type: "tuple[]";
352
+ readonly components: readonly [{
353
+ readonly type: "uint256";
354
+ readonly name: "collateralIndex";
355
+ }, {
356
+ readonly type: "uint256";
357
+ readonly name: "repaid";
358
+ }, {
359
+ readonly type: "uint256";
360
+ readonly name: "seized";
361
+ }];
362
+ }];
363
+ }, {
364
+ readonly name: "multicall";
365
+ readonly type: "function";
366
+ readonly stateMutability: "nonpayable";
367
+ readonly inputs: readonly [{
368
+ readonly type: "bytes[]";
369
+ readonly name: "calls";
370
+ }];
371
+ readonly outputs: readonly [];
372
+ }, {
373
+ readonly name: "obligationCreated";
374
+ readonly type: "function";
375
+ readonly stateMutability: "view";
376
+ readonly inputs: readonly [{
377
+ readonly type: "bytes32";
378
+ readonly name: "id";
379
+ }];
380
+ readonly outputs: readonly [{
381
+ readonly type: "bool";
382
+ }];
383
+ }, {
384
+ readonly name: "obligationState";
385
+ readonly type: "function";
386
+ readonly stateMutability: "view";
387
+ readonly inputs: readonly [{
388
+ readonly type: "bytes32";
389
+ readonly name: "id";
390
+ }];
391
+ readonly outputs: readonly [{
392
+ readonly type: "uint128";
393
+ readonly name: "totalUnits";
394
+ }, {
395
+ readonly type: "uint128";
396
+ readonly name: "totalShares";
397
+ }, {
398
+ readonly type: "uint256";
399
+ readonly name: "withdrawable";
400
+ }, {
401
+ readonly type: "bool";
402
+ readonly name: "created";
403
+ }];
404
+ }, {
405
+ readonly name: "owner";
406
+ readonly type: "function";
407
+ readonly stateMutability: "view";
408
+ readonly inputs: readonly [];
409
+ readonly outputs: readonly [{
410
+ readonly type: "address";
411
+ }];
412
+ }, {
413
+ readonly name: "repay";
414
+ readonly type: "function";
415
+ readonly stateMutability: "nonpayable";
416
+ readonly inputs: readonly [{
417
+ readonly type: "tuple";
418
+ readonly components: readonly [{
419
+ readonly type: "address";
420
+ readonly name: "loanToken";
421
+ }, {
422
+ readonly type: "tuple[]";
423
+ readonly components: readonly [{
424
+ readonly type: "address";
425
+ readonly name: "token";
426
+ }, {
427
+ readonly type: "uint256";
428
+ readonly name: "lltv";
429
+ }, {
430
+ readonly type: "address";
431
+ readonly name: "oracle";
432
+ }];
433
+ readonly name: "collaterals";
434
+ }, {
435
+ readonly type: "uint256";
436
+ readonly name: "maturity";
437
+ }];
438
+ readonly name: "obligation";
439
+ }, {
440
+ readonly type: "uint256";
441
+ readonly name: "obligationUnits";
442
+ }, {
443
+ readonly type: "address";
444
+ readonly name: "onBehalf";
445
+ }];
446
+ readonly outputs: readonly [];
447
+ }, {
448
+ readonly name: "session";
449
+ readonly type: "function";
450
+ readonly stateMutability: "view";
451
+ readonly inputs: readonly [{
452
+ readonly type: "address";
453
+ readonly name: "user";
454
+ }];
455
+ readonly outputs: readonly [{
456
+ readonly type: "bytes32";
457
+ }];
458
+ }, {
459
+ readonly name: "setDefaultTradingFee";
460
+ readonly type: "function";
461
+ readonly stateMutability: "nonpayable";
462
+ readonly inputs: readonly [{
463
+ readonly type: "address";
464
+ readonly name: "loanToken";
465
+ }, {
466
+ readonly type: "uint256";
467
+ readonly name: "index";
468
+ }, {
469
+ readonly type: "uint256";
470
+ readonly name: "newTradingFee";
471
+ }];
472
+ readonly outputs: readonly [];
473
+ }, {
474
+ readonly name: "setFeeSetter";
475
+ readonly type: "function";
476
+ readonly stateMutability: "nonpayable";
477
+ readonly inputs: readonly [{
478
+ readonly type: "address";
479
+ readonly name: "newFeeSetter";
480
+ }];
481
+ readonly outputs: readonly [];
482
+ }, {
483
+ readonly name: "setObligationTradingFee";
484
+ readonly type: "function";
485
+ readonly stateMutability: "nonpayable";
486
+ readonly inputs: readonly [{
487
+ readonly type: "bytes32";
488
+ readonly name: "id";
489
+ }, {
490
+ readonly type: "uint256";
491
+ readonly name: "index";
492
+ }, {
493
+ readonly type: "uint256";
494
+ readonly name: "newTradingFee";
495
+ }];
496
+ readonly outputs: readonly [];
497
+ }, {
498
+ readonly name: "setOwner";
499
+ readonly type: "function";
500
+ readonly stateMutability: "nonpayable";
501
+ readonly inputs: readonly [{
502
+ readonly type: "address";
503
+ readonly name: "newOwner";
504
+ }];
505
+ readonly outputs: readonly [];
506
+ }, {
507
+ readonly name: "setTradingFeeRecipient";
508
+ readonly type: "function";
509
+ readonly stateMutability: "nonpayable";
510
+ readonly inputs: readonly [{
511
+ readonly type: "address";
512
+ readonly name: "recipient";
513
+ }];
514
+ readonly outputs: readonly [];
515
+ }, {
516
+ readonly name: "sharesOf";
517
+ readonly type: "function";
518
+ readonly stateMutability: "view";
519
+ readonly inputs: readonly [{
520
+ readonly type: "bytes32";
521
+ readonly name: "id";
522
+ }, {
523
+ readonly type: "address";
524
+ readonly name: "user";
525
+ }];
526
+ readonly outputs: readonly [{
527
+ readonly type: "uint256";
528
+ }];
529
+ }, {
530
+ readonly name: "shuffleSession";
531
+ readonly type: "function";
532
+ readonly stateMutability: "nonpayable";
533
+ readonly inputs: readonly [];
534
+ readonly outputs: readonly [];
535
+ }, {
536
+ readonly name: "supplyCollateral";
537
+ readonly type: "function";
538
+ readonly stateMutability: "nonpayable";
539
+ readonly inputs: readonly [{
540
+ readonly type: "tuple";
541
+ readonly components: readonly [{
542
+ readonly type: "address";
543
+ readonly name: "loanToken";
544
+ }, {
545
+ readonly type: "tuple[]";
546
+ readonly components: readonly [{
547
+ readonly type: "address";
548
+ readonly name: "token";
549
+ }, {
550
+ readonly type: "uint256";
551
+ readonly name: "lltv";
552
+ }, {
553
+ readonly type: "address";
554
+ readonly name: "oracle";
555
+ }];
556
+ readonly name: "collaterals";
557
+ }, {
558
+ readonly type: "uint256";
559
+ readonly name: "maturity";
560
+ }];
561
+ readonly name: "obligation";
562
+ }, {
563
+ readonly type: "address";
564
+ readonly name: "collateral";
565
+ }, {
566
+ readonly type: "uint256";
567
+ readonly name: "assets";
568
+ }, {
569
+ readonly type: "address";
570
+ readonly name: "onBehalf";
571
+ }];
572
+ readonly outputs: readonly [];
573
+ }, {
574
+ readonly name: "take";
575
+ readonly type: "function";
576
+ readonly stateMutability: "nonpayable";
577
+ readonly inputs: readonly [{
578
+ readonly type: "uint256";
579
+ readonly name: "buyerAssets";
580
+ }, {
581
+ readonly type: "uint256";
582
+ readonly name: "sellerAssets";
583
+ }, {
584
+ readonly type: "uint256";
585
+ readonly name: "obligationUnits";
586
+ }, {
587
+ readonly type: "uint256";
588
+ readonly name: "obligationShares";
589
+ }, {
590
+ readonly type: "address";
591
+ readonly name: "taker";
592
+ }, {
593
+ readonly type: "tuple";
594
+ readonly components: readonly [{
595
+ readonly type: "tuple";
596
+ readonly components: readonly [{
597
+ readonly type: "address";
598
+ readonly name: "loanToken";
599
+ }, {
600
+ readonly type: "tuple[]";
601
+ readonly components: readonly [{
602
+ readonly type: "address";
603
+ readonly name: "token";
604
+ }, {
605
+ readonly type: "uint256";
606
+ readonly name: "lltv";
607
+ }, {
608
+ readonly type: "address";
609
+ readonly name: "oracle";
610
+ }];
611
+ readonly name: "collaterals";
612
+ }, {
613
+ readonly type: "uint256";
614
+ readonly name: "maturity";
615
+ }];
616
+ readonly name: "obligation";
617
+ }, {
618
+ readonly type: "bool";
619
+ readonly name: "buy";
620
+ }, {
621
+ readonly type: "address";
622
+ readonly name: "maker";
623
+ }, {
624
+ readonly type: "uint256";
625
+ readonly name: "assets";
626
+ }, {
627
+ readonly type: "uint256";
628
+ readonly name: "obligationUnits";
629
+ }, {
630
+ readonly type: "uint256";
631
+ readonly name: "obligationShares";
632
+ }, {
633
+ readonly type: "uint256";
634
+ readonly name: "start";
635
+ }, {
636
+ readonly type: "uint256";
637
+ readonly name: "expiry";
638
+ }, {
639
+ readonly type: "uint256";
640
+ readonly name: "tick";
641
+ }, {
642
+ readonly type: "bytes32";
643
+ readonly name: "group";
644
+ }, {
645
+ readonly type: "bytes32";
646
+ readonly name: "session";
647
+ }, {
648
+ readonly type: "address";
649
+ readonly name: "callback";
650
+ }, {
651
+ readonly type: "bytes";
652
+ readonly name: "callbackData";
653
+ }];
654
+ readonly name: "offer";
655
+ }, {
656
+ readonly type: "tuple";
657
+ readonly components: readonly [{
658
+ readonly type: "uint8";
659
+ readonly name: "v";
660
+ }, {
661
+ readonly type: "bytes32";
662
+ readonly name: "r";
663
+ }, {
664
+ readonly type: "bytes32";
665
+ readonly name: "s";
666
+ }];
667
+ readonly name: "sig";
668
+ }, {
669
+ readonly type: "bytes32";
670
+ readonly name: "root";
671
+ }, {
672
+ readonly type: "bytes32[]";
673
+ readonly name: "proof";
674
+ }, {
675
+ readonly type: "address";
676
+ readonly name: "takerCallback";
677
+ }, {
678
+ readonly type: "bytes";
679
+ readonly name: "takerCallbackData";
680
+ }];
681
+ readonly outputs: readonly [{
682
+ readonly type: "uint256";
683
+ }, {
684
+ readonly type: "uint256";
685
+ }, {
686
+ readonly type: "uint256";
687
+ }, {
688
+ readonly type: "uint256";
689
+ }];
690
+ }, {
691
+ readonly name: "totalShares";
692
+ readonly type: "function";
693
+ readonly stateMutability: "view";
694
+ readonly inputs: readonly [{
695
+ readonly type: "bytes32";
696
+ readonly name: "id";
697
+ }];
698
+ readonly outputs: readonly [{
699
+ readonly type: "uint256";
700
+ }];
701
+ }, {
702
+ readonly name: "totalUnits";
703
+ readonly type: "function";
704
+ readonly stateMutability: "view";
705
+ readonly inputs: readonly [{
706
+ readonly type: "bytes32";
707
+ readonly name: "id";
708
+ }];
709
+ readonly outputs: readonly [{
710
+ readonly type: "uint256";
711
+ }];
712
+ }, {
713
+ readonly name: "touchObligation";
714
+ readonly type: "function";
715
+ readonly stateMutability: "nonpayable";
716
+ readonly inputs: readonly [{
717
+ readonly type: "tuple";
718
+ readonly components: readonly [{
719
+ readonly type: "address";
720
+ readonly name: "loanToken";
721
+ }, {
722
+ readonly type: "tuple[]";
723
+ readonly components: readonly [{
724
+ readonly type: "address";
725
+ readonly name: "token";
726
+ }, {
727
+ readonly type: "uint256";
728
+ readonly name: "lltv";
729
+ }, {
730
+ readonly type: "address";
731
+ readonly name: "oracle";
732
+ }];
733
+ readonly name: "collaterals";
734
+ }, {
735
+ readonly type: "uint256";
736
+ readonly name: "maturity";
737
+ }];
738
+ readonly name: "obligation";
739
+ }];
740
+ readonly outputs: readonly [{
741
+ readonly type: "bytes32";
742
+ }];
743
+ }, {
744
+ readonly name: "tradingFee";
745
+ readonly type: "function";
746
+ readonly stateMutability: "view";
747
+ readonly inputs: readonly [{
748
+ readonly type: "bytes32";
749
+ readonly name: "id";
750
+ }, {
751
+ readonly type: "uint256";
752
+ readonly name: "timeToMaturity";
753
+ }];
754
+ readonly outputs: readonly [{
755
+ readonly type: "uint256";
756
+ }];
757
+ }, {
758
+ readonly name: "tradingFeeRecipient";
759
+ readonly type: "function";
760
+ readonly stateMutability: "view";
761
+ readonly inputs: readonly [];
762
+ readonly outputs: readonly [{
763
+ readonly type: "address";
764
+ }];
765
+ }, {
766
+ readonly name: "withdraw";
767
+ readonly type: "function";
768
+ readonly stateMutability: "nonpayable";
769
+ readonly inputs: readonly [{
770
+ readonly type: "tuple";
771
+ readonly components: readonly [{
772
+ readonly type: "address";
773
+ readonly name: "loanToken";
774
+ }, {
775
+ readonly type: "tuple[]";
776
+ readonly components: readonly [{
777
+ readonly type: "address";
778
+ readonly name: "token";
779
+ }, {
780
+ readonly type: "uint256";
781
+ readonly name: "lltv";
782
+ }, {
783
+ readonly type: "address";
784
+ readonly name: "oracle";
785
+ }];
786
+ readonly name: "collaterals";
787
+ }, {
788
+ readonly type: "uint256";
789
+ readonly name: "maturity";
790
+ }];
791
+ readonly name: "obligation";
792
+ }, {
793
+ readonly type: "uint256";
794
+ readonly name: "obligationUnits";
795
+ }, {
796
+ readonly type: "uint256";
797
+ readonly name: "shares";
798
+ }, {
799
+ readonly type: "address";
800
+ readonly name: "onBehalf";
801
+ }];
802
+ readonly outputs: readonly [{
803
+ readonly type: "uint256";
804
+ }, {
805
+ readonly type: "uint256";
806
+ }];
807
+ }, {
808
+ readonly name: "withdrawCollateral";
809
+ readonly type: "function";
810
+ readonly stateMutability: "nonpayable";
811
+ readonly inputs: readonly [{
812
+ readonly type: "tuple";
813
+ readonly components: readonly [{
814
+ readonly type: "address";
815
+ readonly name: "loanToken";
816
+ }, {
817
+ readonly type: "tuple[]";
818
+ readonly components: readonly [{
819
+ readonly type: "address";
820
+ readonly name: "token";
821
+ }, {
822
+ readonly type: "uint256";
823
+ readonly name: "lltv";
824
+ }, {
825
+ readonly type: "address";
826
+ readonly name: "oracle";
827
+ }];
828
+ readonly name: "collaterals";
829
+ }, {
830
+ readonly type: "uint256";
831
+ readonly name: "maturity";
832
+ }];
833
+ readonly name: "obligation";
834
+ }, {
835
+ readonly type: "address";
836
+ readonly name: "collateral";
837
+ }, {
838
+ readonly type: "uint256";
839
+ readonly name: "assets";
840
+ }, {
841
+ readonly type: "address";
842
+ readonly name: "onBehalf";
843
+ }];
844
+ readonly outputs: readonly [];
845
+ }, {
846
+ readonly name: "withdrawable";
847
+ readonly type: "function";
848
+ readonly stateMutability: "view";
849
+ readonly inputs: readonly [{
850
+ readonly type: "bytes32";
851
+ readonly name: "id";
852
+ }];
853
+ readonly outputs: readonly [{
854
+ readonly type: "uint256";
855
+ }];
856
+ }, {
857
+ readonly name: "Constructor";
858
+ readonly type: "event";
859
+ readonly inputs: readonly [{
860
+ readonly type: "address";
861
+ readonly name: "owner";
862
+ readonly indexed: true;
863
+ }];
864
+ }, {
865
+ readonly name: "Consume";
866
+ readonly type: "event";
867
+ readonly inputs: readonly [{
868
+ readonly type: "address";
869
+ readonly name: "user";
870
+ readonly indexed: true;
871
+ }, {
872
+ readonly type: "bytes32";
873
+ readonly name: "group";
874
+ readonly indexed: true;
875
+ }, {
876
+ readonly type: "uint256";
877
+ readonly name: "amount";
878
+ }];
879
+ }, {
880
+ readonly name: "FlashLoan";
881
+ readonly type: "event";
882
+ readonly inputs: readonly [{
883
+ readonly type: "address";
884
+ readonly name: "caller";
885
+ readonly indexed: true;
886
+ }, {
887
+ readonly type: "address";
888
+ readonly name: "token";
889
+ readonly indexed: true;
890
+ }, {
891
+ readonly type: "uint256";
892
+ readonly name: "assets";
893
+ }];
894
+ }, {
895
+ readonly name: "Liquidate";
896
+ readonly type: "event";
897
+ readonly inputs: readonly [{
898
+ readonly type: "address";
899
+ readonly name: "caller";
900
+ readonly indexed: true;
901
+ }, {
902
+ readonly type: "bytes32";
903
+ readonly name: "id";
904
+ readonly indexed: true;
905
+ }, {
906
+ readonly type: "tuple[]";
907
+ readonly components: readonly [{
908
+ readonly type: "uint256";
909
+ readonly name: "collateralIndex";
910
+ }, {
911
+ readonly type: "uint256";
912
+ readonly name: "repaid";
913
+ }, {
914
+ readonly type: "uint256";
915
+ readonly name: "seized";
916
+ }];
917
+ readonly name: "seizures";
918
+ }, {
919
+ readonly type: "address";
920
+ readonly name: "borrower";
921
+ readonly indexed: true;
922
+ }, {
923
+ readonly type: "uint256";
924
+ readonly name: "totalRepaid";
925
+ }, {
926
+ readonly type: "uint256";
927
+ readonly name: "badDebt";
928
+ }];
929
+ }, {
930
+ readonly name: "ObligationCreated";
931
+ readonly type: "event";
932
+ readonly inputs: readonly [{
933
+ readonly type: "bytes32";
934
+ readonly name: "id";
935
+ readonly indexed: true;
936
+ }, {
937
+ readonly type: "tuple";
938
+ readonly components: readonly [{
939
+ readonly type: "address";
940
+ readonly name: "loanToken";
941
+ }, {
942
+ readonly type: "tuple[]";
943
+ readonly components: readonly [{
944
+ readonly type: "address";
945
+ readonly name: "token";
946
+ }, {
947
+ readonly type: "uint256";
948
+ readonly name: "lltv";
949
+ }, {
950
+ readonly type: "address";
951
+ readonly name: "oracle";
952
+ }];
953
+ readonly name: "collaterals";
954
+ }, {
955
+ readonly type: "uint256";
956
+ readonly name: "maturity";
957
+ }];
958
+ readonly name: "obligation";
959
+ }];
960
+ }, {
961
+ readonly name: "Repay";
962
+ readonly type: "event";
963
+ readonly inputs: readonly [{
964
+ readonly type: "address";
965
+ readonly name: "caller";
966
+ readonly indexed: true;
967
+ }, {
968
+ readonly type: "bytes32";
969
+ readonly name: "id";
970
+ readonly indexed: true;
971
+ }, {
972
+ readonly type: "uint256";
973
+ readonly name: "obligationUnits";
974
+ }, {
975
+ readonly type: "address";
976
+ readonly name: "onBehalf";
977
+ readonly indexed: true;
978
+ }];
979
+ }, {
980
+ readonly name: "SetDefaultTradingFee";
981
+ readonly type: "event";
982
+ readonly inputs: readonly [{
983
+ readonly type: "address";
984
+ readonly name: "loanToken";
985
+ readonly indexed: true;
986
+ }, {
987
+ readonly type: "uint256";
988
+ readonly name: "index";
989
+ readonly indexed: true;
990
+ }, {
991
+ readonly type: "uint256";
992
+ readonly name: "newTradingFee";
993
+ }];
994
+ }, {
995
+ readonly name: "SetFeeSetter";
996
+ readonly type: "event";
997
+ readonly inputs: readonly [{
998
+ readonly type: "address";
999
+ readonly name: "feeSetter";
1000
+ readonly indexed: true;
1001
+ }];
1002
+ }, {
1003
+ readonly name: "SetObligationTradingFee";
1004
+ readonly type: "event";
1005
+ readonly inputs: readonly [{
1006
+ readonly type: "bytes32";
1007
+ readonly name: "id";
1008
+ readonly indexed: true;
1009
+ }, {
1010
+ readonly type: "uint256";
1011
+ readonly name: "index";
1012
+ readonly indexed: true;
1013
+ }, {
1014
+ readonly type: "uint256";
1015
+ readonly name: "newTradingFee";
1016
+ }];
1017
+ }, {
1018
+ readonly name: "SetOwner";
1019
+ readonly type: "event";
1020
+ readonly inputs: readonly [{
1021
+ readonly type: "address";
1022
+ readonly name: "owner";
1023
+ readonly indexed: true;
1024
+ }];
1025
+ }, {
1026
+ readonly name: "SetTradingFeeRecipient";
1027
+ readonly type: "event";
1028
+ readonly inputs: readonly [{
1029
+ readonly type: "address";
1030
+ readonly name: "recipient";
1031
+ readonly indexed: true;
1032
+ }];
1033
+ }, {
1034
+ readonly name: "ShuffleSession";
1035
+ readonly type: "event";
1036
+ readonly inputs: readonly [{
1037
+ readonly type: "address";
1038
+ readonly name: "user";
1039
+ readonly indexed: true;
1040
+ }, {
1041
+ readonly type: "bytes32";
1042
+ readonly name: "session";
1043
+ }];
1044
+ }, {
1045
+ readonly name: "SupplyCollateral";
1046
+ readonly type: "event";
1047
+ readonly inputs: readonly [{
1048
+ readonly type: "address";
1049
+ readonly name: "caller";
1050
+ }, {
1051
+ readonly type: "bytes32";
1052
+ readonly name: "id";
1053
+ readonly indexed: true;
1054
+ }, {
1055
+ readonly type: "address";
1056
+ readonly name: "collateral";
1057
+ readonly indexed: true;
1058
+ }, {
1059
+ readonly type: "uint256";
1060
+ readonly name: "assets";
1061
+ }, {
1062
+ readonly type: "address";
1063
+ readonly name: "onBehalf";
1064
+ readonly indexed: true;
1065
+ }];
1066
+ }, {
1067
+ readonly name: "Take";
1068
+ readonly type: "event";
1069
+ readonly inputs: readonly [{
1070
+ readonly type: "address";
1071
+ readonly name: "caller";
1072
+ }, {
1073
+ readonly type: "bytes32";
1074
+ readonly name: "id";
1075
+ readonly indexed: true;
1076
+ }, {
1077
+ readonly type: "address";
1078
+ readonly name: "maker";
1079
+ readonly indexed: true;
1080
+ }, {
1081
+ readonly type: "address";
1082
+ readonly name: "taker";
1083
+ readonly indexed: true;
1084
+ }, {
1085
+ readonly type: "bool";
1086
+ readonly name: "offerIsBuy";
1087
+ }, {
1088
+ readonly type: "uint256";
1089
+ readonly name: "buyerAssets";
1090
+ }, {
1091
+ readonly type: "uint256";
1092
+ readonly name: "sellerAssets";
1093
+ }, {
1094
+ readonly type: "uint256";
1095
+ readonly name: "obligationUnits";
1096
+ }, {
1097
+ readonly type: "uint256";
1098
+ readonly name: "obligationShares";
1099
+ }, {
1100
+ readonly type: "bool";
1101
+ readonly name: "buyerIsLender";
1102
+ }, {
1103
+ readonly type: "bool";
1104
+ readonly name: "sellerIsBorrower";
1105
+ }, {
1106
+ readonly type: "bytes32";
1107
+ readonly name: "group";
1108
+ }, {
1109
+ readonly type: "uint256";
1110
+ readonly name: "consumed";
1111
+ }];
1112
+ }, {
1113
+ readonly name: "Withdraw";
1114
+ readonly type: "event";
1115
+ readonly inputs: readonly [{
1116
+ readonly type: "address";
1117
+ readonly name: "caller";
1118
+ readonly indexed: true;
1119
+ }, {
1120
+ readonly type: "bytes32";
1121
+ readonly name: "id";
1122
+ readonly indexed: true;
1123
+ }, {
1124
+ readonly type: "uint256";
1125
+ readonly name: "obligationUnits";
1126
+ }, {
1127
+ readonly type: "uint256";
1128
+ readonly name: "shares";
1129
+ }, {
1130
+ readonly type: "address";
1131
+ readonly name: "onBehalf";
1132
+ readonly indexed: true;
1133
+ }];
1134
+ }, {
1135
+ readonly name: "WithdrawCollateral";
1136
+ readonly type: "event";
1137
+ readonly inputs: readonly [{
1138
+ readonly type: "address";
1139
+ readonly name: "caller";
1140
+ }, {
1141
+ readonly type: "bytes32";
1142
+ readonly name: "id";
1143
+ readonly indexed: true;
1144
+ }, {
1145
+ readonly type: "address";
1146
+ readonly name: "collateral";
1147
+ readonly indexed: true;
1148
+ }, {
1149
+ readonly type: "uint256";
1150
+ readonly name: "assets";
1151
+ }, {
1152
+ readonly type: "address";
1153
+ readonly name: "onBehalf";
1154
+ readonly indexed: true;
1155
+ }];
1156
+ }];
1157
+ type MorphoV2 = typeof MorphoV2;
152
1158
  declare namespace index_d_exports {
153
- export { ERC4626, MetaMorpho, MetaMorphoFactory, Morpho, Oracle$1 as Oracle };
1159
+ export { ERC4626, MetaMorpho, MetaMorphoFactory, Morpho, MorphoV2, Oracle$1 as Oracle };
154
1160
  }
155
1161
  declare const Oracle$1: readonly [{
156
1162
  readonly type: "function";
@@ -865,8 +1871,8 @@ type Offer = {
865
1871
  /** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
866
1872
  readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
867
1873
  readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
868
- readonly obligationShares: bigint; /** The price (18 decimals). */
869
- readonly price: bigint; /** The date at which all interests will be paid. */
1874
+ readonly obligationShares: bigint; /** The offer tick. */
1875
+ readonly tick: number; /** The date at which all interests will be paid. */
870
1876
  readonly maturity: Maturity; /** The date at which the offer will expire. */
871
1877
  readonly expiry: number; /** The date at which the offer will start. */
872
1878
  readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
@@ -894,7 +1900,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
894
1900
  assets: z$1.ZodBigInt;
895
1901
  obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
896
1902
  obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
897
- price: z$1.ZodBigInt;
1903
+ tick: z$1.ZodCoercedNumber<unknown>;
898
1904
  maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
899
1905
  expiry: z$1.ZodNumber;
900
1906
  start: z$1.ZodNumber;
@@ -969,7 +1975,7 @@ declare const serialize: (offer: Offer) => {
969
1975
  assets: string;
970
1976
  obligationUnits: string;
971
1977
  obligationShares: string;
972
- price: string;
1978
+ tick: number;
973
1979
  maturity: number;
974
1980
  expiry: number;
975
1981
  start: number;
@@ -1004,7 +2010,7 @@ type RandomConfig = {
1004
2010
  expiry?: number;
1005
2011
  group?: Hex | bigint | number | string;
1006
2012
  session?: Hex | bigint | number | string;
1007
- price?: bigint;
2013
+ tick?: number;
1008
2014
  callback?: {
1009
2015
  address: Address;
1010
2016
  data: Hex;
@@ -1053,7 +2059,7 @@ declare const types: {
1053
2059
  readonly name: "obligationShares";
1054
2060
  readonly type: "uint256";
1055
2061
  }, {
1056
- readonly name: "price";
2062
+ readonly name: "tick";
1057
2063
  readonly type: "uint256";
1058
2064
  }, {
1059
2065
  readonly name: "maturity";
@@ -1449,6 +2455,41 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
1449
2455
  readonly name = "Quote.InvalidQuoteError";
1450
2456
  constructor(error: z$1.ZodError | Error);
1451
2457
  }
2458
+ declare namespace Tick_d_exports {
2459
+ export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
2460
+ }
2461
+ /** Tick domain supported by Morpho V2. */
2462
+ declare const TICK_RANGE = 990;
2463
+ /** Max allowed price (1e18 in wad). */
2464
+ declare const MAX_PRICE: bigint;
2465
+ /**
2466
+ * Converts a tick to a wad price using the same approximation and rounding as TickLib.
2467
+ * @param tick - Tick value in the inclusive range [0, 990].
2468
+ * @returns The price in wad units.
2469
+ * @throws {@link InvalidTickError} If tick is not an integer in range [0, 990].
2470
+ */
2471
+ declare function tickToPrice(tick: number): bigint;
2472
+ declare namespace tickToPrice {
2473
+ type ErrorType = InvalidTickError;
2474
+ }
2475
+ /**
2476
+ * Returns the lowest tick with a higher-or-equal price.
2477
+ * @param price - Price in wad units.
2478
+ * @returns The first tick whose {@link tickToPrice} is greater than or equal to `price`.
2479
+ * @throws {@link InvalidPriceError} If price is outside [0, 1e18].
2480
+ */
2481
+ declare function priceToTick(price: bigint): number;
2482
+ declare namespace priceToTick {
2483
+ type ErrorType = InvalidPriceError;
2484
+ }
2485
+ declare class InvalidTickError extends BaseError {
2486
+ readonly name = "Tick.InvalidTickError";
2487
+ constructor(tick: number);
2488
+ }
2489
+ declare class InvalidPriceError extends BaseError {
2490
+ readonly name = "Tick.InvalidPriceError";
2491
+ constructor(price: bigint);
2492
+ }
1452
2493
  declare namespace TradingFee_d_exports {
1453
2494
  export { BREAKPOINTS, Fees, InvalidFeeError, InvalidFeesLengthError, TradingFee, WAD, activate, compute, deactivate, from$9 as from, getFees, isActivated };
1454
2495
  }
@@ -1862,7 +2903,7 @@ type Row = {
1862
2903
  assets: bigint;
1863
2904
  obligationUnits: bigint;
1864
2905
  obligationShares: bigint;
1865
- price: bigint;
2906
+ tick: number;
1866
2907
  maturity: Maturity;
1867
2908
  expiry: number;
1868
2909
  start: number;
@@ -1933,8 +2974,8 @@ declare namespace get$4 {
1933
2974
  limit?: number;
1934
2975
  };
1935
2976
  type Level = {
1936
- /** The computed price for this level (interpolated at query time) */price: bigint; /** Sum of takeable amounts at this price */
1937
- assets: bigint; /** Number of offers at this price */
2977
+ /** The offer tick for this level */tick: number; /** Sum of takeable amounts at this tick */
2978
+ assets: bigint; /** Number of offers at this tick */
1938
2979
  count: number;
1939
2980
  };
1940
2981
  type ReturnType = {
@@ -2023,6 +3064,7 @@ type Lot = {
2023
3064
  user: Address;
2024
3065
  contract: Address;
2025
3066
  group: string;
3067
+ obligationId: string;
2026
3068
  lower: bigint;
2027
3069
  upper: bigint;
2028
3070
  };
@@ -2045,6 +3087,7 @@ declare namespace create$5 {
2045
3087
  positionContract: Address;
2046
3088
  positionUser: Address;
2047
3089
  group: string;
3090
+ obligationId: string;
2048
3091
  size: bigint;
2049
3092
  };
2050
3093
  type Parameters = OfferLotInfo[];
@@ -2056,6 +3099,7 @@ declare namespace get$3 {
2056
3099
  user?: Address;
2057
3100
  contract?: Address;
2058
3101
  group?: string;
3102
+ obligationId?: string;
2059
3103
  };
2060
3104
  type ReturnType = Lot[];
2061
3105
  }
@@ -2076,6 +3120,7 @@ type Offset = {
2076
3120
  user: Address;
2077
3121
  contract: Address;
2078
3122
  group: string;
3123
+ obligationId: string;
2079
3124
  value: bigint;
2080
3125
  };
2081
3126
  type OffsetsDomain = {
@@ -2090,6 +3135,7 @@ declare namespace get$2 {
2090
3135
  user?: Address;
2091
3136
  contract?: Address;
2092
3137
  group?: string;
3138
+ obligationId?: string;
2093
3139
  };
2094
3140
  type ReturnType = Offset[];
2095
3141
  }
@@ -2168,7 +3214,8 @@ declare namespace getByUser {
2168
3214
  chainId: Id;
2169
3215
  contract: Address;
2170
3216
  user: Address;
2171
- blockNumber: number; /** The amount reserved by active offers: max(lot.upper) - offset - consumed */
3217
+ blockNumber: number; /** The obligation this reserved amount belongs to, or null if no lots exist */
3218
+ obligationId: string | null; /** The amount reserved by active offers: max(lot.upper) - offset - consumed */
2172
3219
  reserved: bigint;
2173
3220
  };
2174
3221
  type ReturnType = {
@@ -2257,7 +3304,7 @@ type ValidationsDomain = {
2257
3304
  upsert: (validations: Validation[]) => Promise<void>;
2258
3305
  };
2259
3306
  declare namespace Database_d_exports {
2260
- export { Core, Database, Driver, WithDomains, connect$2 as connect };
3307
+ export { Core, Database, Driver, WithDomains, connect$2 as connect, getSchemaNamesForMigration };
2261
3308
  }
2262
3309
  type Driver = ReturnType<typeof drizzle> | ReturnType<typeof drizzle$1>;
2263
3310
  type Domains = {
@@ -2293,6 +3340,12 @@ type Database = Core & {
2293
3340
  * @returns The database client {@link connect.ReturnType}
2294
3341
  */
2295
3342
  declare function connect$2(chainRegistry: ChainRegistry, connectionString?: string): Database;
3343
+ /**
3344
+ * Build the list of router schemas that should exist before running migrations.
3345
+ * @param version - Current schema version (e.g. `router_v1.8`).
3346
+ * @returns Ordered schema names from `router_v1.7` to current, or just current if parsing fails.
3347
+ */
3348
+ declare function getSchemaNamesForMigration(version: string): string[];
2296
3349
  declare namespace Gate_d_exports {
2297
3350
  export { Batch, Issue, Result, Rule, RuleNames, Single, batch$1 as batch, run, single };
2298
3351
  }
@@ -2377,6 +3430,10 @@ type ConfigRule = {
2377
3430
  type: "loan_token";
2378
3431
  chain_id: Id;
2379
3432
  address: Address;
3433
+ } | {
3434
+ type: "collateral_token";
3435
+ chain_id: Id;
3436
+ address: Address;
2380
3437
  } | {
2381
3438
  type: "oracle";
2382
3439
  chain_id: Id;
@@ -2549,15 +3606,17 @@ declare namespace BookResponse_d_exports {
2549
3606
  export { BookLevelResponse, from$4 as from };
2550
3607
  }
2551
3608
  type BookLevelResponse = {
3609
+ tick: number;
2552
3610
  price: string;
2553
3611
  assets: string;
2554
3612
  count: number;
2555
3613
  };
2556
- declare function from$4(level: {
2557
- price: bigint;
3614
+ type Input$1 = {
3615
+ tick: number;
2558
3616
  assets: bigint;
2559
3617
  count: number;
2560
- }): BookLevelResponse;
3618
+ };
3619
+ declare function from$4(level: Input$1): BookLevelResponse;
2561
3620
  //#endregion
2562
3621
  //#region src/api/Schema/health.d.ts
2563
3622
  declare const CollectorHealth: z.ZodObject<{
@@ -2631,13 +3690,13 @@ interface paths {
2631
3690
  };
2632
3691
  /**
2633
3692
  * Get aggregated book
2634
- * @description Returns aggregated book data for a given obligation and side. Offers are grouped by computed price with summed takeable amounts. Book levels are sorted by price (ascending for buy side, descending for sell side).
3693
+ * @description Returns aggregated book data for a given obligation and side. Offers are grouped by tick with summed takeable amounts, and each level includes the corresponding wad-scaled price. Book levels are sorted by tick (ascending for sell side, descending for buy side).
2635
3694
  */
2636
3695
  get: {
2637
3696
  parameters: {
2638
3697
  query?: {
2639
3698
  /**
2640
- * @description Maximum number of price levels to return.
3699
+ * @description Maximum number of tick levels to return.
2641
3700
  * @example 10
2642
3701
  */
2643
3702
  limit?: number;
@@ -2753,7 +3812,7 @@ interface paths {
2753
3812
  };
2754
3813
  /**
2755
3814
  * Get config rules
2756
- * @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
3815
+ * @description Returns configured rules (maturities, loan tokens, collateral tokens, oracles) for supported chains.
2757
3816
  */
2758
3817
  get: {
2759
3818
  parameters: {
@@ -2765,7 +3824,7 @@ interface paths {
2765
3824
  chains?: number[];
2766
3825
  /**
2767
3826
  * @description Filter by rule types (comma-separated).
2768
- * @example maturity,loan_token,oracle
3827
+ * @example maturity,loan_token,collateral_token,oracle
2769
3828
  */
2770
3829
  types?: string[];
2771
3830
  /**
@@ -3145,7 +4204,7 @@ interface paths {
3145
4204
  };
3146
4205
  /**
3147
4206
  * Get user positions
3148
- * @description Returns positions for a user with reserved balance. The reserved balance is the amount locked by active offers (max lot upper - offset - consumed).
4207
+ * @description Returns positions for a user with reserved balance per obligation. Each (position, obligation) pair is returned as a separate row. Positions with no lots return a single row with obligation_id = null and reserved = 0.
3149
4208
  */
3150
4209
  get: {
3151
4210
  parameters: {
@@ -3254,14 +4313,19 @@ interface components {
3254
4313
  schemas: {
3255
4314
  BookListResponse: {
3256
4315
  meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
3257
- cursor: string | null; /** @description Aggregated book levels grouped by computed price. */
4316
+ cursor: string | null; /** @description Aggregated book levels grouped by offer tick. */
3258
4317
  data: components["schemas"]["BookLevelResponse"][];
3259
4318
  };
3260
4319
  Meta: {
3261
4320
  /** @example 2024-01-01T12:00:00.000Z */timestamp: string;
3262
4321
  };
3263
4322
  BookLevelResponse: {
3264
- /** @example 2750000000000000000 */price: string; /** @example 369216000000000000000000 */
4323
+ /** @example 495 */tick: number;
4324
+ /**
4325
+ * @description Price derived from tick, scaled by 1e18.
4326
+ * @example 500000000000000000
4327
+ */
4328
+ price: string; /** @example 369216000000000000000000 */
3265
4329
  assets: string; /** @example 5 */
3266
4330
  count: number;
3267
4331
  };
@@ -3338,6 +4402,11 @@ interface components {
3338
4402
  * "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
3339
4403
  * },
3340
4404
  * {
4405
+ * "type": "collateral_token",
4406
+ * "chain_id": 1,
4407
+ * "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
4408
+ * },
4409
+ * {
3341
4410
  * "type": "oracle",
3342
4411
  * "chain_id": 1,
3343
4412
  * "address": "0xDddd770BADd886dF3864029e4B377B5F6a2B6b83"
@@ -3387,7 +4456,7 @@ interface components {
3387
4456
  * "obligation_shares": "0",
3388
4457
  * "start": 1761922790,
3389
4458
  * "expiry": 1761922799,
3390
- * "price": "2750000000000000000",
4459
+ * "tick": 495,
3391
4460
  * "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
3392
4461
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
3393
4462
  * "callback": "0x0000000000000000000000000000000000000000",
@@ -3431,7 +4500,7 @@ interface components {
3431
4500
  * "obligation_shares": "0",
3432
4501
  * "start": 1761922790,
3433
4502
  * "expiry": 1761922799,
3434
- * "price": "2750000000000000000",
4503
+ * "tick": 495,
3435
4504
  * "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
3436
4505
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
3437
4506
  * "callback": "0x0000000000000000000000000000000000000000",
@@ -3476,8 +4545,8 @@ interface components {
3476
4545
  obligation_units: string; /** @example 0 */
3477
4546
  obligation_shares: string; /** @example 1761922790 */
3478
4547
  start: number; /** @example 1761922799 */
3479
- expiry: number; /** @example 2750000000000000000 */
3480
- price: string; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
4548
+ expiry: number; /** @example 495 */
4549
+ tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
3481
4550
  group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
3482
4551
  session: string; /** @example 0x0000000000000000000000000000000000000000 */
3483
4552
  callback: string; /** @example 0x */
@@ -3626,6 +4695,7 @@ interface components {
3626
4695
  * "chain_id": 1,
3627
4696
  * "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
3628
4697
  * "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4698
+ * "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
3629
4699
  * "reserved": "200000000000000000000",
3630
4700
  * "block_number": 21345678
3631
4701
  * }
@@ -3636,7 +4706,12 @@ interface components {
3636
4706
  PositionListItemResponse: {
3637
4707
  /** @example 1 */chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
3638
4708
  contract: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
3639
- user: string; /** @example 200000000000000000000 */
4709
+ user: string;
4710
+ /**
4711
+ * @description Obligation id this reserved amount belongs to, or null if no lots exist.
4712
+ * @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67
4713
+ */
4714
+ obligation_id: string | null; /** @example 200000000000000000000 */
3640
4715
  reserved: string; /** @example 21345678 */
3641
4716
  block_number: number;
3642
4717
  };
@@ -3647,8 +4722,8 @@ interface components {
3647
4722
  /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
3648
4723
  assets: string; /** @example 0 */
3649
4724
  obligation_units?: string; /** @example 0 */
3650
- obligation_shares?: string; /** @example 2750000000000000000 */
3651
- price: string; /** @example 1761922799 */
4725
+ obligation_shares?: string; /** @example 495 */
4726
+ tick: number; /** @example 1761922799 */
3652
4727
  maturity: number; /** @example 1761922799 */
3653
4728
  expiry: number; /** @example 1761922790 */
3654
4729
  start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
@@ -3729,7 +4804,7 @@ type Input = Readonly<{
3729
4804
  assets: bigint;
3730
4805
  obligationUnits: bigint;
3731
4806
  obligationShares: bigint;
3732
- price: bigint;
4807
+ tick: number;
3733
4808
  maturity: number;
3734
4809
  expiry: number;
3735
4810
  start: number;
@@ -3798,6 +4873,7 @@ type PositionResponse = {
3798
4873
  chain_id: Id;
3799
4874
  contract: Address;
3800
4875
  user: Address;
4876
+ obligation_id: string | null;
3801
4877
  reserved: string;
3802
4878
  block_number: number;
3803
4879
  };
@@ -3844,10 +4920,11 @@ declare const schemas: {
3844
4920
  cursor: z$1.ZodOptional<z$1.ZodString>;
3845
4921
  limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
3846
4922
  types: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodEnum<{
3847
- loan_token: "loan_token";
4923
+ oracle: "oracle";
3848
4924
  maturity: "maturity";
3849
4925
  callback: "callback";
3850
- oracle: "oracle";
4926
+ loan_token: "loan_token";
4927
+ collateral_token: "collateral_token";
3851
4928
  }>>>>;
3852
4929
  chains: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>>>>;
3853
4930
  }, z$1.core.$strip>;
@@ -4003,16 +5080,17 @@ type GetOffersQueryParams = {
4003
5080
  cursor?: string; /** Page size; defaults to {@link OffersDomain.DEFAULT_LIMIT} */
4004
5081
  limit?: number;
4005
5082
  };
5083
+ type OffersRowsResult = {
5084
+ rows: Row[];
5085
+ nextCursor: string | null;
5086
+ };
4006
5087
  /**
4007
5088
  * Query offers with computed consumed/available/takeable values.
4008
5089
  * @param db - The database client. {@link Database.Core}
4009
5090
  * @param parameters - {@link GetOffersQueryParams}
4010
5091
  * @returns The offers with pagination cursor.
4011
5092
  */
4012
- declare function getOffersQuery(db: Core, parameters?: GetOffersQueryParams): Promise<{
4013
- rows: Row[];
4014
- nextCursor: string | null;
4015
- }>;
5093
+ declare function getOffersQuery(db: Core, parameters?: GetOffersQueryParams): Promise<OffersRowsResult>;
4016
5094
  declare function getOffers$1(queryParameters: object, db: Database): Promise<Payload<OfferResponse[]>>;
4017
5095
  //#endregion
4018
5096
  //#region src/api/Controllers/getUserPositions.d.ts
@@ -4191,7 +5269,7 @@ declare class HttpGetApiFailedError extends BaseError {
4191
5269
  }
4192
5270
  //#endregion
4193
5271
  //#region src/database/drizzle/VERSION.d.ts
4194
- declare const VERSION: "router_v1.6";
5272
+ declare const VERSION: "router_v1.8";
4195
5273
  //#endregion
4196
5274
  //#region src/database/drizzle/schema.d.ts
4197
5275
  declare enum EnumTableName {
@@ -4214,12 +5292,12 @@ declare enum EnumTableName {
4214
5292
  MERKLE_PATHS = "merkle_paths"
4215
5293
  }
4216
5294
  declare const TABLE_NAMES: readonly EnumTableName[];
4217
- declare const VERSIONED_TABLE_NAMES: ("\"router_v1.6\".\"obligations\"" | "\"router_v1.6\".\"groups\"" | "\"router_v1.6\".\"consumed_events\"" | "\"router_v1.6\".\"obligation_collaterals_v2\"" | "\"router_v1.6\".\"oracles\"" | "\"router_v1.6\".\"offers\"" | "\"router_v1.6\".\"offers_callbacks\"" | "\"router_v1.6\".\"callbacks\"" | "\"router_v1.6\".\"positions\"" | "\"router_v1.6\".\"transfers\"" | "\"router_v1.6\".\"validations\"" | "\"router_v1.6\".\"collectors\"" | "\"router_v1.6\".\"chains\"" | "\"router_v1.6\".\"lots\"" | "\"router_v1.6\".\"offsets\"" | "\"router_v1.6\".\"trees\"" | "\"router_v1.6\".\"merkle_paths\"")[];
5295
+ declare const VERSIONED_TABLE_NAMES: ("\"router_v1.8\".\"obligations\"" | "\"router_v1.8\".\"groups\"" | "\"router_v1.8\".\"consumed_events\"" | "\"router_v1.8\".\"obligation_collaterals_v2\"" | "\"router_v1.8\".\"oracles\"" | "\"router_v1.8\".\"offers\"" | "\"router_v1.8\".\"offers_callbacks\"" | "\"router_v1.8\".\"callbacks\"" | "\"router_v1.8\".\"positions\"" | "\"router_v1.8\".\"transfers\"" | "\"router_v1.8\".\"validations\"" | "\"router_v1.8\".\"collectors\"" | "\"router_v1.8\".\"chains\"" | "\"router_v1.8\".\"lots\"" | "\"router_v1.8\".\"offsets\"" | "\"router_v1.8\".\"trees\"" | "\"router_v1.8\".\"merkle_paths\"")[];
4218
5296
  type TableName = (typeof TABLE_NAMES)[number];
4219
5297
  type VersionedTableName = `"${typeof VERSION}"."${TableName}"`;
4220
5298
  declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
4221
5299
  name: EnumTableName.OBLIGATIONS;
4222
- schema: "router_v1.6";
5300
+ schema: "router_v1.8";
4223
5301
  columns: {
4224
5302
  obligationId: drizzle_orm_pg_core0.PgColumn<{
4225
5303
  name: "obligation_id";
@@ -4300,7 +5378,7 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
4300
5378
  }>;
4301
5379
  declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
4302
5380
  name: EnumTableName.GROUPS;
4303
- schema: "router_v1.6";
5381
+ schema: "router_v1.8";
4304
5382
  columns: {
4305
5383
  chainId: drizzle_orm_pg_core0.PgColumn<{
4306
5384
  name: "chain_id";
@@ -4415,7 +5493,7 @@ declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
4415
5493
  }>;
4416
5494
  declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
4417
5495
  name: EnumTableName.CONSUMED_EVENTS;
4418
- schema: "router_v1.6";
5496
+ schema: "router_v1.8";
4419
5497
  columns: {
4420
5498
  eventId: drizzle_orm_pg_core0.PgColumn<{
4421
5499
  name: "event_id";
@@ -4549,7 +5627,7 @@ declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
4549
5627
  }>;
4550
5628
  declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
4551
5629
  name: EnumTableName.OBLIGATION_COLLATERALS_V2;
4552
- schema: "router_v1.6";
5630
+ schema: "router_v1.8";
4553
5631
  columns: {
4554
5632
  obligationId: drizzle_orm_pg_core0.PgColumn<{
4555
5633
  name: "obligation_id";
@@ -4666,7 +5744,7 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
4666
5744
  }>;
4667
5745
  declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
4668
5746
  name: EnumTableName.ORACLES;
4669
- schema: "router_v1.6";
5747
+ schema: "router_v1.8";
4670
5748
  columns: {
4671
5749
  chainId: drizzle_orm_pg_core0.PgColumn<{
4672
5750
  name: "chain_id";
@@ -4762,7 +5840,7 @@ declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
4762
5840
  }>;
4763
5841
  declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
4764
5842
  name: EnumTableName.OFFERS;
4765
- schema: "router_v1.6";
5843
+ schema: "router_v1.8";
4766
5844
  columns: {
4767
5845
  hash: drizzle_orm_pg_core0.PgColumn<{
4768
5846
  name: "hash";
@@ -4853,13 +5931,13 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
4853
5931
  identity: undefined;
4854
5932
  generated: undefined;
4855
5933
  }, {}, {}>;
4856
- price: drizzle_orm_pg_core0.PgColumn<{
4857
- name: "price";
5934
+ tick: drizzle_orm_pg_core0.PgColumn<{
5935
+ name: "tick";
4858
5936
  tableName: EnumTableName.OFFERS;
4859
- dataType: "string";
4860
- columnType: "PgNumeric";
4861
- data: string;
4862
- driverParam: string;
5937
+ dataType: "number";
5938
+ columnType: "PgInteger";
5939
+ data: number;
5940
+ driverParam: string | number;
4863
5941
  notNull: true;
4864
5942
  hasDefault: false;
4865
5943
  isPrimaryKey: false;
@@ -5089,7 +6167,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
5089
6167
  }>;
5090
6168
  declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
5091
6169
  name: EnumTableName.OFFERS_CALLBACKS;
5092
- schema: "router_v1.6";
6170
+ schema: "router_v1.8";
5093
6171
  columns: {
5094
6172
  offerHash: drizzle_orm_pg_core0.PgColumn<{
5095
6173
  name: "offer_hash";
@@ -5134,7 +6212,7 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
5134
6212
  }>;
5135
6213
  declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
5136
6214
  name: EnumTableName.CALLBACKS;
5137
- schema: "router_v1.6";
6215
+ schema: "router_v1.8";
5138
6216
  columns: {
5139
6217
  id: drizzle_orm_pg_core0.PgColumn<{
5140
6218
  name: "id";
@@ -5234,7 +6312,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
5234
6312
  }>;
5235
6313
  declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
5236
6314
  name: EnumTableName.LOTS;
5237
- schema: "router_v1.6";
6315
+ schema: "router_v1.8";
5238
6316
  columns: {
5239
6317
  chainId: drizzle_orm_pg_core0.PgColumn<{
5240
6318
  name: "chain_id";
@@ -5312,6 +6390,25 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
5312
6390
  }, {}, {
5313
6391
  length: 66;
5314
6392
  }>;
6393
+ obligationId: drizzle_orm_pg_core0.PgColumn<{
6394
+ name: "obligation_id";
6395
+ tableName: EnumTableName.LOTS;
6396
+ dataType: "string";
6397
+ columnType: "PgVarchar";
6398
+ data: string;
6399
+ driverParam: string;
6400
+ notNull: true;
6401
+ hasDefault: false;
6402
+ isPrimaryKey: false;
6403
+ isAutoincrement: false;
6404
+ hasRuntimeDefault: false;
6405
+ enumValues: [string, ...string[]];
6406
+ baseColumn: never;
6407
+ identity: undefined;
6408
+ generated: undefined;
6409
+ }, {}, {
6410
+ length: 66;
6411
+ }>;
5315
6412
  lower: drizzle_orm_pg_core0.PgColumn<{
5316
6413
  name: "lower";
5317
6414
  tableName: EnumTableName.LOTS;
@@ -5351,7 +6448,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
5351
6448
  }>;
5352
6449
  declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
5353
6450
  name: EnumTableName.OFFSETS;
5354
- schema: "router_v1.6";
6451
+ schema: "router_v1.8";
5355
6452
  columns: {
5356
6453
  chainId: drizzle_orm_pg_core0.PgColumn<{
5357
6454
  name: "chain_id";
@@ -5429,6 +6526,25 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
5429
6526
  }, {}, {
5430
6527
  length: 66;
5431
6528
  }>;
6529
+ obligationId: drizzle_orm_pg_core0.PgColumn<{
6530
+ name: "obligation_id";
6531
+ tableName: EnumTableName.OFFSETS;
6532
+ dataType: "string";
6533
+ columnType: "PgVarchar";
6534
+ data: string;
6535
+ driverParam: string;
6536
+ notNull: true;
6537
+ hasDefault: false;
6538
+ isPrimaryKey: false;
6539
+ isAutoincrement: false;
6540
+ hasRuntimeDefault: false;
6541
+ enumValues: [string, ...string[]];
6542
+ baseColumn: never;
6543
+ identity: undefined;
6544
+ generated: undefined;
6545
+ }, {}, {
6546
+ length: 66;
6547
+ }>;
5432
6548
  value: drizzle_orm_pg_core0.PgColumn<{
5433
6549
  name: "value";
5434
6550
  tableName: EnumTableName.OFFSETS;
@@ -5452,7 +6568,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
5452
6568
  declare const PositionTypes: drizzle_orm_pg_core0.PgEnum<[Type, ...Type[]]>;
5453
6569
  declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
5454
6570
  name: "position_types";
5455
- schema: "router_v1.6";
6571
+ schema: "router_v1.8";
5456
6572
  columns: {
5457
6573
  id: drizzle_orm_pg_core0.PgColumn<{
5458
6574
  name: "id";
@@ -5493,7 +6609,7 @@ declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
5493
6609
  }>;
5494
6610
  declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
5495
6611
  name: EnumTableName.POSITIONS;
5496
- schema: "router_v1.6";
6612
+ schema: "router_v1.8";
5497
6613
  columns: {
5498
6614
  chainId: drizzle_orm_pg_core0.PgColumn<{
5499
6615
  name: "chain_id";
@@ -5644,7 +6760,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
5644
6760
  }>;
5645
6761
  declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
5646
6762
  name: EnumTableName.TRANSFERS;
5647
- schema: "router_v1.6";
6763
+ schema: "router_v1.8";
5648
6764
  columns: {
5649
6765
  eventId: drizzle_orm_pg_core0.PgColumn<{
5650
6766
  name: "event_id";
@@ -5798,7 +6914,7 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
5798
6914
  declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
5799
6915
  declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
5800
6916
  name: "status";
5801
- schema: "router_v1.6";
6917
+ schema: "router_v1.8";
5802
6918
  columns: {
5803
6919
  id: drizzle_orm_pg_core0.PgColumn<{
5804
6920
  name: "id";
@@ -5839,7 +6955,7 @@ declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
5839
6955
  }>;
5840
6956
  declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
5841
6957
  name: "validations";
5842
- schema: "router_v1.6";
6958
+ schema: "router_v1.8";
5843
6959
  columns: {
5844
6960
  offerHash: drizzle_orm_pg_core0.PgColumn<{
5845
6961
  name: "offer_hash";
@@ -5899,7 +7015,7 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
5899
7015
  }>;
5900
7016
  declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
5901
7017
  name: EnumTableName.COLLECTORS;
5902
- schema: "router_v1.6";
7018
+ schema: "router_v1.8";
5903
7019
  columns: {
5904
7020
  chainId: drizzle_orm_pg_core0.PgColumn<{
5905
7021
  name: "chain_id";
@@ -5995,7 +7111,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
5995
7111
  }>;
5996
7112
  declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
5997
7113
  name: EnumTableName.CHAINS;
5998
- schema: "router_v1.6";
7114
+ schema: "router_v1.8";
5999
7115
  columns: {
6000
7116
  chainId: drizzle_orm_pg_core0.PgColumn<{
6001
7117
  name: "chain_id";
@@ -6072,7 +7188,7 @@ declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
6072
7188
  }>;
6073
7189
  declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
6074
7190
  name: EnumTableName.TREES;
6075
- schema: "router_v1.6";
7191
+ schema: "router_v1.8";
6076
7192
  columns: {
6077
7193
  root: drizzle_orm_pg_core0.PgColumn<{
6078
7194
  name: "root";
@@ -6134,7 +7250,7 @@ declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
6134
7250
  }>;
6135
7251
  declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
6136
7252
  name: EnumTableName.MERKLE_PATHS;
6137
- schema: "router_v1.6";
7253
+ schema: "router_v1.8";
6138
7254
  columns: {
6139
7255
  offerHash: drizzle_orm_pg_core0.PgColumn<{
6140
7256
  name: "offer_hash";
@@ -6216,9 +7332,9 @@ declare namespace index_d_exports$2 {
6216
7332
  }
6217
7333
  //#endregion
6218
7334
  //#region src/gatekeeper/morphoRules.d.ts
6219
- declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "token"> | Rule<Offer, "oracle">)[];
7335
+ declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "loan_token"> | Rule<Offer, "collateral_token"> | Rule<Offer, "oracle">)[];
6220
7336
  declare namespace Rules_d_exports {
6221
- export { ValidityParameters, amountMutualExclusivity, callback, chains, maturity, oracle, sameMaker, token, validity };
7337
+ export { ValidityParameters, amountMutualExclusivity, callback, chains, collateralToken, loanToken, maturity, oracle, sameMaker, validity };
6222
7338
  }
6223
7339
  type ValidityParameters = {
6224
7340
  client: PublicClient<Transport, Chain$1>;
@@ -6247,15 +7363,25 @@ declare const callback: ({
6247
7363
  allowedAddresses: Address[];
6248
7364
  }) => Rule<Offer, "callback">;
6249
7365
  /**
6250
- * A validation rule that checks if the offer's tokens are allowed for its chain.
6251
- * @param assetsByChainId - Allowed assets indexed by chain id.
7366
+ * A validation rule that checks if the offer's loan token is allowed for its chain.
7367
+ * @param assetsByChainId - Allowed loan tokens indexed by chain id.
6252
7368
  * @returns The issue that was found. If the offer is valid, this will be undefined.
6253
7369
  */
6254
- declare const token: ({
7370
+ declare const loanToken: ({
6255
7371
  assetsByChainId
6256
7372
  }: {
6257
7373
  assetsByChainId: Partial<Record<Id, Address[]>>;
6258
- }) => Rule<Offer, "token">;
7374
+ }) => Rule<Offer, "loan_token">;
7375
+ /**
7376
+ * A validation rule that checks if the offer's collateral tokens are allowed for its chain.
7377
+ * @param collateralAssetsByChainId - Allowed collateral tokens indexed by chain id.
7378
+ * @returns The issue that was found. If the offer is valid, this will be undefined.
7379
+ */
7380
+ declare const collateralToken: ({
7381
+ collateralAssetsByChainId
7382
+ }: {
7383
+ collateralAssetsByChainId: Partial<Record<Id, Address[]>>;
7384
+ }) => Rule<Offer, "collateral_token">;
6259
7385
  /**
6260
7386
  * A validation rule that checks if the offer's oracle addresses are allowed for its chain.
6261
7387
  * @param oraclesByChainId - Allowed oracles indexed by chain id.
@@ -6512,5 +7638,5 @@ declare namespace index_d_exports$3 {
6512
7638
  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$1 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
6513
7639
  }
6514
7640
  //#endregion
6515
- export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainHealth, ChainRegistry_d_exports as ChainRegistry, ChainsHealthResponse, Collateral_d_exports as Collateral, CollectorHealth, CollectorsHealthResponse, Compute, ConfigContractsController, ConfigRule, ConfigRulesController, ConfigRulesPayload, Database_d_exports as Database, 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, Health_d_exports as Health, HealthController, Indexer_d_exports as Indexer, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Logger_d_exports as Logger, Maturity_d_exports as Maturity, index_d_exports$1 as Mempool, Obligation_d_exports as Obligation, ObligationResponse_d_exports as ObligationResponse, ObligationsController, Offer_d_exports as Offer, OfferResponse_d_exports as OfferResponse, OffersController, index_d_exports$2 as OffersSchema, OpenApi, Oracle_d_exports as Oracle, Position_d_exports as Position, PositionResponse_d_exports as PositionResponse, Quote_d_exports as Quote, RouterApi_d_exports as RouterApi, Client_d_exports$1 as RouterClient, RouterStatusResponse, Rules_d_exports as Rules, SuccessPayload, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, UsersController, index_d_exports$3 as Utils, ValidateController, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules, parse, safeParse };
7641
+ export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainHealth, ChainRegistry_d_exports as ChainRegistry, ChainsHealthResponse, Collateral_d_exports as Collateral, CollectorHealth, CollectorsHealthResponse, Compute, ConfigContractsController, ConfigRule, ConfigRulesController, ConfigRulesPayload, Database_d_exports as Database, 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, Health_d_exports as Health, HealthController, Indexer_d_exports as Indexer, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Logger_d_exports as Logger, Maturity_d_exports as Maturity, index_d_exports$1 as Mempool, Obligation_d_exports as Obligation, ObligationResponse_d_exports as ObligationResponse, ObligationsController, Offer_d_exports as Offer, OfferResponse_d_exports as OfferResponse, OffersController, index_d_exports$2 as OffersSchema, OpenApi, Oracle_d_exports as Oracle, Position_d_exports as Position, PositionResponse_d_exports as PositionResponse, Quote_d_exports as Quote, RouterApi_d_exports as RouterApi, Client_d_exports$1 as RouterClient, RouterStatusResponse, 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, UsersController, index_d_exports$3 as Utils, ValidateController, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules, parse, safeParse };
6516
7642
  //# sourceMappingURL=index.node.d.mts.map