@morpho-dev/router 0.1.18 → 0.2.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 (53) hide show
  1. package/README.md +29 -19
  2. package/dist/chunk-jass6xSI.mjs +13 -0
  3. package/dist/cli.js +6574 -6194
  4. package/dist/drizzle/migrations/0000_setup_single_migration_folder.sql +204 -0
  5. package/dist/drizzle/migrations/0001_add-trigger-for-consumed-events.sql +58 -0
  6. package/dist/drizzle/migrations/0002_insert-status-code.sql +1 -0
  7. package/dist/drizzle/migrations/0003_update-triggers-for-consumed-events.sql +3 -0
  8. package/dist/drizzle/migrations/0004_drop-status-offers-foreign-key-constraint.sql +1 -0
  9. package/dist/drizzle/migrations/0005_add-index-to-boost-group-query-and-offer-hash.sql +1 -0
  10. package/dist/drizzle/migrations/0006_add-callbacks-and-positions-relations.sql +37 -0
  11. package/dist/drizzle/migrations/0008_validation.sql +15 -0
  12. package/dist/drizzle/migrations/0009_add-transfers-table.sql +14 -0
  13. package/dist/drizzle/migrations/0010_add-price.sql +1 -0
  14. package/dist/drizzle/migrations/0011_nullable-callback-amount.sql +1 -0
  15. package/dist/drizzle/migrations/0012_add-position-asset.sql +1 -0
  16. package/dist/drizzle/migrations/0013_remove-depecrated-domains.sql +13 -0
  17. package/dist/drizzle/migrations/0014_rename-offers-v2-into-offers.sql +23 -0
  18. package/dist/drizzle/{router_v1.4 → migrations}/meta/0000_snapshot.json +858 -78
  19. package/dist/drizzle/migrations/meta/0001_snapshot.json +1752 -0
  20. package/dist/drizzle/migrations/meta/0002_snapshot.json +1752 -0
  21. package/dist/drizzle/migrations/meta/0003_snapshot.json +1752 -0
  22. package/dist/drizzle/{router_v1.4/meta/0001_snapshot.json → migrations/meta/0004_snapshot.json} +848 -78
  23. package/dist/drizzle/migrations/meta/0005_snapshot.json +1775 -0
  24. package/dist/drizzle/migrations/meta/0006_snapshot.json +1973 -0
  25. package/dist/drizzle/migrations/meta/0008_snapshot.json +1955 -0
  26. package/dist/drizzle/migrations/meta/0009_snapshot.json +2078 -0
  27. package/dist/drizzle/migrations/meta/0010_snapshot.json +2084 -0
  28. package/dist/drizzle/migrations/meta/0013_snapshot.json +1290 -0
  29. package/dist/drizzle/migrations/meta/0014_snapshot.json +1290 -0
  30. package/dist/drizzle/migrations/meta/_journal.json +104 -0
  31. package/dist/index.browser.d.mts +2794 -0
  32. package/dist/index.browser.d.mts.map +1 -0
  33. package/dist/index.browser.d.ts +2290 -1172
  34. package/dist/index.browser.d.ts.map +1 -0
  35. package/dist/index.browser.js +3820 -2519
  36. package/dist/index.browser.js.map +1 -1
  37. package/dist/index.browser.mjs +3615 -2467
  38. package/dist/index.browser.mjs.map +1 -1
  39. package/dist/index.node.d.mts +4987 -0
  40. package/dist/index.node.d.mts.map +1 -0
  41. package/dist/index.node.d.ts +4423 -2906
  42. package/dist/index.node.d.ts.map +1 -0
  43. package/dist/index.node.js +7810 -6141
  44. package/dist/index.node.js.map +1 -1
  45. package/dist/index.node.mjs +7556 -6102
  46. package/dist/index.node.mjs.map +1 -1
  47. package/package.json +29 -15
  48. package/dist/cli.js.map +0 -1
  49. package/dist/drizzle/router_v1.4/0000_add_obligation_id.sql +0 -112
  50. package/dist/drizzle/router_v1.4/0001_update-primary-key-on-link.sql +0 -3
  51. package/dist/drizzle/router_v1.4/meta/_journal.json +0 -20
  52. package/dist/index.browser.d.cts +0 -1675
  53. package/dist/index.node.d.cts +0 -3471
@@ -1,12 +1,12 @@
1
1
  {
2
- "id": "66d93695-4e6b-4e8b-a439-f2150032c256",
3
- "prevId": "bfd47937-9ca3-488e-96ec-b040b921e884",
2
+ "id": "453dc50d-cf38-44d6-810f-21d6554add96",
3
+ "prevId": "9ed51909-80f1-43c7-8471-c6886704a6a7",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
6
6
  "tables": {
7
- "router_v1.4.chains": {
7
+ "router_v1.6.chains": {
8
8
  "name": "chains",
9
- "schema": "router_v1.4",
9
+ "schema": "router_v1.6",
10
10
  "columns": {
11
11
  "chain_id": {
12
12
  "name": "chain_id",
@@ -65,9 +65,9 @@
65
65
  "checkConstraints": {},
66
66
  "isRLSEnabled": false
67
67
  },
68
- "router_v1.4.collectors": {
68
+ "router_v1.6.collectors": {
69
69
  "name": "collectors",
70
- "schema": "router_v1.4",
70
+ "schema": "router_v1.6",
71
71
  "columns": {
72
72
  "chain_id": {
73
73
  "name": "chain_id",
@@ -138,9 +138,9 @@
138
138
  "checkConstraints": {},
139
139
  "isRLSEnabled": false
140
140
  },
141
- "router_v1.4.consumed_per_user_and_nonce": {
141
+ "router_v1.6.consumed_per_user_and_nonce": {
142
142
  "name": "consumed_per_user_and_nonce",
143
- "schema": "router_v1.4",
143
+ "schema": "router_v1.6",
144
144
  "columns": {
145
145
  "id": {
146
146
  "name": "id",
@@ -228,9 +228,208 @@
228
228
  "checkConstraints": {},
229
229
  "isRLSEnabled": false
230
230
  },
231
- "router_v1.4.liquidity_links": {
231
+ "router_v1.6.consumed_events": {
232
+ "name": "consumed_events",
233
+ "schema": "router_v1.6",
234
+ "columns": {
235
+ "event_id": {
236
+ "name": "event_id",
237
+ "type": "varchar(128)",
238
+ "primaryKey": true,
239
+ "notNull": true
240
+ },
241
+ "chain_id": {
242
+ "name": "chain_id",
243
+ "type": "bigint",
244
+ "primaryKey": false,
245
+ "notNull": true
246
+ },
247
+ "maker": {
248
+ "name": "maker",
249
+ "type": "varchar(42)",
250
+ "primaryKey": false,
251
+ "notNull": true
252
+ },
253
+ "group": {
254
+ "name": "group",
255
+ "type": "varchar(66)",
256
+ "primaryKey": false,
257
+ "notNull": true
258
+ },
259
+ "amount": {
260
+ "name": "amount",
261
+ "type": "numeric(78, 0)",
262
+ "primaryKey": false,
263
+ "notNull": true
264
+ },
265
+ "block_number": {
266
+ "name": "block_number",
267
+ "type": "bigint",
268
+ "primaryKey": false,
269
+ "notNull": true
270
+ },
271
+ "created_at": {
272
+ "name": "created_at",
273
+ "type": "timestamp",
274
+ "primaryKey": false,
275
+ "notNull": true,
276
+ "default": "now()"
277
+ }
278
+ },
279
+ "indexes": {
280
+ "consumed_events_group_idx": {
281
+ "name": "consumed_events_group_idx",
282
+ "columns": [
283
+ {
284
+ "expression": "chain_id",
285
+ "isExpression": false,
286
+ "asc": true,
287
+ "nulls": "last"
288
+ },
289
+ {
290
+ "expression": "maker",
291
+ "isExpression": false,
292
+ "asc": true,
293
+ "nulls": "last"
294
+ },
295
+ {
296
+ "expression": "group",
297
+ "isExpression": false,
298
+ "asc": true,
299
+ "nulls": "last"
300
+ }
301
+ ],
302
+ "isUnique": false,
303
+ "concurrently": false,
304
+ "method": "btree",
305
+ "with": {}
306
+ },
307
+ "consumed_events_block_number_idx": {
308
+ "name": "consumed_events_block_number_idx",
309
+ "columns": [
310
+ {
311
+ "expression": "block_number",
312
+ "isExpression": false,
313
+ "asc": true,
314
+ "nulls": "last"
315
+ }
316
+ ],
317
+ "isUnique": false,
318
+ "concurrently": false,
319
+ "method": "btree",
320
+ "with": {}
321
+ }
322
+ },
323
+ "foreignKeys": {
324
+ "consumed_events_groups_fk": {
325
+ "name": "consumed_events_groups_fk",
326
+ "tableFrom": "consumed_events",
327
+ "tableTo": "groups",
328
+ "schemaTo": "router_v1.6",
329
+ "columnsFrom": ["chain_id", "maker", "group"],
330
+ "columnsTo": ["chain_id", "maker", "group"],
331
+ "onDelete": "cascade",
332
+ "onUpdate": "no action"
333
+ }
334
+ },
335
+ "compositePrimaryKeys": {},
336
+ "uniqueConstraints": {},
337
+ "policies": {},
338
+ "checkConstraints": {},
339
+ "isRLSEnabled": false
340
+ },
341
+ "router_v1.6.groups": {
342
+ "name": "groups",
343
+ "schema": "router_v1.6",
344
+ "columns": {
345
+ "chain_id": {
346
+ "name": "chain_id",
347
+ "type": "bigint",
348
+ "primaryKey": false,
349
+ "notNull": true
350
+ },
351
+ "maker": {
352
+ "name": "maker",
353
+ "type": "varchar(42)",
354
+ "primaryKey": false,
355
+ "notNull": true
356
+ },
357
+ "group": {
358
+ "name": "group",
359
+ "type": "varchar(66)",
360
+ "primaryKey": false,
361
+ "notNull": true
362
+ },
363
+ "consumed": {
364
+ "name": "consumed",
365
+ "type": "numeric(78, 0)",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "block_number": {
370
+ "name": "block_number",
371
+ "type": "bigint",
372
+ "primaryKey": false,
373
+ "notNull": true
374
+ },
375
+ "updated_at": {
376
+ "name": "updated_at",
377
+ "type": "timestamp",
378
+ "primaryKey": false,
379
+ "notNull": true,
380
+ "default": "now()"
381
+ }
382
+ },
383
+ "indexes": {
384
+ "groups_chain_id_maker_group_consumed_idx": {
385
+ "name": "groups_chain_id_maker_group_consumed_idx",
386
+ "columns": [
387
+ {
388
+ "expression": "chain_id",
389
+ "isExpression": false,
390
+ "asc": true,
391
+ "nulls": "last"
392
+ },
393
+ {
394
+ "expression": "maker",
395
+ "isExpression": false,
396
+ "asc": true,
397
+ "nulls": "last"
398
+ },
399
+ {
400
+ "expression": "group",
401
+ "isExpression": false,
402
+ "asc": true,
403
+ "nulls": "last"
404
+ },
405
+ {
406
+ "expression": "consumed",
407
+ "isExpression": false,
408
+ "asc": true,
409
+ "nulls": "last"
410
+ }
411
+ ],
412
+ "isUnique": false,
413
+ "concurrently": false,
414
+ "method": "btree",
415
+ "with": {}
416
+ }
417
+ },
418
+ "foreignKeys": {},
419
+ "compositePrimaryKeys": {
420
+ "groups_pk": {
421
+ "name": "groups_pk",
422
+ "columns": ["chain_id", "maker", "group"]
423
+ }
424
+ },
425
+ "uniqueConstraints": {},
426
+ "policies": {},
427
+ "checkConstraints": {},
428
+ "isRLSEnabled": false
429
+ },
430
+ "router_v1.6.liquidity_links": {
232
431
  "name": "liquidity_links",
233
- "schema": "router_v1.4",
432
+ "schema": "router_v1.6",
234
433
  "columns": {
235
434
  "parent_pool_id": {
236
435
  "name": "parent_pool_id",
@@ -250,6 +449,12 @@
250
449
  "primaryKey": false,
251
450
  "notNull": true
252
451
  },
452
+ "block_number": {
453
+ "name": "block_number",
454
+ "type": "bigint",
455
+ "primaryKey": false,
456
+ "notNull": true
457
+ },
253
458
  "updated_at": {
254
459
  "name": "updated_at",
255
460
  "type": "timestamp",
@@ -295,7 +500,7 @@
295
500
  "name": "liquidity_links_parent_pool_id_liquidity_pools_id_fk",
296
501
  "tableFrom": "liquidity_links",
297
502
  "tableTo": "liquidity_pools",
298
- "schemaTo": "router_v1.4",
503
+ "schemaTo": "router_v1.6",
299
504
  "columnsFrom": ["parent_pool_id"],
300
505
  "columnsTo": ["id"],
301
506
  "onDelete": "cascade",
@@ -305,7 +510,7 @@
305
510
  "name": "liquidity_links_child_pool_id_liquidity_pools_id_fk",
306
511
  "tableFrom": "liquidity_links",
307
512
  "tableTo": "liquidity_pools",
308
- "schemaTo": "router_v1.4",
513
+ "schemaTo": "router_v1.6",
309
514
  "columnsFrom": ["child_pool_id"],
310
515
  "columnsTo": ["id"],
311
516
  "onDelete": "cascade",
@@ -323,9 +528,9 @@
323
528
  "checkConstraints": {},
324
529
  "isRLSEnabled": false
325
530
  },
326
- "router_v1.4.liquidity_pools": {
531
+ "router_v1.6.liquidity_pools": {
327
532
  "name": "liquidity_pools",
328
- "schema": "router_v1.4",
533
+ "schema": "router_v1.6",
329
534
  "columns": {
330
535
  "id": {
331
536
  "name": "id",
@@ -339,6 +544,12 @@
339
544
  "primaryKey": false,
340
545
  "notNull": true
341
546
  },
547
+ "block_number": {
548
+ "name": "block_number",
549
+ "type": "bigint",
550
+ "primaryKey": false,
551
+ "notNull": true
552
+ },
342
553
  "updated_at": {
343
554
  "name": "updated_at",
344
555
  "type": "timestamp",
@@ -355,9 +566,9 @@
355
566
  "checkConstraints": {},
356
567
  "isRLSEnabled": false
357
568
  },
358
- "router_v1.4.obligation_collaterals": {
569
+ "router_v1.6.obligation_collaterals": {
359
570
  "name": "obligation_collaterals",
360
- "schema": "router_v1.4",
571
+ "schema": "router_v1.6",
361
572
  "columns": {
362
573
  "obligation_id": {
363
574
  "name": "obligation_id",
@@ -406,7 +617,7 @@
406
617
  "name": "obligation_collaterals_obligation_id_obligations_obligation_id_fk",
407
618
  "tableFrom": "obligation_collaterals",
408
619
  "tableTo": "obligations",
409
- "schemaTo": "router_v1.4",
620
+ "schemaTo": "router_v1.6",
410
621
  "columnsFrom": ["obligation_id"],
411
622
  "columnsTo": ["obligation_id"],
412
623
  "onDelete": "cascade",
@@ -424,62 +635,43 @@
424
635
  "checkConstraints": {},
425
636
  "isRLSEnabled": false
426
637
  },
427
- "router_v1.4.obligations": {
428
- "name": "obligations",
429
- "schema": "router_v1.4",
638
+ "router_v1.6.obligation_collaterals_v2": {
639
+ "name": "obligation_collaterals_v2",
640
+ "schema": "router_v1.6",
430
641
  "columns": {
431
642
  "obligation_id": {
432
643
  "name": "obligation_id",
433
644
  "type": "varchar(66)",
434
- "primaryKey": true,
435
- "notNull": true
436
- },
437
- "chain_id": {
438
- "name": "chain_id",
439
- "type": "bigint",
440
645
  "primaryKey": false,
441
646
  "notNull": true
442
647
  },
443
- "loan_token": {
444
- "name": "loan_token",
648
+ "asset": {
649
+ "name": "asset",
445
650
  "type": "varchar(42)",
446
651
  "primaryKey": false,
447
652
  "notNull": true
448
653
  },
449
- "maturity": {
450
- "name": "maturity",
451
- "type": "integer",
654
+ "oracle_chain_id": {
655
+ "name": "oracle_chain_id",
656
+ "type": "bigint",
452
657
  "primaryKey": false,
453
658
  "notNull": true
454
- }
455
- },
456
- "indexes": {},
457
- "foreignKeys": {},
458
- "compositePrimaryKeys": {},
459
- "uniqueConstraints": {},
460
- "policies": {},
461
- "checkConstraints": {},
462
- "isRLSEnabled": false
463
- },
464
- "router_v1.4.offer_liquidity_pools": {
465
- "name": "offer_liquidity_pools",
466
- "schema": "router_v1.4",
467
- "columns": {
468
- "offer_hash": {
469
- "name": "offer_hash",
470
- "type": "varchar(66)",
659
+ },
660
+ "oracle_address": {
661
+ "name": "oracle_address",
662
+ "type": "varchar(42)",
471
663
  "primaryKey": false,
472
664
  "notNull": true
473
665
  },
474
- "pool_id": {
475
- "name": "pool_id",
476
- "type": "varchar(255)",
666
+ "lltv": {
667
+ "name": "lltv",
668
+ "type": "bigint",
477
669
  "primaryKey": false,
478
670
  "notNull": true
479
671
  },
480
- "amount": {
481
- "name": "amount",
482
- "type": "numeric(78, 0)",
672
+ "block_number": {
673
+ "name": "block_number",
674
+ "type": "bigint",
483
675
  "primaryKey": false,
484
676
  "notNull": true
485
677
  },
@@ -492,11 +684,32 @@
492
684
  }
493
685
  },
494
686
  "indexes": {
495
- "offer_liquidity_pools_pool_id_idx": {
496
- "name": "offer_liquidity_pools_pool_id_idx",
687
+ "obligation_collaterals_v2_obligation_id_idx": {
688
+ "name": "obligation_collaterals_v2_obligation_id_idx",
497
689
  "columns": [
498
690
  {
499
- "expression": "pool_id",
691
+ "expression": "obligation_id",
692
+ "isExpression": false,
693
+ "asc": true,
694
+ "nulls": "last"
695
+ }
696
+ ],
697
+ "isUnique": false,
698
+ "concurrently": false,
699
+ "method": "btree",
700
+ "with": {}
701
+ },
702
+ "obligation_collaterals_v2_oracle_fk_idx": {
703
+ "name": "obligation_collaterals_v2_oracle_fk_idx",
704
+ "columns": [
705
+ {
706
+ "expression": "oracle_chain_id",
707
+ "isExpression": false,
708
+ "asc": true,
709
+ "nulls": "last"
710
+ },
711
+ {
712
+ "expression": "oracle_address",
500
713
  "isExpression": false,
501
714
  "asc": true,
502
715
  "nulls": "last"
@@ -509,30 +722,153 @@
509
722
  }
510
723
  },
511
724
  "foreignKeys": {
512
- "offer_liquidity_pools_offer_hash_offers_hash_fk": {
513
- "name": "offer_liquidity_pools_offer_hash_offers_hash_fk",
514
- "tableFrom": "offer_liquidity_pools",
515
- "tableTo": "offers",
516
- "schemaTo": "router_v1.4",
517
- "columnsFrom": ["offer_hash"],
518
- "columnsTo": ["hash"],
725
+ "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk": {
726
+ "name": "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk",
727
+ "tableFrom": "obligation_collaterals_v2",
728
+ "tableTo": "obligations",
729
+ "schemaTo": "router_v1.6",
730
+ "columnsFrom": ["obligation_id"],
731
+ "columnsTo": ["obligation_id"],
519
732
  "onDelete": "cascade",
520
733
  "onUpdate": "no action"
521
734
  },
522
- "offer_liquidity_pools_pool_id_liquidity_pools_id_fk": {
523
- "name": "offer_liquidity_pools_pool_id_liquidity_pools_id_fk",
524
- "tableFrom": "offer_liquidity_pools",
525
- "tableTo": "liquidity_pools",
526
- "schemaTo": "router_v1.4",
527
- "columnsFrom": ["pool_id"],
528
- "columnsTo": ["id"],
529
- "onDelete": "cascade",
735
+ "obligation_collaterals_v2_oracles_fk": {
736
+ "name": "obligation_collaterals_v2_oracles_fk",
737
+ "tableFrom": "obligation_collaterals_v2",
738
+ "tableTo": "oracles",
739
+ "schemaTo": "router_v1.6",
740
+ "columnsFrom": ["oracle_chain_id", "oracle_address"],
741
+ "columnsTo": ["chain_id", "address"],
742
+ "onDelete": "no action",
530
743
  "onUpdate": "no action"
531
744
  }
532
745
  },
533
746
  "compositePrimaryKeys": {
534
- "offer_liquidity_pools_pk": {
535
- "name": "offer_liquidity_pools_pk",
747
+ "obligation_collaterals_v2_pk": {
748
+ "name": "obligation_collaterals_v2_pk",
749
+ "columns": ["obligation_id", "asset"]
750
+ }
751
+ },
752
+ "uniqueConstraints": {},
753
+ "policies": {},
754
+ "checkConstraints": {},
755
+ "isRLSEnabled": false
756
+ },
757
+ "router_v1.6.obligations": {
758
+ "name": "obligations",
759
+ "schema": "router_v1.6",
760
+ "columns": {
761
+ "obligation_id": {
762
+ "name": "obligation_id",
763
+ "type": "varchar(66)",
764
+ "primaryKey": true,
765
+ "notNull": true
766
+ },
767
+ "chain_id": {
768
+ "name": "chain_id",
769
+ "type": "bigint",
770
+ "primaryKey": false,
771
+ "notNull": true
772
+ },
773
+ "loan_token": {
774
+ "name": "loan_token",
775
+ "type": "varchar(42)",
776
+ "primaryKey": false,
777
+ "notNull": true
778
+ },
779
+ "maturity": {
780
+ "name": "maturity",
781
+ "type": "integer",
782
+ "primaryKey": false,
783
+ "notNull": true
784
+ }
785
+ },
786
+ "indexes": {},
787
+ "foreignKeys": {},
788
+ "compositePrimaryKeys": {},
789
+ "uniqueConstraints": {},
790
+ "policies": {},
791
+ "checkConstraints": {},
792
+ "isRLSEnabled": false
793
+ },
794
+ "router_v1.6.offer_liquidity_pools": {
795
+ "name": "offer_liquidity_pools",
796
+ "schema": "router_v1.6",
797
+ "columns": {
798
+ "offer_hash": {
799
+ "name": "offer_hash",
800
+ "type": "varchar(66)",
801
+ "primaryKey": false,
802
+ "notNull": true
803
+ },
804
+ "pool_id": {
805
+ "name": "pool_id",
806
+ "type": "varchar(255)",
807
+ "primaryKey": false,
808
+ "notNull": true
809
+ },
810
+ "amount": {
811
+ "name": "amount",
812
+ "type": "numeric(78, 0)",
813
+ "primaryKey": false,
814
+ "notNull": true
815
+ },
816
+ "block_number": {
817
+ "name": "block_number",
818
+ "type": "bigint",
819
+ "primaryKey": false,
820
+ "notNull": true
821
+ },
822
+ "updated_at": {
823
+ "name": "updated_at",
824
+ "type": "timestamp",
825
+ "primaryKey": false,
826
+ "notNull": true,
827
+ "default": "now()"
828
+ }
829
+ },
830
+ "indexes": {
831
+ "offer_liquidity_pools_pool_id_idx": {
832
+ "name": "offer_liquidity_pools_pool_id_idx",
833
+ "columns": [
834
+ {
835
+ "expression": "pool_id",
836
+ "isExpression": false,
837
+ "asc": true,
838
+ "nulls": "last"
839
+ }
840
+ ],
841
+ "isUnique": false,
842
+ "concurrently": false,
843
+ "method": "btree",
844
+ "with": {}
845
+ }
846
+ },
847
+ "foreignKeys": {
848
+ "offer_liquidity_pools_offer_hash_offers_hash_fk": {
849
+ "name": "offer_liquidity_pools_offer_hash_offers_hash_fk",
850
+ "tableFrom": "offer_liquidity_pools",
851
+ "tableTo": "offers",
852
+ "schemaTo": "router_v1.6",
853
+ "columnsFrom": ["offer_hash"],
854
+ "columnsTo": ["hash"],
855
+ "onDelete": "cascade",
856
+ "onUpdate": "no action"
857
+ },
858
+ "offer_liquidity_pools_pool_id_liquidity_pools_id_fk": {
859
+ "name": "offer_liquidity_pools_pool_id_liquidity_pools_id_fk",
860
+ "tableFrom": "offer_liquidity_pools",
861
+ "tableTo": "liquidity_pools",
862
+ "schemaTo": "router_v1.6",
863
+ "columnsFrom": ["pool_id"],
864
+ "columnsTo": ["id"],
865
+ "onDelete": "cascade",
866
+ "onUpdate": "no action"
867
+ }
868
+ },
869
+ "compositePrimaryKeys": {
870
+ "offer_liquidity_pools_pk": {
871
+ "name": "offer_liquidity_pools_pk",
536
872
  "columns": ["offer_hash", "pool_id"]
537
873
  }
538
874
  },
@@ -541,9 +877,80 @@
541
877
  "checkConstraints": {},
542
878
  "isRLSEnabled": false
543
879
  },
544
- "router_v1.4.offers": {
880
+ "router_v1.6.offer_status": {
881
+ "name": "offer_status",
882
+ "schema": "router_v1.6",
883
+ "columns": {
884
+ "offer_hash": {
885
+ "name": "offer_hash",
886
+ "type": "varchar(66)",
887
+ "primaryKey": true,
888
+ "notNull": true
889
+ },
890
+ "status_id": {
891
+ "name": "status_id",
892
+ "type": "serial",
893
+ "primaryKey": false,
894
+ "notNull": true
895
+ },
896
+ "block_number": {
897
+ "name": "block_number",
898
+ "type": "bigint",
899
+ "primaryKey": false,
900
+ "notNull": true
901
+ },
902
+ "updated_at": {
903
+ "name": "updated_at",
904
+ "type": "timestamp",
905
+ "primaryKey": false,
906
+ "notNull": true,
907
+ "default": "now()"
908
+ }
909
+ },
910
+ "indexes": {
911
+ "offer_status_status_hash_idx": {
912
+ "name": "offer_status_status_hash_idx",
913
+ "columns": [
914
+ {
915
+ "expression": "status_id",
916
+ "isExpression": false,
917
+ "asc": true,
918
+ "nulls": "last"
919
+ },
920
+ {
921
+ "expression": "offer_hash",
922
+ "isExpression": false,
923
+ "asc": true,
924
+ "nulls": "last"
925
+ }
926
+ ],
927
+ "isUnique": false,
928
+ "concurrently": false,
929
+ "method": "btree",
930
+ "with": {}
931
+ }
932
+ },
933
+ "foreignKeys": {
934
+ "offer_status_status_id_status_id_fk": {
935
+ "name": "offer_status_status_id_status_id_fk",
936
+ "tableFrom": "offer_status",
937
+ "tableTo": "status",
938
+ "schemaTo": "router_v1.6",
939
+ "columnsFrom": ["status_id"],
940
+ "columnsTo": ["id"],
941
+ "onDelete": "cascade",
942
+ "onUpdate": "no action"
943
+ }
944
+ },
945
+ "compositePrimaryKeys": {},
946
+ "uniqueConstraints": {},
947
+ "policies": {},
948
+ "checkConstraints": {},
949
+ "isRLSEnabled": false
950
+ },
951
+ "router_v1.6.offers": {
545
952
  "name": "offers",
546
- "schema": "router_v1.4",
953
+ "schema": "router_v1.6",
547
954
  "columns": {
548
955
  "hash": {
549
956
  "name": "hash",
@@ -944,7 +1351,7 @@
944
1351
  "name": "offers_obligation_id_obligations_obligation_id_fk",
945
1352
  "tableFrom": "offers",
946
1353
  "tableTo": "obligations",
947
- "schemaTo": "router_v1.4",
1354
+ "schemaTo": "router_v1.6",
948
1355
  "columnsFrom": ["obligation_id"],
949
1356
  "columnsTo": ["obligation_id"],
950
1357
  "onDelete": "cascade",
@@ -956,9 +1363,372 @@
956
1363
  "policies": {},
957
1364
  "checkConstraints": {},
958
1365
  "isRLSEnabled": false
1366
+ },
1367
+ "router_v1.6.offers_v2": {
1368
+ "name": "offers_v2",
1369
+ "schema": "router_v1.6",
1370
+ "columns": {
1371
+ "hash": {
1372
+ "name": "hash",
1373
+ "type": "varchar(66)",
1374
+ "primaryKey": true,
1375
+ "notNull": true
1376
+ },
1377
+ "obligation_id": {
1378
+ "name": "obligation_id",
1379
+ "type": "varchar(66)",
1380
+ "primaryKey": false,
1381
+ "notNull": true
1382
+ },
1383
+ "assets": {
1384
+ "name": "assets",
1385
+ "type": "numeric(78, 0)",
1386
+ "primaryKey": false,
1387
+ "notNull": true
1388
+ },
1389
+ "rate": {
1390
+ "name": "rate",
1391
+ "type": "numeric(78, 0)",
1392
+ "primaryKey": false,
1393
+ "notNull": true
1394
+ },
1395
+ "maturity": {
1396
+ "name": "maturity",
1397
+ "type": "integer",
1398
+ "primaryKey": false,
1399
+ "notNull": true
1400
+ },
1401
+ "expiry": {
1402
+ "name": "expiry",
1403
+ "type": "integer",
1404
+ "primaryKey": false,
1405
+ "notNull": true
1406
+ },
1407
+ "start": {
1408
+ "name": "start",
1409
+ "type": "integer",
1410
+ "primaryKey": false,
1411
+ "notNull": true
1412
+ },
1413
+ "group_chain_id": {
1414
+ "name": "group_chain_id",
1415
+ "type": "bigint",
1416
+ "primaryKey": false,
1417
+ "notNull": true
1418
+ },
1419
+ "group_maker": {
1420
+ "name": "group_maker",
1421
+ "type": "varchar(42)",
1422
+ "primaryKey": false,
1423
+ "notNull": true
1424
+ },
1425
+ "group_group": {
1426
+ "name": "group_group",
1427
+ "type": "varchar(66)",
1428
+ "primaryKey": false,
1429
+ "notNull": true
1430
+ },
1431
+ "nonce": {
1432
+ "name": "nonce",
1433
+ "type": "varchar(66)",
1434
+ "primaryKey": false,
1435
+ "notNull": true
1436
+ },
1437
+ "buy": {
1438
+ "name": "buy",
1439
+ "type": "boolean",
1440
+ "primaryKey": false,
1441
+ "notNull": true
1442
+ },
1443
+ "callback_address": {
1444
+ "name": "callback_address",
1445
+ "type": "varchar(42)",
1446
+ "primaryKey": false,
1447
+ "notNull": true
1448
+ },
1449
+ "callback_data": {
1450
+ "name": "callback_data",
1451
+ "type": "text",
1452
+ "primaryKey": false,
1453
+ "notNull": true
1454
+ },
1455
+ "block_number": {
1456
+ "name": "block_number",
1457
+ "type": "bigint",
1458
+ "primaryKey": false,
1459
+ "notNull": true
1460
+ },
1461
+ "updated_at": {
1462
+ "name": "updated_at",
1463
+ "type": "timestamp",
1464
+ "primaryKey": false,
1465
+ "notNull": true,
1466
+ "default": "now()"
1467
+ }
1468
+ },
1469
+ "indexes": {
1470
+ "offers_v2_group_fk_idx": {
1471
+ "name": "offers_v2_group_fk_idx",
1472
+ "columns": [
1473
+ {
1474
+ "expression": "group_chain_id",
1475
+ "isExpression": false,
1476
+ "asc": true,
1477
+ "nulls": "last"
1478
+ },
1479
+ {
1480
+ "expression": "group_maker",
1481
+ "isExpression": false,
1482
+ "asc": true,
1483
+ "nulls": "last"
1484
+ },
1485
+ {
1486
+ "expression": "group_group",
1487
+ "isExpression": false,
1488
+ "asc": true,
1489
+ "nulls": "last"
1490
+ }
1491
+ ],
1492
+ "isUnique": false,
1493
+ "concurrently": false,
1494
+ "method": "btree",
1495
+ "with": {}
1496
+ },
1497
+ "offers_v2_group_winner_sell_side_idx": {
1498
+ "name": "offers_v2_group_winner_sell_side_idx",
1499
+ "columns": [
1500
+ {
1501
+ "expression": "group_chain_id",
1502
+ "isExpression": false,
1503
+ "asc": true,
1504
+ "nulls": "last"
1505
+ },
1506
+ {
1507
+ "expression": "group_maker",
1508
+ "isExpression": false,
1509
+ "asc": true,
1510
+ "nulls": "last"
1511
+ },
1512
+ {
1513
+ "expression": "group_group",
1514
+ "isExpression": false,
1515
+ "asc": true,
1516
+ "nulls": "last"
1517
+ },
1518
+ {
1519
+ "expression": "\"rate\" desc",
1520
+ "asc": true,
1521
+ "isExpression": true,
1522
+ "nulls": "last"
1523
+ },
1524
+ {
1525
+ "expression": "\"block_number\" asc",
1526
+ "asc": true,
1527
+ "isExpression": true,
1528
+ "nulls": "last"
1529
+ },
1530
+ {
1531
+ "expression": "\"assets\" desc",
1532
+ "asc": true,
1533
+ "isExpression": true,
1534
+ "nulls": "last"
1535
+ },
1536
+ {
1537
+ "expression": "\"hash\" asc",
1538
+ "asc": true,
1539
+ "isExpression": true,
1540
+ "nulls": "last"
1541
+ }
1542
+ ],
1543
+ "isUnique": false,
1544
+ "concurrently": false,
1545
+ "method": "btree",
1546
+ "with": {}
1547
+ },
1548
+ "offers_v2_group_winner_buy_side_idx": {
1549
+ "name": "offers_v2_group_winner_buy_side_idx",
1550
+ "columns": [
1551
+ {
1552
+ "expression": "group_chain_id",
1553
+ "isExpression": false,
1554
+ "asc": true,
1555
+ "nulls": "last"
1556
+ },
1557
+ {
1558
+ "expression": "group_maker",
1559
+ "isExpression": false,
1560
+ "asc": true,
1561
+ "nulls": "last"
1562
+ },
1563
+ {
1564
+ "expression": "group_group",
1565
+ "isExpression": false,
1566
+ "asc": true,
1567
+ "nulls": "last"
1568
+ },
1569
+ {
1570
+ "expression": "\"rate\" asc",
1571
+ "asc": true,
1572
+ "isExpression": true,
1573
+ "nulls": "last"
1574
+ },
1575
+ {
1576
+ "expression": "\"block_number\" asc",
1577
+ "asc": true,
1578
+ "isExpression": true,
1579
+ "nulls": "last"
1580
+ },
1581
+ {
1582
+ "expression": "\"assets\" desc",
1583
+ "asc": true,
1584
+ "isExpression": true,
1585
+ "nulls": "last"
1586
+ },
1587
+ {
1588
+ "expression": "\"hash\" asc",
1589
+ "asc": true,
1590
+ "isExpression": true,
1591
+ "nulls": "last"
1592
+ }
1593
+ ],
1594
+ "isUnique": false,
1595
+ "concurrently": false,
1596
+ "method": "btree",
1597
+ "with": {}
1598
+ },
1599
+ "offers_v2_obligation_id_side_idx": {
1600
+ "name": "offers_v2_obligation_id_side_idx",
1601
+ "columns": [
1602
+ {
1603
+ "expression": "obligation_id",
1604
+ "isExpression": false,
1605
+ "asc": true,
1606
+ "nulls": "last"
1607
+ },
1608
+ {
1609
+ "expression": "buy",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ }
1614
+ ],
1615
+ "isUnique": false,
1616
+ "concurrently": false,
1617
+ "method": "btree",
1618
+ "with": {}
1619
+ }
1620
+ },
1621
+ "foreignKeys": {
1622
+ "offers_v2_obligation_id_obligations_obligation_id_fk": {
1623
+ "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
1624
+ "tableFrom": "offers_v2",
1625
+ "tableTo": "obligations",
1626
+ "schemaTo": "router_v1.6",
1627
+ "columnsFrom": ["obligation_id"],
1628
+ "columnsTo": ["obligation_id"],
1629
+ "onDelete": "cascade",
1630
+ "onUpdate": "no action"
1631
+ },
1632
+ "offers_v2_groups_fk": {
1633
+ "name": "offers_v2_groups_fk",
1634
+ "tableFrom": "offers_v2",
1635
+ "tableTo": "groups",
1636
+ "schemaTo": "router_v1.6",
1637
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1638
+ "columnsTo": ["chain_id", "maker", "group"],
1639
+ "onDelete": "cascade",
1640
+ "onUpdate": "no action"
1641
+ }
1642
+ },
1643
+ "compositePrimaryKeys": {},
1644
+ "uniqueConstraints": {},
1645
+ "policies": {},
1646
+ "checkConstraints": {},
1647
+ "isRLSEnabled": false
1648
+ },
1649
+ "router_v1.6.oracles": {
1650
+ "name": "oracles",
1651
+ "schema": "router_v1.6",
1652
+ "columns": {
1653
+ "chain_id": {
1654
+ "name": "chain_id",
1655
+ "type": "bigint",
1656
+ "primaryKey": false,
1657
+ "notNull": true
1658
+ },
1659
+ "address": {
1660
+ "name": "address",
1661
+ "type": "varchar(42)",
1662
+ "primaryKey": false,
1663
+ "notNull": true
1664
+ },
1665
+ "block_number": {
1666
+ "name": "block_number",
1667
+ "type": "bigint",
1668
+ "primaryKey": false,
1669
+ "notNull": true
1670
+ },
1671
+ "updated_at": {
1672
+ "name": "updated_at",
1673
+ "type": "timestamp",
1674
+ "primaryKey": false,
1675
+ "notNull": true,
1676
+ "default": "now()"
1677
+ }
1678
+ },
1679
+ "indexes": {},
1680
+ "foreignKeys": {},
1681
+ "compositePrimaryKeys": {
1682
+ "oracles_pk": {
1683
+ "name": "oracles_pk",
1684
+ "columns": ["chain_id", "address"]
1685
+ }
1686
+ },
1687
+ "uniqueConstraints": {},
1688
+ "policies": {},
1689
+ "checkConstraints": {},
1690
+ "isRLSEnabled": false
1691
+ },
1692
+ "router_v1.6.status": {
1693
+ "name": "status",
1694
+ "schema": "router_v1.6",
1695
+ "columns": {
1696
+ "id": {
1697
+ "name": "id",
1698
+ "type": "serial",
1699
+ "primaryKey": true,
1700
+ "notNull": true
1701
+ },
1702
+ "code": {
1703
+ "name": "code",
1704
+ "type": "status_code",
1705
+ "typeSchema": "router_v1.6",
1706
+ "primaryKey": false,
1707
+ "notNull": false
1708
+ }
1709
+ },
1710
+ "indexes": {},
1711
+ "foreignKeys": {},
1712
+ "compositePrimaryKeys": {},
1713
+ "uniqueConstraints": {
1714
+ "status_code_unique": {
1715
+ "name": "status_code_unique",
1716
+ "nullsNotDistinct": false,
1717
+ "columns": ["code"]
1718
+ }
1719
+ },
1720
+ "policies": {},
1721
+ "checkConstraints": {},
1722
+ "isRLSEnabled": false
1723
+ }
1724
+ },
1725
+ "enums": {
1726
+ "router_v1.6.status_code": {
1727
+ "name": "status_code",
1728
+ "schema": "router_v1.6",
1729
+ "values": ["VALID", "NOT_ENOUGH_LIQUIDITY"]
959
1730
  }
960
1731
  },
961
- "enums": {},
962
1732
  "schemas": {},
963
1733
  "sequences": {},
964
1734
  "roles": {},