@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": "bfd47937-9ca3-488e-96ec-b040b921e884",
2
+ "id": "8f0682ec-34c8-4b3b-9065-e61367f63703",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
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",
@@ -315,7 +520,7 @@
315
520
  "compositePrimaryKeys": {
316
521
  "liquidity_links_pk": {
317
522
  "name": "liquidity_links_pk",
318
- "columns": ["parent_pool_id", "child_pool_id"]
523
+ "columns": ["parent_pool_id", "priority"]
319
524
  }
320
525
  },
321
526
  "uniqueConstraints": {},
@@ -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,90 @@
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_offer_hash_offers_v2_hash_fk": {
935
+ "name": "offer_status_offer_hash_offers_v2_hash_fk",
936
+ "tableFrom": "offer_status",
937
+ "tableTo": "offers_v2",
938
+ "schemaTo": "router_v1.6",
939
+ "columnsFrom": ["offer_hash"],
940
+ "columnsTo": ["hash"],
941
+ "onDelete": "cascade",
942
+ "onUpdate": "no action"
943
+ },
944
+ "offer_status_status_id_status_id_fk": {
945
+ "name": "offer_status_status_id_status_id_fk",
946
+ "tableFrom": "offer_status",
947
+ "tableTo": "status",
948
+ "schemaTo": "router_v1.6",
949
+ "columnsFrom": ["status_id"],
950
+ "columnsTo": ["id"],
951
+ "onDelete": "cascade",
952
+ "onUpdate": "no action"
953
+ }
954
+ },
955
+ "compositePrimaryKeys": {},
956
+ "uniqueConstraints": {},
957
+ "policies": {},
958
+ "checkConstraints": {},
959
+ "isRLSEnabled": false
960
+ },
961
+ "router_v1.6.offers": {
545
962
  "name": "offers",
546
- "schema": "router_v1.4",
963
+ "schema": "router_v1.6",
547
964
  "columns": {
548
965
  "hash": {
549
966
  "name": "hash",
@@ -944,11 +1361,293 @@
944
1361
  "name": "offers_obligation_id_obligations_obligation_id_fk",
945
1362
  "tableFrom": "offers",
946
1363
  "tableTo": "obligations",
947
- "schemaTo": "router_v1.4",
1364
+ "schemaTo": "router_v1.6",
1365
+ "columnsFrom": ["obligation_id"],
1366
+ "columnsTo": ["obligation_id"],
1367
+ "onDelete": "cascade",
1368
+ "onUpdate": "no action"
1369
+ }
1370
+ },
1371
+ "compositePrimaryKeys": {},
1372
+ "uniqueConstraints": {},
1373
+ "policies": {},
1374
+ "checkConstraints": {},
1375
+ "isRLSEnabled": false
1376
+ },
1377
+ "router_v1.6.offers_v2": {
1378
+ "name": "offers_v2",
1379
+ "schema": "router_v1.6",
1380
+ "columns": {
1381
+ "hash": {
1382
+ "name": "hash",
1383
+ "type": "varchar(66)",
1384
+ "primaryKey": true,
1385
+ "notNull": true
1386
+ },
1387
+ "obligation_id": {
1388
+ "name": "obligation_id",
1389
+ "type": "varchar(66)",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "assets": {
1394
+ "name": "assets",
1395
+ "type": "numeric(78, 0)",
1396
+ "primaryKey": false,
1397
+ "notNull": true
1398
+ },
1399
+ "rate": {
1400
+ "name": "rate",
1401
+ "type": "numeric(78, 0)",
1402
+ "primaryKey": false,
1403
+ "notNull": true
1404
+ },
1405
+ "maturity": {
1406
+ "name": "maturity",
1407
+ "type": "integer",
1408
+ "primaryKey": false,
1409
+ "notNull": true
1410
+ },
1411
+ "expiry": {
1412
+ "name": "expiry",
1413
+ "type": "integer",
1414
+ "primaryKey": false,
1415
+ "notNull": true
1416
+ },
1417
+ "start": {
1418
+ "name": "start",
1419
+ "type": "integer",
1420
+ "primaryKey": false,
1421
+ "notNull": true
1422
+ },
1423
+ "group_chain_id": {
1424
+ "name": "group_chain_id",
1425
+ "type": "bigint",
1426
+ "primaryKey": false,
1427
+ "notNull": true
1428
+ },
1429
+ "group_maker": {
1430
+ "name": "group_maker",
1431
+ "type": "varchar(42)",
1432
+ "primaryKey": false,
1433
+ "notNull": true
1434
+ },
1435
+ "group_group": {
1436
+ "name": "group_group",
1437
+ "type": "varchar(66)",
1438
+ "primaryKey": false,
1439
+ "notNull": true
1440
+ },
1441
+ "nonce": {
1442
+ "name": "nonce",
1443
+ "type": "varchar(66)",
1444
+ "primaryKey": false,
1445
+ "notNull": true
1446
+ },
1447
+ "buy": {
1448
+ "name": "buy",
1449
+ "type": "boolean",
1450
+ "primaryKey": false,
1451
+ "notNull": true
1452
+ },
1453
+ "callback_address": {
1454
+ "name": "callback_address",
1455
+ "type": "varchar(42)",
1456
+ "primaryKey": false,
1457
+ "notNull": true
1458
+ },
1459
+ "callback_data": {
1460
+ "name": "callback_data",
1461
+ "type": "text",
1462
+ "primaryKey": false,
1463
+ "notNull": true
1464
+ },
1465
+ "block_number": {
1466
+ "name": "block_number",
1467
+ "type": "bigint",
1468
+ "primaryKey": false,
1469
+ "notNull": true
1470
+ },
1471
+ "updated_at": {
1472
+ "name": "updated_at",
1473
+ "type": "timestamp",
1474
+ "primaryKey": false,
1475
+ "notNull": true,
1476
+ "default": "now()"
1477
+ }
1478
+ },
1479
+ "indexes": {
1480
+ "offers_v2_group_fk_idx": {
1481
+ "name": "offers_v2_group_fk_idx",
1482
+ "columns": [
1483
+ {
1484
+ "expression": "group_chain_id",
1485
+ "isExpression": false,
1486
+ "asc": true,
1487
+ "nulls": "last"
1488
+ },
1489
+ {
1490
+ "expression": "group_maker",
1491
+ "isExpression": false,
1492
+ "asc": true,
1493
+ "nulls": "last"
1494
+ },
1495
+ {
1496
+ "expression": "group_group",
1497
+ "isExpression": false,
1498
+ "asc": true,
1499
+ "nulls": "last"
1500
+ }
1501
+ ],
1502
+ "isUnique": false,
1503
+ "concurrently": false,
1504
+ "method": "btree",
1505
+ "with": {}
1506
+ },
1507
+ "offers_v2_group_winner_sell_side_idx": {
1508
+ "name": "offers_v2_group_winner_sell_side_idx",
1509
+ "columns": [
1510
+ {
1511
+ "expression": "group_chain_id",
1512
+ "isExpression": false,
1513
+ "asc": true,
1514
+ "nulls": "last"
1515
+ },
1516
+ {
1517
+ "expression": "group_maker",
1518
+ "isExpression": false,
1519
+ "asc": true,
1520
+ "nulls": "last"
1521
+ },
1522
+ {
1523
+ "expression": "group_group",
1524
+ "isExpression": false,
1525
+ "asc": true,
1526
+ "nulls": "last"
1527
+ },
1528
+ {
1529
+ "expression": "\"rate\" desc",
1530
+ "asc": true,
1531
+ "isExpression": true,
1532
+ "nulls": "last"
1533
+ },
1534
+ {
1535
+ "expression": "\"block_number\" asc",
1536
+ "asc": true,
1537
+ "isExpression": true,
1538
+ "nulls": "last"
1539
+ },
1540
+ {
1541
+ "expression": "\"assets\" desc",
1542
+ "asc": true,
1543
+ "isExpression": true,
1544
+ "nulls": "last"
1545
+ },
1546
+ {
1547
+ "expression": "\"hash\" asc",
1548
+ "asc": true,
1549
+ "isExpression": true,
1550
+ "nulls": "last"
1551
+ }
1552
+ ],
1553
+ "isUnique": false,
1554
+ "concurrently": false,
1555
+ "method": "btree",
1556
+ "with": {}
1557
+ },
1558
+ "offers_v2_group_winner_buy_side_idx": {
1559
+ "name": "offers_v2_group_winner_buy_side_idx",
1560
+ "columns": [
1561
+ {
1562
+ "expression": "group_chain_id",
1563
+ "isExpression": false,
1564
+ "asc": true,
1565
+ "nulls": "last"
1566
+ },
1567
+ {
1568
+ "expression": "group_maker",
1569
+ "isExpression": false,
1570
+ "asc": true,
1571
+ "nulls": "last"
1572
+ },
1573
+ {
1574
+ "expression": "group_group",
1575
+ "isExpression": false,
1576
+ "asc": true,
1577
+ "nulls": "last"
1578
+ },
1579
+ {
1580
+ "expression": "\"rate\" asc",
1581
+ "asc": true,
1582
+ "isExpression": true,
1583
+ "nulls": "last"
1584
+ },
1585
+ {
1586
+ "expression": "\"block_number\" asc",
1587
+ "asc": true,
1588
+ "isExpression": true,
1589
+ "nulls": "last"
1590
+ },
1591
+ {
1592
+ "expression": "\"assets\" desc",
1593
+ "asc": true,
1594
+ "isExpression": true,
1595
+ "nulls": "last"
1596
+ },
1597
+ {
1598
+ "expression": "\"hash\" asc",
1599
+ "asc": true,
1600
+ "isExpression": true,
1601
+ "nulls": "last"
1602
+ }
1603
+ ],
1604
+ "isUnique": false,
1605
+ "concurrently": false,
1606
+ "method": "btree",
1607
+ "with": {}
1608
+ },
1609
+ "offers_v2_obligation_id_side_idx": {
1610
+ "name": "offers_v2_obligation_id_side_idx",
1611
+ "columns": [
1612
+ {
1613
+ "expression": "obligation_id",
1614
+ "isExpression": false,
1615
+ "asc": true,
1616
+ "nulls": "last"
1617
+ },
1618
+ {
1619
+ "expression": "buy",
1620
+ "isExpression": false,
1621
+ "asc": true,
1622
+ "nulls": "last"
1623
+ }
1624
+ ],
1625
+ "isUnique": false,
1626
+ "concurrently": false,
1627
+ "method": "btree",
1628
+ "with": {}
1629
+ }
1630
+ },
1631
+ "foreignKeys": {
1632
+ "offers_v2_obligation_id_obligations_obligation_id_fk": {
1633
+ "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
1634
+ "tableFrom": "offers_v2",
1635
+ "tableTo": "obligations",
1636
+ "schemaTo": "router_v1.6",
948
1637
  "columnsFrom": ["obligation_id"],
949
1638
  "columnsTo": ["obligation_id"],
950
1639
  "onDelete": "cascade",
951
1640
  "onUpdate": "no action"
1641
+ },
1642
+ "offers_v2_groups_fk": {
1643
+ "name": "offers_v2_groups_fk",
1644
+ "tableFrom": "offers_v2",
1645
+ "tableTo": "groups",
1646
+ "schemaTo": "router_v1.6",
1647
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1648
+ "columnsTo": ["chain_id", "maker", "group"],
1649
+ "onDelete": "cascade",
1650
+ "onUpdate": "no action"
952
1651
  }
953
1652
  },
954
1653
  "compositePrimaryKeys": {},
@@ -956,9 +1655,90 @@
956
1655
  "policies": {},
957
1656
  "checkConstraints": {},
958
1657
  "isRLSEnabled": false
1658
+ },
1659
+ "router_v1.6.oracles": {
1660
+ "name": "oracles",
1661
+ "schema": "router_v1.6",
1662
+ "columns": {
1663
+ "chain_id": {
1664
+ "name": "chain_id",
1665
+ "type": "bigint",
1666
+ "primaryKey": false,
1667
+ "notNull": true
1668
+ },
1669
+ "address": {
1670
+ "name": "address",
1671
+ "type": "varchar(42)",
1672
+ "primaryKey": false,
1673
+ "notNull": true
1674
+ },
1675
+ "block_number": {
1676
+ "name": "block_number",
1677
+ "type": "bigint",
1678
+ "primaryKey": false,
1679
+ "notNull": true
1680
+ },
1681
+ "updated_at": {
1682
+ "name": "updated_at",
1683
+ "type": "timestamp",
1684
+ "primaryKey": false,
1685
+ "notNull": true,
1686
+ "default": "now()"
1687
+ }
1688
+ },
1689
+ "indexes": {},
1690
+ "foreignKeys": {},
1691
+ "compositePrimaryKeys": {
1692
+ "oracles_pk": {
1693
+ "name": "oracles_pk",
1694
+ "columns": ["chain_id", "address"]
1695
+ }
1696
+ },
1697
+ "uniqueConstraints": {},
1698
+ "policies": {},
1699
+ "checkConstraints": {},
1700
+ "isRLSEnabled": false
1701
+ },
1702
+ "router_v1.6.status": {
1703
+ "name": "status",
1704
+ "schema": "router_v1.6",
1705
+ "columns": {
1706
+ "id": {
1707
+ "name": "id",
1708
+ "type": "serial",
1709
+ "primaryKey": true,
1710
+ "notNull": true
1711
+ },
1712
+ "code": {
1713
+ "name": "code",
1714
+ "type": "status_code",
1715
+ "typeSchema": "router_v1.6",
1716
+ "primaryKey": false,
1717
+ "notNull": false
1718
+ }
1719
+ },
1720
+ "indexes": {},
1721
+ "foreignKeys": {},
1722
+ "compositePrimaryKeys": {},
1723
+ "uniqueConstraints": {
1724
+ "status_code_unique": {
1725
+ "name": "status_code_unique",
1726
+ "nullsNotDistinct": false,
1727
+ "columns": ["code"]
1728
+ }
1729
+ },
1730
+ "policies": {},
1731
+ "checkConstraints": {},
1732
+ "isRLSEnabled": false
1733
+ }
1734
+ },
1735
+ "enums": {
1736
+ "router_v1.6.status_code": {
1737
+ "name": "status_code",
1738
+ "schema": "router_v1.6",
1739
+ "values": ["VALID", "NOT_ENOUGH_LIQUIDITY"]
959
1740
  }
960
1741
  },
961
- "enums": {},
962
1742
  "schemas": {},
963
1743
  "sequences": {},
964
1744
  "roles": {},