@morpho-dev/router 0.2.1 → 0.3.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.
@@ -0,0 +1,1531 @@
1
+ {
2
+ "id": "b68d3094-8a97-406e-9a3a-7380ee60ec28",
3
+ "prevId": "3157ba1a-2669-43a5-b783-ee4508042d9f",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "router_v1.6.callbacks": {
8
+ "name": "callbacks",
9
+ "schema": "router_v1.6",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "varchar(66)",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "position_chain_id": {
18
+ "name": "position_chain_id",
19
+ "type": "bigint",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "position_contract": {
24
+ "name": "position_contract",
25
+ "type": "varchar(42)",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "position_user": {
30
+ "name": "position_user",
31
+ "type": "varchar(42)",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "amount": {
36
+ "name": "amount",
37
+ "type": "numeric(78, 0)",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ }
41
+ },
42
+ "indexes": {},
43
+ "foreignKeys": {
44
+ "callbacks_positions_fk": {
45
+ "name": "callbacks_positions_fk",
46
+ "tableFrom": "callbacks",
47
+ "tableTo": "positions",
48
+ "schemaTo": "router_v1.6",
49
+ "columnsFrom": ["position_chain_id", "position_contract", "position_user"],
50
+ "columnsTo": ["chain_id", "contract", "user"],
51
+ "onDelete": "cascade",
52
+ "onUpdate": "no action"
53
+ }
54
+ },
55
+ "compositePrimaryKeys": {},
56
+ "uniqueConstraints": {},
57
+ "policies": {},
58
+ "checkConstraints": {},
59
+ "isRLSEnabled": false
60
+ },
61
+ "router_v1.6.chains": {
62
+ "name": "chains",
63
+ "schema": "router_v1.6",
64
+ "columns": {
65
+ "chain_id": {
66
+ "name": "chain_id",
67
+ "type": "bigint",
68
+ "primaryKey": false,
69
+ "notNull": true
70
+ },
71
+ "block_number": {
72
+ "name": "block_number",
73
+ "type": "bigint",
74
+ "primaryKey": false,
75
+ "notNull": true
76
+ },
77
+ "epoch": {
78
+ "name": "epoch",
79
+ "type": "numeric(78, 0)",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "'0'"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {
93
+ "chains_id_epoch_idx": {
94
+ "name": "chains_id_epoch_idx",
95
+ "columns": [
96
+ {
97
+ "expression": "chain_id",
98
+ "isExpression": false,
99
+ "asc": true,
100
+ "nulls": "last"
101
+ },
102
+ {
103
+ "expression": "epoch",
104
+ "isExpression": false,
105
+ "asc": true,
106
+ "nulls": "last"
107
+ }
108
+ ],
109
+ "isUnique": true,
110
+ "concurrently": false,
111
+ "method": "btree",
112
+ "with": {}
113
+ }
114
+ },
115
+ "foreignKeys": {},
116
+ "compositePrimaryKeys": {},
117
+ "uniqueConstraints": {},
118
+ "policies": {},
119
+ "checkConstraints": {},
120
+ "isRLSEnabled": false
121
+ },
122
+ "router_v1.6.collectors": {
123
+ "name": "collectors",
124
+ "schema": "router_v1.6",
125
+ "columns": {
126
+ "chain_id": {
127
+ "name": "chain_id",
128
+ "type": "bigint",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "name": {
133
+ "name": "name",
134
+ "type": "text",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "block_number": {
139
+ "name": "block_number",
140
+ "type": "bigint",
141
+ "primaryKey": false,
142
+ "notNull": true
143
+ },
144
+ "epoch": {
145
+ "name": "epoch",
146
+ "type": "numeric(78, 0)",
147
+ "primaryKey": false,
148
+ "notNull": true,
149
+ "default": "'0'"
150
+ },
151
+ "updated_at": {
152
+ "name": "updated_at",
153
+ "type": "timestamp",
154
+ "primaryKey": false,
155
+ "notNull": true,
156
+ "default": "now()"
157
+ }
158
+ },
159
+ "indexes": {
160
+ "collectors_chain_name_epoch_idx": {
161
+ "name": "collectors_chain_name_epoch_idx",
162
+ "columns": [
163
+ {
164
+ "expression": "chain_id",
165
+ "isExpression": false,
166
+ "asc": true,
167
+ "nulls": "last"
168
+ },
169
+ {
170
+ "expression": "name",
171
+ "isExpression": false,
172
+ "asc": true,
173
+ "nulls": "last"
174
+ },
175
+ {
176
+ "expression": "epoch",
177
+ "isExpression": false,
178
+ "asc": true,
179
+ "nulls": "last"
180
+ }
181
+ ],
182
+ "isUnique": true,
183
+ "concurrently": false,
184
+ "method": "btree",
185
+ "with": {}
186
+ }
187
+ },
188
+ "foreignKeys": {},
189
+ "compositePrimaryKeys": {},
190
+ "uniqueConstraints": {},
191
+ "policies": {},
192
+ "checkConstraints": {},
193
+ "isRLSEnabled": false
194
+ },
195
+ "router_v1.6.consumed_events": {
196
+ "name": "consumed_events",
197
+ "schema": "router_v1.6",
198
+ "columns": {
199
+ "event_id": {
200
+ "name": "event_id",
201
+ "type": "varchar(128)",
202
+ "primaryKey": true,
203
+ "notNull": true
204
+ },
205
+ "chain_id": {
206
+ "name": "chain_id",
207
+ "type": "bigint",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "maker": {
212
+ "name": "maker",
213
+ "type": "varchar(42)",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "group": {
218
+ "name": "group",
219
+ "type": "varchar(66)",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "amount": {
224
+ "name": "amount",
225
+ "type": "numeric(78, 0)",
226
+ "primaryKey": false,
227
+ "notNull": true
228
+ },
229
+ "block_number": {
230
+ "name": "block_number",
231
+ "type": "bigint",
232
+ "primaryKey": false,
233
+ "notNull": true
234
+ },
235
+ "created_at": {
236
+ "name": "created_at",
237
+ "type": "timestamp",
238
+ "primaryKey": false,
239
+ "notNull": true,
240
+ "default": "now()"
241
+ }
242
+ },
243
+ "indexes": {
244
+ "consumed_events_group_idx": {
245
+ "name": "consumed_events_group_idx",
246
+ "columns": [
247
+ {
248
+ "expression": "chain_id",
249
+ "isExpression": false,
250
+ "asc": true,
251
+ "nulls": "last"
252
+ },
253
+ {
254
+ "expression": "maker",
255
+ "isExpression": false,
256
+ "asc": true,
257
+ "nulls": "last"
258
+ },
259
+ {
260
+ "expression": "group",
261
+ "isExpression": false,
262
+ "asc": true,
263
+ "nulls": "last"
264
+ }
265
+ ],
266
+ "isUnique": false,
267
+ "concurrently": false,
268
+ "method": "btree",
269
+ "with": {}
270
+ },
271
+ "consumed_events_block_number_idx": {
272
+ "name": "consumed_events_block_number_idx",
273
+ "columns": [
274
+ {
275
+ "expression": "block_number",
276
+ "isExpression": false,
277
+ "asc": true,
278
+ "nulls": "last"
279
+ }
280
+ ],
281
+ "isUnique": false,
282
+ "concurrently": false,
283
+ "method": "btree",
284
+ "with": {}
285
+ }
286
+ },
287
+ "foreignKeys": {
288
+ "consumed_events_groups_fk": {
289
+ "name": "consumed_events_groups_fk",
290
+ "tableFrom": "consumed_events",
291
+ "tableTo": "groups",
292
+ "schemaTo": "router_v1.6",
293
+ "columnsFrom": ["chain_id", "maker", "group"],
294
+ "columnsTo": ["chain_id", "maker", "group"],
295
+ "onDelete": "cascade",
296
+ "onUpdate": "no action"
297
+ }
298
+ },
299
+ "compositePrimaryKeys": {},
300
+ "uniqueConstraints": {},
301
+ "policies": {},
302
+ "checkConstraints": {},
303
+ "isRLSEnabled": false
304
+ },
305
+ "router_v1.6.groups": {
306
+ "name": "groups",
307
+ "schema": "router_v1.6",
308
+ "columns": {
309
+ "chain_id": {
310
+ "name": "chain_id",
311
+ "type": "bigint",
312
+ "primaryKey": false,
313
+ "notNull": true
314
+ },
315
+ "maker": {
316
+ "name": "maker",
317
+ "type": "varchar(42)",
318
+ "primaryKey": false,
319
+ "notNull": true
320
+ },
321
+ "group": {
322
+ "name": "group",
323
+ "type": "varchar(66)",
324
+ "primaryKey": false,
325
+ "notNull": true
326
+ },
327
+ "consumed": {
328
+ "name": "consumed",
329
+ "type": "numeric(78, 0)",
330
+ "primaryKey": false,
331
+ "notNull": true
332
+ },
333
+ "block_number": {
334
+ "name": "block_number",
335
+ "type": "bigint",
336
+ "primaryKey": false,
337
+ "notNull": true
338
+ },
339
+ "updated_at": {
340
+ "name": "updated_at",
341
+ "type": "timestamp",
342
+ "primaryKey": false,
343
+ "notNull": true,
344
+ "default": "now()"
345
+ }
346
+ },
347
+ "indexes": {
348
+ "groups_chain_id_maker_group_consumed_idx": {
349
+ "name": "groups_chain_id_maker_group_consumed_idx",
350
+ "columns": [
351
+ {
352
+ "expression": "chain_id",
353
+ "isExpression": false,
354
+ "asc": true,
355
+ "nulls": "last"
356
+ },
357
+ {
358
+ "expression": "maker",
359
+ "isExpression": false,
360
+ "asc": true,
361
+ "nulls": "last"
362
+ },
363
+ {
364
+ "expression": "group",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ },
369
+ {
370
+ "expression": "consumed",
371
+ "isExpression": false,
372
+ "asc": true,
373
+ "nulls": "last"
374
+ }
375
+ ],
376
+ "isUnique": false,
377
+ "concurrently": false,
378
+ "method": "btree",
379
+ "with": {}
380
+ }
381
+ },
382
+ "foreignKeys": {},
383
+ "compositePrimaryKeys": {
384
+ "groups_pk": {
385
+ "name": "groups_pk",
386
+ "columns": ["chain_id", "maker", "group"]
387
+ }
388
+ },
389
+ "uniqueConstraints": {},
390
+ "policies": {},
391
+ "checkConstraints": {},
392
+ "isRLSEnabled": false
393
+ },
394
+ "router_v1.6.lots": {
395
+ "name": "lots",
396
+ "schema": "router_v1.6",
397
+ "columns": {
398
+ "chain_id": {
399
+ "name": "chain_id",
400
+ "type": "bigint",
401
+ "primaryKey": false,
402
+ "notNull": true
403
+ },
404
+ "user": {
405
+ "name": "user",
406
+ "type": "varchar(42)",
407
+ "primaryKey": false,
408
+ "notNull": true
409
+ },
410
+ "contract": {
411
+ "name": "contract",
412
+ "type": "varchar(42)",
413
+ "primaryKey": false,
414
+ "notNull": true
415
+ },
416
+ "group": {
417
+ "name": "group",
418
+ "type": "varchar(66)",
419
+ "primaryKey": false,
420
+ "notNull": true
421
+ },
422
+ "lower": {
423
+ "name": "lower",
424
+ "type": "numeric(78, 0)",
425
+ "primaryKey": false,
426
+ "notNull": true
427
+ },
428
+ "upper": {
429
+ "name": "upper",
430
+ "type": "numeric(78, 0)",
431
+ "primaryKey": false,
432
+ "notNull": true
433
+ }
434
+ },
435
+ "indexes": {},
436
+ "foreignKeys": {
437
+ "lots_positions_fk": {
438
+ "name": "lots_positions_fk",
439
+ "tableFrom": "lots",
440
+ "tableTo": "positions",
441
+ "schemaTo": "router_v1.6",
442
+ "columnsFrom": ["chain_id", "contract", "user"],
443
+ "columnsTo": ["chain_id", "contract", "user"],
444
+ "onDelete": "cascade",
445
+ "onUpdate": "no action"
446
+ },
447
+ "lots_groups_fk": {
448
+ "name": "lots_groups_fk",
449
+ "tableFrom": "lots",
450
+ "tableTo": "groups",
451
+ "schemaTo": "router_v1.6",
452
+ "columnsFrom": ["chain_id", "user", "group"],
453
+ "columnsTo": ["chain_id", "maker", "group"],
454
+ "onDelete": "cascade",
455
+ "onUpdate": "no action"
456
+ }
457
+ },
458
+ "compositePrimaryKeys": {
459
+ "lots_pk": {
460
+ "name": "lots_pk",
461
+ "columns": ["chain_id", "user", "contract", "group"]
462
+ }
463
+ },
464
+ "uniqueConstraints": {},
465
+ "policies": {},
466
+ "checkConstraints": {},
467
+ "isRLSEnabled": false
468
+ },
469
+ "router_v1.6.merkle_paths": {
470
+ "name": "merkle_paths",
471
+ "schema": "router_v1.6",
472
+ "columns": {
473
+ "offer_hash": {
474
+ "name": "offer_hash",
475
+ "type": "varchar(66)",
476
+ "primaryKey": true,
477
+ "notNull": true
478
+ },
479
+ "tree_root": {
480
+ "name": "tree_root",
481
+ "type": "varchar(66)",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "proof_nodes": {
486
+ "name": "proof_nodes",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ }
498
+ },
499
+ "indexes": {
500
+ "merkle_paths_tree_root_idx": {
501
+ "name": "merkle_paths_tree_root_idx",
502
+ "columns": [
503
+ {
504
+ "expression": "tree_root",
505
+ "isExpression": false,
506
+ "asc": true,
507
+ "nulls": "last"
508
+ }
509
+ ],
510
+ "isUnique": false,
511
+ "concurrently": false,
512
+ "method": "btree",
513
+ "with": {}
514
+ }
515
+ },
516
+ "foreignKeys": {
517
+ "merkle_paths_offer_hash_offers_hash_fk": {
518
+ "name": "merkle_paths_offer_hash_offers_hash_fk",
519
+ "tableFrom": "merkle_paths",
520
+ "tableTo": "offers",
521
+ "schemaTo": "router_v1.6",
522
+ "columnsFrom": ["offer_hash"],
523
+ "columnsTo": ["hash"],
524
+ "onDelete": "cascade",
525
+ "onUpdate": "no action"
526
+ },
527
+ "merkle_paths_tree_root_trees_root_fk": {
528
+ "name": "merkle_paths_tree_root_trees_root_fk",
529
+ "tableFrom": "merkle_paths",
530
+ "tableTo": "trees",
531
+ "schemaTo": "router_v1.6",
532
+ "columnsFrom": ["tree_root"],
533
+ "columnsTo": ["root"],
534
+ "onDelete": "cascade",
535
+ "onUpdate": "no action"
536
+ }
537
+ },
538
+ "compositePrimaryKeys": {},
539
+ "uniqueConstraints": {},
540
+ "policies": {},
541
+ "checkConstraints": {},
542
+ "isRLSEnabled": false
543
+ },
544
+ "router_v1.6.obligation_collaterals_v2": {
545
+ "name": "obligation_collaterals_v2",
546
+ "schema": "router_v1.6",
547
+ "columns": {
548
+ "obligation_id": {
549
+ "name": "obligation_id",
550
+ "type": "varchar(66)",
551
+ "primaryKey": false,
552
+ "notNull": true
553
+ },
554
+ "asset": {
555
+ "name": "asset",
556
+ "type": "varchar(42)",
557
+ "primaryKey": false,
558
+ "notNull": true
559
+ },
560
+ "oracle_chain_id": {
561
+ "name": "oracle_chain_id",
562
+ "type": "bigint",
563
+ "primaryKey": false,
564
+ "notNull": true
565
+ },
566
+ "oracle_address": {
567
+ "name": "oracle_address",
568
+ "type": "varchar(42)",
569
+ "primaryKey": false,
570
+ "notNull": true
571
+ },
572
+ "lltv": {
573
+ "name": "lltv",
574
+ "type": "bigint",
575
+ "primaryKey": false,
576
+ "notNull": true
577
+ },
578
+ "block_number": {
579
+ "name": "block_number",
580
+ "type": "bigint",
581
+ "primaryKey": false,
582
+ "notNull": true
583
+ },
584
+ "updated_at": {
585
+ "name": "updated_at",
586
+ "type": "timestamp",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "default": "now()"
590
+ }
591
+ },
592
+ "indexes": {
593
+ "obligation_collaterals_v2_obligation_id_idx": {
594
+ "name": "obligation_collaterals_v2_obligation_id_idx",
595
+ "columns": [
596
+ {
597
+ "expression": "obligation_id",
598
+ "isExpression": false,
599
+ "asc": true,
600
+ "nulls": "last"
601
+ }
602
+ ],
603
+ "isUnique": false,
604
+ "concurrently": false,
605
+ "method": "btree",
606
+ "with": {}
607
+ },
608
+ "obligation_collaterals_v2_oracle_fk_idx": {
609
+ "name": "obligation_collaterals_v2_oracle_fk_idx",
610
+ "columns": [
611
+ {
612
+ "expression": "oracle_chain_id",
613
+ "isExpression": false,
614
+ "asc": true,
615
+ "nulls": "last"
616
+ },
617
+ {
618
+ "expression": "oracle_address",
619
+ "isExpression": false,
620
+ "asc": true,
621
+ "nulls": "last"
622
+ }
623
+ ],
624
+ "isUnique": false,
625
+ "concurrently": false,
626
+ "method": "btree",
627
+ "with": {}
628
+ }
629
+ },
630
+ "foreignKeys": {
631
+ "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk": {
632
+ "name": "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk",
633
+ "tableFrom": "obligation_collaterals_v2",
634
+ "tableTo": "obligations",
635
+ "schemaTo": "router_v1.6",
636
+ "columnsFrom": ["obligation_id"],
637
+ "columnsTo": ["obligation_id"],
638
+ "onDelete": "cascade",
639
+ "onUpdate": "no action"
640
+ },
641
+ "obligation_collaterals_v2_oracles_fk": {
642
+ "name": "obligation_collaterals_v2_oracles_fk",
643
+ "tableFrom": "obligation_collaterals_v2",
644
+ "tableTo": "oracles",
645
+ "schemaTo": "router_v1.6",
646
+ "columnsFrom": ["oracle_chain_id", "oracle_address"],
647
+ "columnsTo": ["chain_id", "address"],
648
+ "onDelete": "no action",
649
+ "onUpdate": "no action"
650
+ }
651
+ },
652
+ "compositePrimaryKeys": {
653
+ "obligation_collaterals_v2_pk": {
654
+ "name": "obligation_collaterals_v2_pk",
655
+ "columns": ["obligation_id", "asset"]
656
+ }
657
+ },
658
+ "uniqueConstraints": {},
659
+ "policies": {},
660
+ "checkConstraints": {},
661
+ "isRLSEnabled": false
662
+ },
663
+ "router_v1.6.obligations": {
664
+ "name": "obligations",
665
+ "schema": "router_v1.6",
666
+ "columns": {
667
+ "obligation_id": {
668
+ "name": "obligation_id",
669
+ "type": "varchar(66)",
670
+ "primaryKey": true,
671
+ "notNull": true
672
+ },
673
+ "chain_id": {
674
+ "name": "chain_id",
675
+ "type": "bigint",
676
+ "primaryKey": false,
677
+ "notNull": true
678
+ },
679
+ "loan_token": {
680
+ "name": "loan_token",
681
+ "type": "varchar(42)",
682
+ "primaryKey": false,
683
+ "notNull": true
684
+ },
685
+ "maturity": {
686
+ "name": "maturity",
687
+ "type": "integer",
688
+ "primaryKey": false,
689
+ "notNull": true
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {},
694
+ "compositePrimaryKeys": {},
695
+ "uniqueConstraints": {},
696
+ "policies": {},
697
+ "checkConstraints": {},
698
+ "isRLSEnabled": false
699
+ },
700
+ "router_v1.6.offers": {
701
+ "name": "offers",
702
+ "schema": "router_v1.6",
703
+ "columns": {
704
+ "hash": {
705
+ "name": "hash",
706
+ "type": "varchar(66)",
707
+ "primaryKey": true,
708
+ "notNull": true
709
+ },
710
+ "obligation_id": {
711
+ "name": "obligation_id",
712
+ "type": "varchar(66)",
713
+ "primaryKey": false,
714
+ "notNull": true
715
+ },
716
+ "assets": {
717
+ "name": "assets",
718
+ "type": "numeric(78, 0)",
719
+ "primaryKey": false,
720
+ "notNull": true
721
+ },
722
+ "rate": {
723
+ "name": "rate",
724
+ "type": "numeric(78, 0)",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "maturity": {
729
+ "name": "maturity",
730
+ "type": "integer",
731
+ "primaryKey": false,
732
+ "notNull": true
733
+ },
734
+ "expiry": {
735
+ "name": "expiry",
736
+ "type": "integer",
737
+ "primaryKey": false,
738
+ "notNull": true
739
+ },
740
+ "start": {
741
+ "name": "start",
742
+ "type": "integer",
743
+ "primaryKey": false,
744
+ "notNull": true
745
+ },
746
+ "group_chain_id": {
747
+ "name": "group_chain_id",
748
+ "type": "bigint",
749
+ "primaryKey": false,
750
+ "notNull": true
751
+ },
752
+ "group_maker": {
753
+ "name": "group_maker",
754
+ "type": "varchar(42)",
755
+ "primaryKey": false,
756
+ "notNull": true
757
+ },
758
+ "group_group": {
759
+ "name": "group_group",
760
+ "type": "varchar(66)",
761
+ "primaryKey": false,
762
+ "notNull": true
763
+ },
764
+ "nonce": {
765
+ "name": "nonce",
766
+ "type": "varchar(66)",
767
+ "primaryKey": false,
768
+ "notNull": true
769
+ },
770
+ "buy": {
771
+ "name": "buy",
772
+ "type": "boolean",
773
+ "primaryKey": false,
774
+ "notNull": true
775
+ },
776
+ "callback_address": {
777
+ "name": "callback_address",
778
+ "type": "varchar(42)",
779
+ "primaryKey": false,
780
+ "notNull": true
781
+ },
782
+ "callback_data": {
783
+ "name": "callback_data",
784
+ "type": "text",
785
+ "primaryKey": false,
786
+ "notNull": true
787
+ },
788
+ "block_number": {
789
+ "name": "block_number",
790
+ "type": "bigint",
791
+ "primaryKey": false,
792
+ "notNull": true
793
+ },
794
+ "updated_at": {
795
+ "name": "updated_at",
796
+ "type": "timestamp",
797
+ "primaryKey": false,
798
+ "notNull": true,
799
+ "default": "now()"
800
+ }
801
+ },
802
+ "indexes": {
803
+ "offers_group_fk_idx": {
804
+ "name": "offers_group_fk_idx",
805
+ "columns": [
806
+ {
807
+ "expression": "group_chain_id",
808
+ "isExpression": false,
809
+ "asc": true,
810
+ "nulls": "last"
811
+ },
812
+ {
813
+ "expression": "group_maker",
814
+ "isExpression": false,
815
+ "asc": true,
816
+ "nulls": "last"
817
+ },
818
+ {
819
+ "expression": "group_group",
820
+ "isExpression": false,
821
+ "asc": true,
822
+ "nulls": "last"
823
+ }
824
+ ],
825
+ "isUnique": false,
826
+ "concurrently": false,
827
+ "method": "btree",
828
+ "with": {}
829
+ },
830
+ "offers_group_and_hash_idx": {
831
+ "name": "offers_group_and_hash_idx",
832
+ "columns": [
833
+ {
834
+ "expression": "group_chain_id",
835
+ "isExpression": false,
836
+ "asc": true,
837
+ "nulls": "last"
838
+ },
839
+ {
840
+ "expression": "group_maker",
841
+ "isExpression": false,
842
+ "asc": true,
843
+ "nulls": "last"
844
+ },
845
+ {
846
+ "expression": "group_group",
847
+ "isExpression": false,
848
+ "asc": true,
849
+ "nulls": "last"
850
+ },
851
+ {
852
+ "expression": "hash",
853
+ "isExpression": false,
854
+ "asc": true,
855
+ "nulls": "last"
856
+ }
857
+ ],
858
+ "isUnique": false,
859
+ "concurrently": false,
860
+ "method": "btree",
861
+ "with": {}
862
+ },
863
+ "offers_group_winner_sell_side_idx": {
864
+ "name": "offers_group_winner_sell_side_idx",
865
+ "columns": [
866
+ {
867
+ "expression": "group_chain_id",
868
+ "isExpression": false,
869
+ "asc": true,
870
+ "nulls": "last"
871
+ },
872
+ {
873
+ "expression": "group_maker",
874
+ "isExpression": false,
875
+ "asc": true,
876
+ "nulls": "last"
877
+ },
878
+ {
879
+ "expression": "group_group",
880
+ "isExpression": false,
881
+ "asc": true,
882
+ "nulls": "last"
883
+ },
884
+ {
885
+ "expression": "\"rate\" desc",
886
+ "asc": true,
887
+ "isExpression": true,
888
+ "nulls": "last"
889
+ },
890
+ {
891
+ "expression": "\"block_number\" asc",
892
+ "asc": true,
893
+ "isExpression": true,
894
+ "nulls": "last"
895
+ },
896
+ {
897
+ "expression": "\"assets\" desc",
898
+ "asc": true,
899
+ "isExpression": true,
900
+ "nulls": "last"
901
+ },
902
+ {
903
+ "expression": "\"hash\" asc",
904
+ "asc": true,
905
+ "isExpression": true,
906
+ "nulls": "last"
907
+ }
908
+ ],
909
+ "isUnique": false,
910
+ "concurrently": false,
911
+ "method": "btree",
912
+ "with": {}
913
+ },
914
+ "offers_group_winner_buy_side_idx": {
915
+ "name": "offers_group_winner_buy_side_idx",
916
+ "columns": [
917
+ {
918
+ "expression": "group_chain_id",
919
+ "isExpression": false,
920
+ "asc": true,
921
+ "nulls": "last"
922
+ },
923
+ {
924
+ "expression": "group_maker",
925
+ "isExpression": false,
926
+ "asc": true,
927
+ "nulls": "last"
928
+ },
929
+ {
930
+ "expression": "group_group",
931
+ "isExpression": false,
932
+ "asc": true,
933
+ "nulls": "last"
934
+ },
935
+ {
936
+ "expression": "\"rate\" asc",
937
+ "asc": true,
938
+ "isExpression": true,
939
+ "nulls": "last"
940
+ },
941
+ {
942
+ "expression": "\"block_number\" asc",
943
+ "asc": true,
944
+ "isExpression": true,
945
+ "nulls": "last"
946
+ },
947
+ {
948
+ "expression": "\"assets\" desc",
949
+ "asc": true,
950
+ "isExpression": true,
951
+ "nulls": "last"
952
+ },
953
+ {
954
+ "expression": "\"hash\" asc",
955
+ "asc": true,
956
+ "isExpression": true,
957
+ "nulls": "last"
958
+ }
959
+ ],
960
+ "isUnique": false,
961
+ "concurrently": false,
962
+ "method": "btree",
963
+ "with": {}
964
+ },
965
+ "offers_obligation_id_side_idx": {
966
+ "name": "offers_obligation_id_side_idx",
967
+ "columns": [
968
+ {
969
+ "expression": "obligation_id",
970
+ "isExpression": false,
971
+ "asc": true,
972
+ "nulls": "last"
973
+ },
974
+ {
975
+ "expression": "buy",
976
+ "isExpression": false,
977
+ "asc": true,
978
+ "nulls": "last"
979
+ }
980
+ ],
981
+ "isUnique": false,
982
+ "concurrently": false,
983
+ "method": "btree",
984
+ "with": {}
985
+ }
986
+ },
987
+ "foreignKeys": {
988
+ "offers_obligation_id_obligations_obligation_id_fk": {
989
+ "name": "offers_obligation_id_obligations_obligation_id_fk",
990
+ "tableFrom": "offers",
991
+ "tableTo": "obligations",
992
+ "schemaTo": "router_v1.6",
993
+ "columnsFrom": ["obligation_id"],
994
+ "columnsTo": ["obligation_id"],
995
+ "onDelete": "cascade",
996
+ "onUpdate": "no action"
997
+ },
998
+ "offers_groups_fk": {
999
+ "name": "offers_groups_fk",
1000
+ "tableFrom": "offers",
1001
+ "tableTo": "groups",
1002
+ "schemaTo": "router_v1.6",
1003
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1004
+ "columnsTo": ["chain_id", "maker", "group"],
1005
+ "onDelete": "cascade",
1006
+ "onUpdate": "no action"
1007
+ }
1008
+ },
1009
+ "compositePrimaryKeys": {},
1010
+ "uniqueConstraints": {},
1011
+ "policies": {},
1012
+ "checkConstraints": {},
1013
+ "isRLSEnabled": false
1014
+ },
1015
+ "router_v1.6.offers_callbacks": {
1016
+ "name": "offers_callbacks",
1017
+ "schema": "router_v1.6",
1018
+ "columns": {
1019
+ "offer_hash": {
1020
+ "name": "offer_hash",
1021
+ "type": "varchar(66)",
1022
+ "primaryKey": false,
1023
+ "notNull": true
1024
+ },
1025
+ "callback_id": {
1026
+ "name": "callback_id",
1027
+ "type": "varchar(66)",
1028
+ "primaryKey": false,
1029
+ "notNull": false
1030
+ }
1031
+ },
1032
+ "indexes": {},
1033
+ "foreignKeys": {
1034
+ "offers_callbacks_offer_hash_offers_hash_fk": {
1035
+ "name": "offers_callbacks_offer_hash_offers_hash_fk",
1036
+ "tableFrom": "offers_callbacks",
1037
+ "tableTo": "offers",
1038
+ "schemaTo": "router_v1.6",
1039
+ "columnsFrom": ["offer_hash"],
1040
+ "columnsTo": ["hash"],
1041
+ "onDelete": "cascade",
1042
+ "onUpdate": "no action"
1043
+ }
1044
+ },
1045
+ "compositePrimaryKeys": {
1046
+ "offers_callbacks_pk": {
1047
+ "name": "offers_callbacks_pk",
1048
+ "columns": ["offer_hash", "callback_id"]
1049
+ }
1050
+ },
1051
+ "uniqueConstraints": {},
1052
+ "policies": {},
1053
+ "checkConstraints": {},
1054
+ "isRLSEnabled": false
1055
+ },
1056
+ "router_v1.6.offsets": {
1057
+ "name": "offsets",
1058
+ "schema": "router_v1.6",
1059
+ "columns": {
1060
+ "chain_id": {
1061
+ "name": "chain_id",
1062
+ "type": "bigint",
1063
+ "primaryKey": false,
1064
+ "notNull": true
1065
+ },
1066
+ "user": {
1067
+ "name": "user",
1068
+ "type": "varchar(42)",
1069
+ "primaryKey": false,
1070
+ "notNull": true
1071
+ },
1072
+ "contract": {
1073
+ "name": "contract",
1074
+ "type": "varchar(42)",
1075
+ "primaryKey": false,
1076
+ "notNull": true
1077
+ },
1078
+ "group": {
1079
+ "name": "group",
1080
+ "type": "varchar(66)",
1081
+ "primaryKey": false,
1082
+ "notNull": true
1083
+ },
1084
+ "value": {
1085
+ "name": "value",
1086
+ "type": "numeric(78, 0)",
1087
+ "primaryKey": false,
1088
+ "notNull": true
1089
+ }
1090
+ },
1091
+ "indexes": {},
1092
+ "foreignKeys": {
1093
+ "offsets_positions_fk": {
1094
+ "name": "offsets_positions_fk",
1095
+ "tableFrom": "offsets",
1096
+ "tableTo": "positions",
1097
+ "schemaTo": "router_v1.6",
1098
+ "columnsFrom": ["chain_id", "contract", "user"],
1099
+ "columnsTo": ["chain_id", "contract", "user"],
1100
+ "onDelete": "cascade",
1101
+ "onUpdate": "no action"
1102
+ }
1103
+ },
1104
+ "compositePrimaryKeys": {
1105
+ "offsets_pk": {
1106
+ "name": "offsets_pk",
1107
+ "columns": ["chain_id", "user", "contract", "group"]
1108
+ }
1109
+ },
1110
+ "uniqueConstraints": {},
1111
+ "policies": {},
1112
+ "checkConstraints": {},
1113
+ "isRLSEnabled": false
1114
+ },
1115
+ "router_v1.6.oracles": {
1116
+ "name": "oracles",
1117
+ "schema": "router_v1.6",
1118
+ "columns": {
1119
+ "chain_id": {
1120
+ "name": "chain_id",
1121
+ "type": "bigint",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "address": {
1126
+ "name": "address",
1127
+ "type": "varchar(42)",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "price": {
1132
+ "name": "price",
1133
+ "type": "numeric(78, 0)",
1134
+ "primaryKey": false,
1135
+ "notNull": false
1136
+ },
1137
+ "block_number": {
1138
+ "name": "block_number",
1139
+ "type": "bigint",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "updated_at": {
1144
+ "name": "updated_at",
1145
+ "type": "timestamp",
1146
+ "primaryKey": false,
1147
+ "notNull": true,
1148
+ "default": "now()"
1149
+ }
1150
+ },
1151
+ "indexes": {},
1152
+ "foreignKeys": {},
1153
+ "compositePrimaryKeys": {
1154
+ "oracles_pk": {
1155
+ "name": "oracles_pk",
1156
+ "columns": ["chain_id", "address"]
1157
+ }
1158
+ },
1159
+ "uniqueConstraints": {},
1160
+ "policies": {},
1161
+ "checkConstraints": {},
1162
+ "isRLSEnabled": false
1163
+ },
1164
+ "router_v1.6.position_types": {
1165
+ "name": "position_types",
1166
+ "schema": "router_v1.6",
1167
+ "columns": {
1168
+ "id": {
1169
+ "name": "id",
1170
+ "type": "serial",
1171
+ "primaryKey": true,
1172
+ "notNull": true
1173
+ },
1174
+ "type": {
1175
+ "name": "type",
1176
+ "type": "position_type",
1177
+ "typeSchema": "router_v1.6",
1178
+ "primaryKey": false,
1179
+ "notNull": true
1180
+ }
1181
+ },
1182
+ "indexes": {},
1183
+ "foreignKeys": {},
1184
+ "compositePrimaryKeys": {},
1185
+ "uniqueConstraints": {},
1186
+ "policies": {},
1187
+ "checkConstraints": {},
1188
+ "isRLSEnabled": false
1189
+ },
1190
+ "router_v1.6.positions": {
1191
+ "name": "positions",
1192
+ "schema": "router_v1.6",
1193
+ "columns": {
1194
+ "chain_id": {
1195
+ "name": "chain_id",
1196
+ "type": "bigint",
1197
+ "primaryKey": false,
1198
+ "notNull": true
1199
+ },
1200
+ "contract": {
1201
+ "name": "contract",
1202
+ "type": "varchar(42)",
1203
+ "primaryKey": false,
1204
+ "notNull": true
1205
+ },
1206
+ "user": {
1207
+ "name": "user",
1208
+ "type": "varchar(42)",
1209
+ "primaryKey": false,
1210
+ "notNull": true
1211
+ },
1212
+ "position_type_id": {
1213
+ "name": "position_type_id",
1214
+ "type": "integer",
1215
+ "primaryKey": false,
1216
+ "notNull": true
1217
+ },
1218
+ "balance": {
1219
+ "name": "balance",
1220
+ "type": "numeric(78, 0)",
1221
+ "primaryKey": false,
1222
+ "notNull": false
1223
+ },
1224
+ "asset": {
1225
+ "name": "asset",
1226
+ "type": "varchar(42)",
1227
+ "primaryKey": false,
1228
+ "notNull": false
1229
+ },
1230
+ "block_number": {
1231
+ "name": "block_number",
1232
+ "type": "bigint",
1233
+ "primaryKey": false,
1234
+ "notNull": true
1235
+ },
1236
+ "updated_at": {
1237
+ "name": "updated_at",
1238
+ "type": "timestamp",
1239
+ "primaryKey": false,
1240
+ "notNull": true,
1241
+ "default": "now()"
1242
+ }
1243
+ },
1244
+ "indexes": {},
1245
+ "foreignKeys": {
1246
+ "positions_position_type_id_position_types_id_fk": {
1247
+ "name": "positions_position_type_id_position_types_id_fk",
1248
+ "tableFrom": "positions",
1249
+ "tableTo": "position_types",
1250
+ "schemaTo": "router_v1.6",
1251
+ "columnsFrom": ["position_type_id"],
1252
+ "columnsTo": ["id"],
1253
+ "onDelete": "no action",
1254
+ "onUpdate": "no action"
1255
+ }
1256
+ },
1257
+ "compositePrimaryKeys": {
1258
+ "positions_pk": {
1259
+ "name": "positions_pk",
1260
+ "columns": ["chain_id", "contract", "user"]
1261
+ }
1262
+ },
1263
+ "uniqueConstraints": {},
1264
+ "policies": {},
1265
+ "checkConstraints": {},
1266
+ "isRLSEnabled": false
1267
+ },
1268
+ "router_v1.6.status": {
1269
+ "name": "status",
1270
+ "schema": "router_v1.6",
1271
+ "columns": {
1272
+ "id": {
1273
+ "name": "id",
1274
+ "type": "serial",
1275
+ "primaryKey": true,
1276
+ "notNull": true
1277
+ },
1278
+ "code": {
1279
+ "name": "code",
1280
+ "type": "status_code",
1281
+ "typeSchema": "router_v1.6",
1282
+ "primaryKey": false,
1283
+ "notNull": false
1284
+ }
1285
+ },
1286
+ "indexes": {},
1287
+ "foreignKeys": {},
1288
+ "compositePrimaryKeys": {},
1289
+ "uniqueConstraints": {
1290
+ "status_code_unique": {
1291
+ "name": "status_code_unique",
1292
+ "nullsNotDistinct": false,
1293
+ "columns": ["code"]
1294
+ }
1295
+ },
1296
+ "policies": {},
1297
+ "checkConstraints": {},
1298
+ "isRLSEnabled": false
1299
+ },
1300
+ "router_v1.6.transfers": {
1301
+ "name": "transfers",
1302
+ "schema": "router_v1.6",
1303
+ "columns": {
1304
+ "event_id": {
1305
+ "name": "event_id",
1306
+ "type": "varchar(128)",
1307
+ "primaryKey": true,
1308
+ "notNull": true
1309
+ },
1310
+ "chain_id": {
1311
+ "name": "chain_id",
1312
+ "type": "bigint",
1313
+ "primaryKey": false,
1314
+ "notNull": true
1315
+ },
1316
+ "contract": {
1317
+ "name": "contract",
1318
+ "type": "varchar(42)",
1319
+ "primaryKey": false,
1320
+ "notNull": true
1321
+ },
1322
+ "from": {
1323
+ "name": "from",
1324
+ "type": "varchar(42)",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "to": {
1329
+ "name": "to",
1330
+ "type": "varchar(42)",
1331
+ "primaryKey": false,
1332
+ "notNull": true
1333
+ },
1334
+ "value": {
1335
+ "name": "value",
1336
+ "type": "numeric(78, 0)",
1337
+ "primaryKey": false,
1338
+ "notNull": true
1339
+ },
1340
+ "block_number": {
1341
+ "name": "block_number",
1342
+ "type": "bigint",
1343
+ "primaryKey": false,
1344
+ "notNull": true
1345
+ },
1346
+ "created_at": {
1347
+ "name": "created_at",
1348
+ "type": "timestamp",
1349
+ "primaryKey": false,
1350
+ "notNull": true,
1351
+ "default": "now()"
1352
+ }
1353
+ },
1354
+ "indexes": {
1355
+ "transfers_chain_contract_user_idx": {
1356
+ "name": "transfers_chain_contract_user_idx",
1357
+ "columns": [
1358
+ {
1359
+ "expression": "chain_id",
1360
+ "isExpression": false,
1361
+ "asc": true,
1362
+ "nulls": "last"
1363
+ },
1364
+ {
1365
+ "expression": "contract",
1366
+ "isExpression": false,
1367
+ "asc": true,
1368
+ "nulls": "last"
1369
+ },
1370
+ {
1371
+ "expression": "from",
1372
+ "isExpression": false,
1373
+ "asc": true,
1374
+ "nulls": "last"
1375
+ },
1376
+ {
1377
+ "expression": "to",
1378
+ "isExpression": false,
1379
+ "asc": true,
1380
+ "nulls": "last"
1381
+ },
1382
+ {
1383
+ "expression": "block_number",
1384
+ "isExpression": false,
1385
+ "asc": true,
1386
+ "nulls": "last"
1387
+ }
1388
+ ],
1389
+ "isUnique": false,
1390
+ "concurrently": false,
1391
+ "method": "btree",
1392
+ "with": {}
1393
+ }
1394
+ },
1395
+ "foreignKeys": {
1396
+ "transfers_positions_from_fk": {
1397
+ "name": "transfers_positions_from_fk",
1398
+ "tableFrom": "transfers",
1399
+ "tableTo": "positions",
1400
+ "schemaTo": "router_v1.6",
1401
+ "columnsFrom": ["chain_id", "contract", "from"],
1402
+ "columnsTo": ["chain_id", "contract", "user"],
1403
+ "onDelete": "cascade",
1404
+ "onUpdate": "no action"
1405
+ },
1406
+ "transfers_positions_to_fk": {
1407
+ "name": "transfers_positions_to_fk",
1408
+ "tableFrom": "transfers",
1409
+ "tableTo": "positions",
1410
+ "schemaTo": "router_v1.6",
1411
+ "columnsFrom": ["chain_id", "contract", "to"],
1412
+ "columnsTo": ["chain_id", "contract", "user"],
1413
+ "onDelete": "cascade",
1414
+ "onUpdate": "no action"
1415
+ }
1416
+ },
1417
+ "compositePrimaryKeys": {},
1418
+ "uniqueConstraints": {},
1419
+ "policies": {},
1420
+ "checkConstraints": {},
1421
+ "isRLSEnabled": false
1422
+ },
1423
+ "router_v1.6.trees": {
1424
+ "name": "trees",
1425
+ "schema": "router_v1.6",
1426
+ "columns": {
1427
+ "root": {
1428
+ "name": "root",
1429
+ "type": "varchar(66)",
1430
+ "primaryKey": true,
1431
+ "notNull": true
1432
+ },
1433
+ "root_signature": {
1434
+ "name": "root_signature",
1435
+ "type": "varchar(132)",
1436
+ "primaryKey": false,
1437
+ "notNull": true
1438
+ },
1439
+ "created_at": {
1440
+ "name": "created_at",
1441
+ "type": "timestamp",
1442
+ "primaryKey": false,
1443
+ "notNull": true,
1444
+ "default": "now()"
1445
+ }
1446
+ },
1447
+ "indexes": {},
1448
+ "foreignKeys": {},
1449
+ "compositePrimaryKeys": {},
1450
+ "uniqueConstraints": {},
1451
+ "policies": {},
1452
+ "checkConstraints": {},
1453
+ "isRLSEnabled": false
1454
+ },
1455
+ "router_v1.6.validations": {
1456
+ "name": "validations",
1457
+ "schema": "router_v1.6",
1458
+ "columns": {
1459
+ "offer_hash": {
1460
+ "name": "offer_hash",
1461
+ "type": "varchar(66)",
1462
+ "primaryKey": true,
1463
+ "notNull": true
1464
+ },
1465
+ "status_id": {
1466
+ "name": "status_id",
1467
+ "type": "integer",
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
+ "foreignKeys": {
1481
+ "validations_offer_hash_offers_hash_fk": {
1482
+ "name": "validations_offer_hash_offers_hash_fk",
1483
+ "tableFrom": "validations",
1484
+ "tableTo": "offers",
1485
+ "schemaTo": "router_v1.6",
1486
+ "columnsFrom": ["offer_hash"],
1487
+ "columnsTo": ["hash"],
1488
+ "onDelete": "cascade",
1489
+ "onUpdate": "no action"
1490
+ },
1491
+ "validations_status_id_status_id_fk": {
1492
+ "name": "validations_status_id_status_id_fk",
1493
+ "tableFrom": "validations",
1494
+ "tableTo": "status",
1495
+ "schemaTo": "router_v1.6",
1496
+ "columnsFrom": ["status_id"],
1497
+ "columnsTo": ["id"],
1498
+ "onDelete": "no action",
1499
+ "onUpdate": "no action"
1500
+ }
1501
+ },
1502
+ "compositePrimaryKeys": {},
1503
+ "uniqueConstraints": {},
1504
+ "policies": {},
1505
+ "checkConstraints": {},
1506
+ "isRLSEnabled": false
1507
+ }
1508
+ },
1509
+ "enums": {
1510
+ "router_v1.6.position_type": {
1511
+ "name": "position_type",
1512
+ "schema": "router_v1.6",
1513
+ "values": ["erc20", "vault_v1"]
1514
+ },
1515
+ "router_v1.6.status_code": {
1516
+ "name": "status_code",
1517
+ "schema": "router_v1.6",
1518
+ "values": ["VALID", "SIMULATION_ERROR"]
1519
+ }
1520
+ },
1521
+ "schemas": {},
1522
+ "sequences": {},
1523
+ "roles": {},
1524
+ "policies": {},
1525
+ "views": {},
1526
+ "_meta": {
1527
+ "columns": {},
1528
+ "schemas": {},
1529
+ "tables": {}
1530
+ }
1531
+ }