@morpho-dev/router 0.2.1 → 0.4.0

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