@morpho-dev/router 0.11.0 → 0.12.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 (46) hide show
  1. package/README.md +20 -5
  2. package/dist/cli.js +11700 -6794
  3. package/dist/drizzle/migrations/0034_chain-checkpoints.sql +1 -0
  4. package/dist/drizzle/migrations/0035_chain-tip-hash-cas.sql +1 -0
  5. package/dist/drizzle/migrations/0036_pending-links.sql +22 -0
  6. package/dist/drizzle/migrations/0037_chain-finalized-anchor.sql +2 -0
  7. package/dist/drizzle/migrations/0038_add-obligation-rcf-threshold.sql +2 -0
  8. package/dist/drizzle/migrations/0039_add-offers-composite-indexes.sql +2 -0
  9. package/dist/drizzle/migrations/0040_drop-redundant-offers-indexes.sql +2 -0
  10. package/dist/drizzle/migrations/0041_add-group-winner-expression-index.sql +10 -0
  11. package/dist/drizzle/migrations/0042_contract-sync-v1.14.sql +284 -0
  12. package/dist/drizzle/migrations/0043_add-obligation-side-tick-index.sql +1 -0
  13. package/dist/drizzle/migrations/0044_index-audit-cleanup.sql +27 -0
  14. package/dist/drizzle/migrations/0045_add-lots-offsets-availability-indexes.sql +5 -0
  15. package/dist/drizzle/migrations/0046_add-offers-active-tick-index.sql +1 -0
  16. package/dist/drizzle/migrations/0047_add-offers-book-winners-index.sql +1 -0
  17. package/dist/drizzle/migrations/0048_covering-indexes-for-winners-queries.sql +34 -0
  18. package/dist/drizzle/migrations/0049_contract-sync-v1.15.sql +305 -0
  19. package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
  20. package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
  21. package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
  22. package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
  23. package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
  24. package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
  25. package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
  26. package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
  27. package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
  28. package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
  29. package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
  30. package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
  31. package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
  32. package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
  33. package/dist/drizzle/migrations/meta/_journal.json +112 -0
  34. package/dist/evm/bytecode/morpho.txt +1 -1
  35. package/dist/index.browser.d.mts +587 -271
  36. package/dist/index.browser.d.mts.map +1 -1
  37. package/dist/index.browser.mjs +656 -419
  38. package/dist/index.browser.mjs.map +1 -1
  39. package/dist/index.node.d.mts +1454 -583
  40. package/dist/index.node.d.mts.map +1 -1
  41. package/dist/index.node.mjs +9064 -5228
  42. package/dist/index.node.mjs.map +1 -1
  43. package/dist/server-D4xxddev.js +9573 -0
  44. package/dist/server.js +9617 -0
  45. package/docs/integrator.md +14 -24
  46. package/package.json +7 -4
@@ -0,0 +1,1921 @@
1
+ {
2
+ "id": "32d6fccf-af74-6582-cd94-53b29358c84d",
3
+ "prevId": "d9b24437-61f6-43bc-b208-f913ad177670",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "router_v1.14.callbacks": {
8
+ "name": "callbacks",
9
+ "schema": "router_v1.14",
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(66)",
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
+ "position_type_id": {
36
+ "name": "position_type_id",
37
+ "type": "integer",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "type": {
42
+ "name": "type",
43
+ "type": "callback_type",
44
+ "typeSchema": "router_v1.14",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ }
48
+ },
49
+ "indexes": {},
50
+ "foreignKeys": {
51
+ "callbacks_position_type_id_position_types_id_fk": {
52
+ "name": "callbacks_position_type_id_position_types_id_fk",
53
+ "tableFrom": "callbacks",
54
+ "tableTo": "position_types",
55
+ "schemaTo": "router_v1.14",
56
+ "columnsFrom": ["position_type_id"],
57
+ "columnsTo": ["id"],
58
+ "onDelete": "no action",
59
+ "onUpdate": "no action"
60
+ }
61
+ },
62
+ "compositePrimaryKeys": {},
63
+ "uniqueConstraints": {},
64
+ "policies": {},
65
+ "checkConstraints": {},
66
+ "isRLSEnabled": false
67
+ },
68
+ "router_v1.14.chains": {
69
+ "name": "chains",
70
+ "schema": "router_v1.14",
71
+ "columns": {
72
+ "chain_id": {
73
+ "name": "chain_id",
74
+ "type": "bigint",
75
+ "primaryKey": false,
76
+ "notNull": true
77
+ },
78
+ "block_number": {
79
+ "name": "block_number",
80
+ "type": "bigint",
81
+ "primaryKey": false,
82
+ "notNull": true
83
+ },
84
+ "epoch": {
85
+ "name": "epoch",
86
+ "type": "numeric(78, 0)",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "'0'"
90
+ },
91
+ "checkpoints": {
92
+ "name": "checkpoints",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": true,
96
+ "default": "'[]'"
97
+ },
98
+ "tip_hash": {
99
+ "name": "tip_hash",
100
+ "type": "text",
101
+ "primaryKey": false,
102
+ "notNull": false
103
+ },
104
+ "finalized_block_number": {
105
+ "name": "finalized_block_number",
106
+ "type": "bigint",
107
+ "primaryKey": false,
108
+ "notNull": false
109
+ },
110
+ "finalized_block_hash": {
111
+ "name": "finalized_block_hash",
112
+ "type": "text",
113
+ "primaryKey": false,
114
+ "notNull": false
115
+ },
116
+ "updated_at": {
117
+ "name": "updated_at",
118
+ "type": "timestamp",
119
+ "primaryKey": false,
120
+ "notNull": true,
121
+ "default": "now()"
122
+ }
123
+ },
124
+ "indexes": {
125
+ "chains_chain_id_idx": {
126
+ "name": "chains_chain_id_idx",
127
+ "columns": [
128
+ {
129
+ "expression": "chain_id",
130
+ "isExpression": false,
131
+ "asc": true,
132
+ "nulls": "last"
133
+ }
134
+ ],
135
+ "isUnique": true,
136
+ "concurrently": false,
137
+ "method": "btree",
138
+ "with": {}
139
+ }
140
+ },
141
+ "foreignKeys": {},
142
+ "compositePrimaryKeys": {},
143
+ "uniqueConstraints": {},
144
+ "policies": {},
145
+ "checkConstraints": {},
146
+ "isRLSEnabled": false
147
+ },
148
+ "router_v1.14.collectors": {
149
+ "name": "collectors",
150
+ "schema": "router_v1.14",
151
+ "columns": {
152
+ "chain_id": {
153
+ "name": "chain_id",
154
+ "type": "bigint",
155
+ "primaryKey": false,
156
+ "notNull": true
157
+ },
158
+ "name": {
159
+ "name": "name",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": true
163
+ },
164
+ "block_number": {
165
+ "name": "block_number",
166
+ "type": "bigint",
167
+ "primaryKey": false,
168
+ "notNull": true
169
+ },
170
+ "epoch": {
171
+ "name": "epoch",
172
+ "type": "numeric(78, 0)",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "default": "'0'"
176
+ },
177
+ "updated_at": {
178
+ "name": "updated_at",
179
+ "type": "timestamp",
180
+ "primaryKey": false,
181
+ "notNull": true,
182
+ "default": "now()"
183
+ }
184
+ },
185
+ "indexes": {
186
+ "collectors_chain_name_idx": {
187
+ "name": "collectors_chain_name_idx",
188
+ "columns": [
189
+ {
190
+ "expression": "chain_id",
191
+ "isExpression": false,
192
+ "asc": true,
193
+ "nulls": "last"
194
+ },
195
+ {
196
+ "expression": "name",
197
+ "isExpression": false,
198
+ "asc": true,
199
+ "nulls": "last"
200
+ }
201
+ ],
202
+ "isUnique": true,
203
+ "concurrently": false,
204
+ "method": "btree",
205
+ "with": {}
206
+ }
207
+ },
208
+ "foreignKeys": {
209
+ "collectors_chain_id_chains_chain_id_fk": {
210
+ "name": "collectors_chain_id_chains_chain_id_fk",
211
+ "tableFrom": "collectors",
212
+ "tableTo": "chains",
213
+ "schemaTo": "router_v1.14",
214
+ "columnsFrom": ["chain_id"],
215
+ "columnsTo": ["chain_id"],
216
+ "onDelete": "no action",
217
+ "onUpdate": "no action"
218
+ }
219
+ },
220
+ "compositePrimaryKeys": {},
221
+ "uniqueConstraints": {},
222
+ "policies": {},
223
+ "checkConstraints": {},
224
+ "isRLSEnabled": false
225
+ },
226
+ "router_v1.14.consumed_events": {
227
+ "name": "consumed_events",
228
+ "schema": "router_v1.14",
229
+ "columns": {
230
+ "event_id": {
231
+ "name": "event_id",
232
+ "type": "varchar(128)",
233
+ "primaryKey": true,
234
+ "notNull": true
235
+ },
236
+ "chain_id": {
237
+ "name": "chain_id",
238
+ "type": "bigint",
239
+ "primaryKey": false,
240
+ "notNull": true
241
+ },
242
+ "maker": {
243
+ "name": "maker",
244
+ "type": "varchar(42)",
245
+ "primaryKey": false,
246
+ "notNull": true
247
+ },
248
+ "group": {
249
+ "name": "group",
250
+ "type": "varchar(66)",
251
+ "primaryKey": false,
252
+ "notNull": true
253
+ },
254
+ "amount": {
255
+ "name": "amount",
256
+ "type": "numeric(78, 0)",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "block_number": {
261
+ "name": "block_number",
262
+ "type": "bigint",
263
+ "primaryKey": false,
264
+ "notNull": true
265
+ },
266
+ "created_at": {
267
+ "name": "created_at",
268
+ "type": "timestamp",
269
+ "primaryKey": false,
270
+ "notNull": true,
271
+ "default": "now()"
272
+ }
273
+ },
274
+ "indexes": {
275
+ "consumed_events_group_idx": {
276
+ "name": "consumed_events_group_idx",
277
+ "columns": [
278
+ {
279
+ "expression": "chain_id",
280
+ "isExpression": false,
281
+ "asc": true,
282
+ "nulls": "last"
283
+ },
284
+ {
285
+ "expression": "maker",
286
+ "isExpression": false,
287
+ "asc": true,
288
+ "nulls": "last"
289
+ },
290
+ {
291
+ "expression": "group",
292
+ "isExpression": false,
293
+ "asc": true,
294
+ "nulls": "last"
295
+ }
296
+ ],
297
+ "isUnique": false,
298
+ "concurrently": false,
299
+ "method": "btree",
300
+ "with": {}
301
+ },
302
+ "consumed_events_block_number_idx": {
303
+ "name": "consumed_events_block_number_idx",
304
+ "columns": [
305
+ {
306
+ "expression": "block_number",
307
+ "isExpression": false,
308
+ "asc": true,
309
+ "nulls": "last"
310
+ }
311
+ ],
312
+ "isUnique": false,
313
+ "concurrently": false,
314
+ "method": "btree",
315
+ "with": {}
316
+ }
317
+ },
318
+ "foreignKeys": {
319
+ "consumed_events_groups_fk": {
320
+ "name": "consumed_events_groups_fk",
321
+ "tableFrom": "consumed_events",
322
+ "tableTo": "groups",
323
+ "schemaTo": "router_v1.14",
324
+ "columnsFrom": ["chain_id", "maker", "group"],
325
+ "columnsTo": ["chain_id", "maker", "group"],
326
+ "onDelete": "cascade",
327
+ "onUpdate": "no action"
328
+ }
329
+ },
330
+ "compositePrimaryKeys": {},
331
+ "uniqueConstraints": {},
332
+ "policies": {},
333
+ "checkConstraints": {},
334
+ "isRLSEnabled": false
335
+ },
336
+ "router_v1.14.groups": {
337
+ "name": "groups",
338
+ "schema": "router_v1.14",
339
+ "columns": {
340
+ "chain_id": {
341
+ "name": "chain_id",
342
+ "type": "bigint",
343
+ "primaryKey": false,
344
+ "notNull": true
345
+ },
346
+ "maker": {
347
+ "name": "maker",
348
+ "type": "varchar(42)",
349
+ "primaryKey": false,
350
+ "notNull": true
351
+ },
352
+ "group": {
353
+ "name": "group",
354
+ "type": "varchar(66)",
355
+ "primaryKey": false,
356
+ "notNull": true
357
+ },
358
+ "consumed": {
359
+ "name": "consumed",
360
+ "type": "numeric(78, 0)",
361
+ "primaryKey": false,
362
+ "notNull": true
363
+ },
364
+ "block_number": {
365
+ "name": "block_number",
366
+ "type": "bigint",
367
+ "primaryKey": false,
368
+ "notNull": true
369
+ },
370
+ "updated_at": {
371
+ "name": "updated_at",
372
+ "type": "timestamp",
373
+ "primaryKey": false,
374
+ "notNull": true,
375
+ "default": "now()"
376
+ }
377
+ },
378
+ "indexes": {},
379
+ "foreignKeys": {},
380
+ "compositePrimaryKeys": {
381
+ "groups_pk": {
382
+ "name": "groups_pk",
383
+ "columns": ["chain_id", "maker", "group"]
384
+ }
385
+ },
386
+ "uniqueConstraints": {},
387
+ "policies": {},
388
+ "checkConstraints": {},
389
+ "isRLSEnabled": false
390
+ },
391
+ "router_v1.14.lots": {
392
+ "name": "lots",
393
+ "schema": "router_v1.14",
394
+ "columns": {
395
+ "chain_id": {
396
+ "name": "chain_id",
397
+ "type": "bigint",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "user": {
402
+ "name": "user",
403
+ "type": "varchar(42)",
404
+ "primaryKey": false,
405
+ "notNull": true
406
+ },
407
+ "contract": {
408
+ "name": "contract",
409
+ "type": "varchar(66)",
410
+ "primaryKey": false,
411
+ "notNull": true
412
+ },
413
+ "group": {
414
+ "name": "group",
415
+ "type": "varchar(66)",
416
+ "primaryKey": false,
417
+ "notNull": true
418
+ },
419
+ "obligation_id": {
420
+ "name": "obligation_id",
421
+ "type": "varchar(66)",
422
+ "primaryKey": false,
423
+ "notNull": true
424
+ },
425
+ "lower": {
426
+ "name": "lower",
427
+ "type": "numeric(78, 0)",
428
+ "primaryKey": false,
429
+ "notNull": true
430
+ },
431
+ "upper": {
432
+ "name": "upper",
433
+ "type": "numeric(78, 0)",
434
+ "primaryKey": false,
435
+ "notNull": true
436
+ }
437
+ },
438
+ "indexes": {
439
+ "lots_position_group_obligation_idx": {
440
+ "name": "lots_position_group_obligation_idx",
441
+ "columns": [
442
+ {
443
+ "expression": "chain_id",
444
+ "isExpression": false,
445
+ "asc": true,
446
+ "nulls": "last"
447
+ },
448
+ {
449
+ "expression": "user",
450
+ "isExpression": false,
451
+ "asc": true,
452
+ "nulls": "last"
453
+ },
454
+ {
455
+ "expression": "group",
456
+ "isExpression": false,
457
+ "asc": true,
458
+ "nulls": "last"
459
+ },
460
+ {
461
+ "expression": "obligation_id",
462
+ "isExpression": false,
463
+ "asc": true,
464
+ "nulls": "last"
465
+ }
466
+ ],
467
+ "isUnique": false,
468
+ "concurrently": false,
469
+ "method": "btree",
470
+ "with": {}
471
+ }
472
+ },
473
+ "foreignKeys": {
474
+ "lots_lots_positions_fk": {
475
+ "name": "lots_lots_positions_fk",
476
+ "tableFrom": "lots",
477
+ "tableTo": "lots_positions",
478
+ "schemaTo": "router_v1.14",
479
+ "columnsFrom": ["chain_id", "contract", "user"],
480
+ "columnsTo": ["chain_id", "contract", "user"],
481
+ "onDelete": "cascade",
482
+ "onUpdate": "no action"
483
+ },
484
+ "lots_groups_fk": {
485
+ "name": "lots_groups_fk",
486
+ "tableFrom": "lots",
487
+ "tableTo": "groups",
488
+ "schemaTo": "router_v1.14",
489
+ "columnsFrom": ["chain_id", "user", "group"],
490
+ "columnsTo": ["chain_id", "maker", "group"],
491
+ "onDelete": "cascade",
492
+ "onUpdate": "no action"
493
+ }
494
+ },
495
+ "compositePrimaryKeys": {
496
+ "lots_pk": {
497
+ "name": "lots_pk",
498
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
499
+ }
500
+ },
501
+ "uniqueConstraints": {},
502
+ "policies": {},
503
+ "checkConstraints": {},
504
+ "isRLSEnabled": false
505
+ },
506
+ "router_v1.14.lots_positions": {
507
+ "name": "lots_positions",
508
+ "schema": "router_v1.14",
509
+ "columns": {
510
+ "chain_id": {
511
+ "name": "chain_id",
512
+ "type": "bigint",
513
+ "primaryKey": false,
514
+ "notNull": true
515
+ },
516
+ "contract": {
517
+ "name": "contract",
518
+ "type": "varchar(66)",
519
+ "primaryKey": false,
520
+ "notNull": true
521
+ },
522
+ "user": {
523
+ "name": "user",
524
+ "type": "varchar(42)",
525
+ "primaryKey": false,
526
+ "notNull": true
527
+ },
528
+ "position_type_id": {
529
+ "name": "position_type_id",
530
+ "type": "integer",
531
+ "primaryKey": false,
532
+ "notNull": true
533
+ }
534
+ },
535
+ "indexes": {},
536
+ "foreignKeys": {
537
+ "lots_positions_position_type_id_position_types_id_fk": {
538
+ "name": "lots_positions_position_type_id_position_types_id_fk",
539
+ "tableFrom": "lots_positions",
540
+ "tableTo": "position_types",
541
+ "schemaTo": "router_v1.14",
542
+ "columnsFrom": ["position_type_id"],
543
+ "columnsTo": ["id"],
544
+ "onDelete": "no action",
545
+ "onUpdate": "no action"
546
+ }
547
+ },
548
+ "compositePrimaryKeys": {
549
+ "lots_positions_pk": {
550
+ "name": "lots_positions_pk",
551
+ "columns": ["chain_id", "contract", "user"]
552
+ }
553
+ },
554
+ "uniqueConstraints": {},
555
+ "policies": {},
556
+ "checkConstraints": {},
557
+ "isRLSEnabled": false
558
+ },
559
+ "router_v1.14.merkle_paths": {
560
+ "name": "merkle_paths",
561
+ "schema": "router_v1.14",
562
+ "columns": {
563
+ "offer_hash": {
564
+ "name": "offer_hash",
565
+ "type": "varchar(66)",
566
+ "primaryKey": false,
567
+ "notNull": true
568
+ },
569
+ "obligation_id": {
570
+ "name": "obligation_id",
571
+ "type": "varchar(66)",
572
+ "primaryKey": false,
573
+ "notNull": true
574
+ },
575
+ "tree_root": {
576
+ "name": "tree_root",
577
+ "type": "varchar(66)",
578
+ "primaryKey": false,
579
+ "notNull": true
580
+ },
581
+ "proof_nodes": {
582
+ "name": "proof_nodes",
583
+ "type": "text",
584
+ "primaryKey": false,
585
+ "notNull": true
586
+ },
587
+ "created_at": {
588
+ "name": "created_at",
589
+ "type": "timestamp",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "default": "now()"
593
+ }
594
+ },
595
+ "indexes": {
596
+ "merkle_paths_tree_root_idx": {
597
+ "name": "merkle_paths_tree_root_idx",
598
+ "columns": [
599
+ {
600
+ "expression": "tree_root",
601
+ "isExpression": false,
602
+ "asc": true,
603
+ "nulls": "last"
604
+ }
605
+ ],
606
+ "isUnique": false,
607
+ "concurrently": false,
608
+ "method": "btree",
609
+ "with": {}
610
+ }
611
+ },
612
+ "foreignKeys": {
613
+ "merkle_paths_tree_root_trees_root_fk": {
614
+ "name": "merkle_paths_tree_root_trees_root_fk",
615
+ "tableFrom": "merkle_paths",
616
+ "tableTo": "trees",
617
+ "schemaTo": "router_v1.14",
618
+ "columnsFrom": ["tree_root"],
619
+ "columnsTo": ["root"],
620
+ "onDelete": "cascade",
621
+ "onUpdate": "no action"
622
+ },
623
+ "merkle_paths_offer_fk": {
624
+ "name": "merkle_paths_offer_fk",
625
+ "tableFrom": "merkle_paths",
626
+ "tableTo": "offers",
627
+ "schemaTo": "router_v1.14",
628
+ "columnsFrom": ["offer_hash", "obligation_id"],
629
+ "columnsTo": ["hash", "obligation_id"],
630
+ "onDelete": "cascade",
631
+ "onUpdate": "no action"
632
+ }
633
+ },
634
+ "compositePrimaryKeys": {
635
+ "merkle_paths_pk": {
636
+ "name": "merkle_paths_pk",
637
+ "columns": ["offer_hash", "obligation_id"]
638
+ }
639
+ },
640
+ "uniqueConstraints": {},
641
+ "policies": {},
642
+ "checkConstraints": {},
643
+ "isRLSEnabled": false
644
+ },
645
+ "router_v1.14.obligation_collaterals_v2": {
646
+ "name": "obligation_collaterals_v2",
647
+ "schema": "router_v1.14",
648
+ "columns": {
649
+ "obligation_key": {
650
+ "name": "obligation_key",
651
+ "type": "varchar(66)",
652
+ "primaryKey": false,
653
+ "notNull": true
654
+ },
655
+ "asset": {
656
+ "name": "asset",
657
+ "type": "varchar(42)",
658
+ "primaryKey": false,
659
+ "notNull": true
660
+ },
661
+ "oracle_address": {
662
+ "name": "oracle_address",
663
+ "type": "varchar(42)",
664
+ "primaryKey": false,
665
+ "notNull": true
666
+ },
667
+ "lltv": {
668
+ "name": "lltv",
669
+ "type": "bigint",
670
+ "primaryKey": false,
671
+ "notNull": true
672
+ },
673
+ "max_lif": {
674
+ "name": "max_lif",
675
+ "type": "bigint",
676
+ "primaryKey": false,
677
+ "notNull": true
678
+ },
679
+ "collateral_index": {
680
+ "name": "collateral_index",
681
+ "type": "integer",
682
+ "primaryKey": false,
683
+ "notNull": true
684
+ },
685
+ "updated_at": {
686
+ "name": "updated_at",
687
+ "type": "timestamp",
688
+ "primaryKey": false,
689
+ "notNull": true,
690
+ "default": "now()"
691
+ }
692
+ },
693
+ "indexes": {},
694
+ "foreignKeys": {
695
+ "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk": {
696
+ "name": "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk",
697
+ "tableFrom": "obligation_collaterals_v2",
698
+ "tableTo": "obligations",
699
+ "schemaTo": "router_v1.14",
700
+ "columnsFrom": ["obligation_key"],
701
+ "columnsTo": ["obligation_key"],
702
+ "onDelete": "cascade",
703
+ "onUpdate": "no action"
704
+ }
705
+ },
706
+ "compositePrimaryKeys": {
707
+ "obligation_collaterals_v2_pk": {
708
+ "name": "obligation_collaterals_v2_pk",
709
+ "columns": ["obligation_key", "asset"]
710
+ }
711
+ },
712
+ "uniqueConstraints": {},
713
+ "policies": {},
714
+ "checkConstraints": {},
715
+ "isRLSEnabled": false
716
+ },
717
+ "router_v1.14.obligation_id_keys": {
718
+ "name": "obligation_id_keys",
719
+ "schema": "router_v1.14",
720
+ "columns": {
721
+ "obligation_id": {
722
+ "name": "obligation_id",
723
+ "type": "varchar(66)",
724
+ "primaryKey": true,
725
+ "notNull": true
726
+ },
727
+ "obligation_key": {
728
+ "name": "obligation_key",
729
+ "type": "varchar(66)",
730
+ "primaryKey": false,
731
+ "notNull": true
732
+ },
733
+ "chain_id": {
734
+ "name": "chain_id",
735
+ "type": "bigint",
736
+ "primaryKey": false,
737
+ "notNull": true
738
+ },
739
+ "morpho_v2": {
740
+ "name": "morpho_v2",
741
+ "type": "varchar(42)",
742
+ "primaryKey": false,
743
+ "notNull": true
744
+ }
745
+ },
746
+ "indexes": {
747
+ "obligation_id_keys_obligation_key_idx": {
748
+ "name": "obligation_id_keys_obligation_key_idx",
749
+ "columns": [
750
+ {
751
+ "expression": "obligation_key",
752
+ "isExpression": false,
753
+ "asc": true,
754
+ "nulls": "last"
755
+ }
756
+ ],
757
+ "isUnique": false,
758
+ "concurrently": false,
759
+ "method": "btree",
760
+ "with": {}
761
+ },
762
+ "obligation_id_keys_chain_id_idx": {
763
+ "name": "obligation_id_keys_chain_id_idx",
764
+ "columns": [
765
+ {
766
+ "expression": "chain_id",
767
+ "isExpression": false,
768
+ "asc": true,
769
+ "nulls": "last"
770
+ }
771
+ ],
772
+ "isUnique": false,
773
+ "concurrently": false,
774
+ "method": "btree",
775
+ "with": {}
776
+ }
777
+ },
778
+ "foreignKeys": {
779
+ "obligation_id_keys_obligation_key_obligations_obligation_key_fk": {
780
+ "name": "obligation_id_keys_obligation_key_obligations_obligation_key_fk",
781
+ "tableFrom": "obligation_id_keys",
782
+ "tableTo": "obligations",
783
+ "schemaTo": "router_v1.14",
784
+ "columnsFrom": ["obligation_key"],
785
+ "columnsTo": ["obligation_key"],
786
+ "onDelete": "cascade",
787
+ "onUpdate": "no action"
788
+ }
789
+ },
790
+ "compositePrimaryKeys": {},
791
+ "uniqueConstraints": {},
792
+ "policies": {},
793
+ "checkConstraints": {},
794
+ "isRLSEnabled": false
795
+ },
796
+ "router_v1.14.obligations": {
797
+ "name": "obligations",
798
+ "schema": "router_v1.14",
799
+ "columns": {
800
+ "obligation_key": {
801
+ "name": "obligation_key",
802
+ "type": "varchar(66)",
803
+ "primaryKey": true,
804
+ "notNull": true
805
+ },
806
+ "loan_token": {
807
+ "name": "loan_token",
808
+ "type": "varchar(42)",
809
+ "primaryKey": false,
810
+ "notNull": true
811
+ },
812
+ "maturity": {
813
+ "name": "maturity",
814
+ "type": "integer",
815
+ "primaryKey": false,
816
+ "notNull": true
817
+ },
818
+ "rcf_threshold": {
819
+ "name": "rcf_threshold",
820
+ "type": "numeric(78, 0)",
821
+ "primaryKey": false,
822
+ "notNull": true
823
+ }
824
+ },
825
+ "indexes": {},
826
+ "foreignKeys": {},
827
+ "compositePrimaryKeys": {},
828
+ "uniqueConstraints": {},
829
+ "policies": {},
830
+ "checkConstraints": {},
831
+ "isRLSEnabled": false
832
+ },
833
+ "router_v1.14.offers": {
834
+ "name": "offers",
835
+ "schema": "router_v1.14",
836
+ "columns": {
837
+ "hash": {
838
+ "name": "hash",
839
+ "type": "varchar(66)",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "obligation_id": {
844
+ "name": "obligation_id",
845
+ "type": "varchar(66)",
846
+ "primaryKey": false,
847
+ "notNull": true
848
+ },
849
+ "obligation_units": {
850
+ "name": "obligation_units",
851
+ "type": "numeric(78, 0)",
852
+ "primaryKey": false,
853
+ "notNull": true,
854
+ "default": "'0'"
855
+ },
856
+ "obligation_shares": {
857
+ "name": "obligation_shares",
858
+ "type": "numeric(78, 0)",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "default": "'0'"
862
+ },
863
+ "tick": {
864
+ "name": "tick",
865
+ "type": "integer",
866
+ "primaryKey": false,
867
+ "notNull": true
868
+ },
869
+ "maturity": {
870
+ "name": "maturity",
871
+ "type": "integer",
872
+ "primaryKey": false,
873
+ "notNull": true
874
+ },
875
+ "expiry": {
876
+ "name": "expiry",
877
+ "type": "integer",
878
+ "primaryKey": false,
879
+ "notNull": true
880
+ },
881
+ "start": {
882
+ "name": "start",
883
+ "type": "integer",
884
+ "primaryKey": false,
885
+ "notNull": true
886
+ },
887
+ "group_chain_id": {
888
+ "name": "group_chain_id",
889
+ "type": "bigint",
890
+ "primaryKey": false,
891
+ "notNull": true
892
+ },
893
+ "group_maker": {
894
+ "name": "group_maker",
895
+ "type": "varchar(42)",
896
+ "primaryKey": false,
897
+ "notNull": true
898
+ },
899
+ "group_group": {
900
+ "name": "group_group",
901
+ "type": "varchar(66)",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "session": {
906
+ "name": "session",
907
+ "type": "varchar(66)",
908
+ "primaryKey": false,
909
+ "notNull": true
910
+ },
911
+ "buy": {
912
+ "name": "buy",
913
+ "type": "boolean",
914
+ "primaryKey": false,
915
+ "notNull": true
916
+ },
917
+ "callback_address": {
918
+ "name": "callback_address",
919
+ "type": "varchar(42)",
920
+ "primaryKey": false,
921
+ "notNull": true
922
+ },
923
+ "callback_data": {
924
+ "name": "callback_data",
925
+ "type": "text",
926
+ "primaryKey": false,
927
+ "notNull": true
928
+ },
929
+ "receiver_if_maker_is_seller": {
930
+ "name": "receiver_if_maker_is_seller",
931
+ "type": "varchar(42)",
932
+ "primaryKey": false,
933
+ "notNull": false
934
+ },
935
+ "block_number": {
936
+ "name": "block_number",
937
+ "type": "bigint",
938
+ "primaryKey": false,
939
+ "notNull": true
940
+ },
941
+ "updated_at": {
942
+ "name": "updated_at",
943
+ "type": "timestamp",
944
+ "primaryKey": false,
945
+ "notNull": true,
946
+ "default": "now()"
947
+ }
948
+ },
949
+ "indexes": {
950
+ "offers_group_and_hash_idx": {
951
+ "name": "offers_group_and_hash_idx",
952
+ "columns": [
953
+ {
954
+ "expression": "group_chain_id",
955
+ "isExpression": false,
956
+ "asc": true,
957
+ "nulls": "last"
958
+ },
959
+ {
960
+ "expression": "group_maker",
961
+ "isExpression": false,
962
+ "asc": true,
963
+ "nulls": "last"
964
+ },
965
+ {
966
+ "expression": "group_group",
967
+ "isExpression": false,
968
+ "asc": true,
969
+ "nulls": "last"
970
+ },
971
+ {
972
+ "expression": "hash",
973
+ "isExpression": false,
974
+ "asc": true,
975
+ "nulls": "last"
976
+ }
977
+ ],
978
+ "isUnique": false,
979
+ "concurrently": false,
980
+ "method": "btree",
981
+ "with": {}
982
+ },
983
+ "offers_obligation_side_tick_idx": {
984
+ "name": "offers_obligation_side_tick_idx",
985
+ "columns": [
986
+ {
987
+ "expression": "obligation_id",
988
+ "isExpression": false,
989
+ "asc": true,
990
+ "nulls": "last"
991
+ },
992
+ {
993
+ "expression": "buy",
994
+ "isExpression": false,
995
+ "asc": true,
996
+ "nulls": "last"
997
+ },
998
+ {
999
+ "expression": "tick",
1000
+ "isExpression": false,
1001
+ "asc": true,
1002
+ "nulls": "last"
1003
+ }
1004
+ ],
1005
+ "isUnique": false,
1006
+ "concurrently": false,
1007
+ "method": "btree",
1008
+ "with": {}
1009
+ },
1010
+ "offers_group_maker_idx": {
1011
+ "name": "offers_group_maker_idx",
1012
+ "columns": [
1013
+ {
1014
+ "expression": "group_maker",
1015
+ "isExpression": false,
1016
+ "asc": true,
1017
+ "nulls": "last"
1018
+ },
1019
+ {
1020
+ "expression": "hash",
1021
+ "isExpression": false,
1022
+ "asc": true,
1023
+ "nulls": "last"
1024
+ },
1025
+ {
1026
+ "expression": "obligation_id",
1027
+ "isExpression": false,
1028
+ "asc": true,
1029
+ "nulls": "last"
1030
+ }
1031
+ ],
1032
+ "isUnique": false,
1033
+ "concurrently": false,
1034
+ "method": "btree",
1035
+ "with": {}
1036
+ },
1037
+ "offers_group_winner_expr_idx": {
1038
+ "name": "offers_group_winner_expr_idx",
1039
+ "columns": [
1040
+ {
1041
+ "expression": "group_chain_id",
1042
+ "isExpression": false,
1043
+ "asc": true,
1044
+ "nulls": "last"
1045
+ },
1046
+ {
1047
+ "expression": "group_maker",
1048
+ "isExpression": false,
1049
+ "asc": true,
1050
+ "nulls": "last"
1051
+ },
1052
+ {
1053
+ "expression": "group_group",
1054
+ "isExpression": false,
1055
+ "asc": true,
1056
+ "nulls": "last"
1057
+ },
1058
+ {
1059
+ "expression": "obligation_id",
1060
+ "isExpression": false,
1061
+ "asc": true,
1062
+ "nulls": "last"
1063
+ },
1064
+ {
1065
+ "expression": "buy",
1066
+ "isExpression": false,
1067
+ "asc": true,
1068
+ "nulls": "last"
1069
+ },
1070
+ {
1071
+ "expression": "(CASE WHEN \"buy\" THEN -\"tick\" ELSE \"tick\" END)",
1072
+ "asc": true,
1073
+ "isExpression": true,
1074
+ "nulls": "last"
1075
+ },
1076
+ {
1077
+ "expression": "block_number",
1078
+ "isExpression": false,
1079
+ "asc": true,
1080
+ "nulls": "last"
1081
+ },
1082
+ {
1083
+ "expression": "hash",
1084
+ "isExpression": false,
1085
+ "asc": true,
1086
+ "nulls": "last"
1087
+ }
1088
+ ],
1089
+ "isUnique": false,
1090
+ "concurrently": false,
1091
+ "method": "btree",
1092
+ "with": {}
1093
+ }
1094
+ },
1095
+ "foreignKeys": {
1096
+ "offers_obligation_id_obligation_id_keys_obligation_id_fk": {
1097
+ "name": "offers_obligation_id_obligation_id_keys_obligation_id_fk",
1098
+ "tableFrom": "offers",
1099
+ "tableTo": "obligation_id_keys",
1100
+ "schemaTo": "router_v1.14",
1101
+ "columnsFrom": ["obligation_id"],
1102
+ "columnsTo": ["obligation_id"],
1103
+ "onDelete": "cascade",
1104
+ "onUpdate": "no action"
1105
+ },
1106
+ "offers_groups_fk": {
1107
+ "name": "offers_groups_fk",
1108
+ "tableFrom": "offers",
1109
+ "tableTo": "groups",
1110
+ "schemaTo": "router_v1.14",
1111
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1112
+ "columnsTo": ["chain_id", "maker", "group"],
1113
+ "onDelete": "cascade",
1114
+ "onUpdate": "no action"
1115
+ }
1116
+ },
1117
+ "compositePrimaryKeys": {
1118
+ "offers_pk": {
1119
+ "name": "offers_pk",
1120
+ "columns": ["hash", "obligation_id"]
1121
+ }
1122
+ },
1123
+ "uniqueConstraints": {},
1124
+ "policies": {},
1125
+ "checkConstraints": {},
1126
+ "isRLSEnabled": false
1127
+ },
1128
+ "router_v1.14.offers_callbacks": {
1129
+ "name": "offers_callbacks",
1130
+ "schema": "router_v1.14",
1131
+ "columns": {
1132
+ "offer_hash": {
1133
+ "name": "offer_hash",
1134
+ "type": "varchar(66)",
1135
+ "primaryKey": false,
1136
+ "notNull": true
1137
+ },
1138
+ "obligation_id": {
1139
+ "name": "obligation_id",
1140
+ "type": "varchar(66)",
1141
+ "primaryKey": false,
1142
+ "notNull": true
1143
+ },
1144
+ "callback_id": {
1145
+ "name": "callback_id",
1146
+ "type": "varchar(66)",
1147
+ "primaryKey": false,
1148
+ "notNull": false
1149
+ }
1150
+ },
1151
+ "indexes": {},
1152
+ "foreignKeys": {
1153
+ "offers_callbacks_offer_fk": {
1154
+ "name": "offers_callbacks_offer_fk",
1155
+ "tableFrom": "offers_callbacks",
1156
+ "tableTo": "offers",
1157
+ "schemaTo": "router_v1.14",
1158
+ "columnsFrom": ["offer_hash", "obligation_id"],
1159
+ "columnsTo": ["hash", "obligation_id"],
1160
+ "onDelete": "cascade",
1161
+ "onUpdate": "no action"
1162
+ }
1163
+ },
1164
+ "compositePrimaryKeys": {
1165
+ "offers_callbacks_pk": {
1166
+ "name": "offers_callbacks_pk",
1167
+ "columns": ["offer_hash", "obligation_id", "callback_id"]
1168
+ }
1169
+ },
1170
+ "uniqueConstraints": {},
1171
+ "policies": {},
1172
+ "checkConstraints": {},
1173
+ "isRLSEnabled": false
1174
+ },
1175
+ "router_v1.14.offsets": {
1176
+ "name": "offsets",
1177
+ "schema": "router_v1.14",
1178
+ "columns": {
1179
+ "chain_id": {
1180
+ "name": "chain_id",
1181
+ "type": "bigint",
1182
+ "primaryKey": false,
1183
+ "notNull": true
1184
+ },
1185
+ "user": {
1186
+ "name": "user",
1187
+ "type": "varchar(42)",
1188
+ "primaryKey": false,
1189
+ "notNull": true
1190
+ },
1191
+ "contract": {
1192
+ "name": "contract",
1193
+ "type": "varchar(66)",
1194
+ "primaryKey": false,
1195
+ "notNull": true
1196
+ },
1197
+ "group": {
1198
+ "name": "group",
1199
+ "type": "varchar(66)",
1200
+ "primaryKey": false,
1201
+ "notNull": true
1202
+ },
1203
+ "obligation_id": {
1204
+ "name": "obligation_id",
1205
+ "type": "varchar(66)",
1206
+ "primaryKey": false,
1207
+ "notNull": true
1208
+ },
1209
+ "value": {
1210
+ "name": "value",
1211
+ "type": "numeric(78, 0)",
1212
+ "primaryKey": false,
1213
+ "notNull": true
1214
+ }
1215
+ },
1216
+ "indexes": {
1217
+ "offsets_position_obligation_idx": {
1218
+ "name": "offsets_position_obligation_idx",
1219
+ "columns": [
1220
+ {
1221
+ "expression": "chain_id",
1222
+ "isExpression": false,
1223
+ "asc": true,
1224
+ "nulls": "last"
1225
+ },
1226
+ {
1227
+ "expression": "contract",
1228
+ "isExpression": false,
1229
+ "asc": true,
1230
+ "nulls": "last"
1231
+ },
1232
+ {
1233
+ "expression": "user",
1234
+ "isExpression": false,
1235
+ "asc": true,
1236
+ "nulls": "last"
1237
+ },
1238
+ {
1239
+ "expression": "obligation_id",
1240
+ "isExpression": false,
1241
+ "asc": true,
1242
+ "nulls": "last"
1243
+ }
1244
+ ],
1245
+ "isUnique": false,
1246
+ "concurrently": false,
1247
+ "method": "btree",
1248
+ "with": {}
1249
+ }
1250
+ },
1251
+ "foreignKeys": {
1252
+ "offsets_lots_positions_fk": {
1253
+ "name": "offsets_lots_positions_fk",
1254
+ "tableFrom": "offsets",
1255
+ "tableTo": "lots_positions",
1256
+ "schemaTo": "router_v1.14",
1257
+ "columnsFrom": ["chain_id", "contract", "user"],
1258
+ "columnsTo": ["chain_id", "contract", "user"],
1259
+ "onDelete": "cascade",
1260
+ "onUpdate": "no action"
1261
+ }
1262
+ },
1263
+ "compositePrimaryKeys": {
1264
+ "offsets_pk": {
1265
+ "name": "offsets_pk",
1266
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
1267
+ }
1268
+ },
1269
+ "uniqueConstraints": {},
1270
+ "policies": {},
1271
+ "checkConstraints": {},
1272
+ "isRLSEnabled": false
1273
+ },
1274
+ "router_v1.14.oracles": {
1275
+ "name": "oracles",
1276
+ "schema": "router_v1.14",
1277
+ "columns": {
1278
+ "chain_id": {
1279
+ "name": "chain_id",
1280
+ "type": "bigint",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "address": {
1285
+ "name": "address",
1286
+ "type": "varchar(42)",
1287
+ "primaryKey": false,
1288
+ "notNull": true
1289
+ },
1290
+ "price": {
1291
+ "name": "price",
1292
+ "type": "numeric(78, 0)",
1293
+ "primaryKey": false,
1294
+ "notNull": false
1295
+ },
1296
+ "block_number": {
1297
+ "name": "block_number",
1298
+ "type": "bigint",
1299
+ "primaryKey": false,
1300
+ "notNull": true
1301
+ },
1302
+ "updated_at": {
1303
+ "name": "updated_at",
1304
+ "type": "timestamp",
1305
+ "primaryKey": false,
1306
+ "notNull": true,
1307
+ "default": "now()"
1308
+ }
1309
+ },
1310
+ "indexes": {},
1311
+ "foreignKeys": {},
1312
+ "compositePrimaryKeys": {
1313
+ "oracles_pk": {
1314
+ "name": "oracles_pk",
1315
+ "columns": ["chain_id", "address"]
1316
+ }
1317
+ },
1318
+ "uniqueConstraints": {},
1319
+ "policies": {},
1320
+ "checkConstraints": {},
1321
+ "isRLSEnabled": false
1322
+ },
1323
+ "router_v1.14.pending_links": {
1324
+ "name": "pending_links",
1325
+ "schema": "router_v1.14",
1326
+ "columns": {
1327
+ "key": {
1328
+ "name": "key",
1329
+ "type": "varchar(191)",
1330
+ "primaryKey": true,
1331
+ "notNull": true
1332
+ },
1333
+ "type": {
1334
+ "name": "type",
1335
+ "type": "text",
1336
+ "primaryKey": false,
1337
+ "notNull": true
1338
+ },
1339
+ "status": {
1340
+ "name": "status",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true
1344
+ },
1345
+ "chain_id": {
1346
+ "name": "chain_id",
1347
+ "type": "bigint",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "event_id": {
1352
+ "name": "event_id",
1353
+ "type": "varchar(128)",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "obligation_id": {
1358
+ "name": "obligation_id",
1359
+ "type": "varchar(66)",
1360
+ "primaryKey": false,
1361
+ "notNull": true
1362
+ },
1363
+ "collateral_index": {
1364
+ "name": "collateral_index",
1365
+ "type": "integer",
1366
+ "primaryKey": false,
1367
+ "notNull": true
1368
+ },
1369
+ "user": {
1370
+ "name": "user",
1371
+ "type": "varchar(42)",
1372
+ "primaryKey": false,
1373
+ "notNull": true
1374
+ },
1375
+ "amount": {
1376
+ "name": "amount",
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
+ "first_seen_block": {
1388
+ "name": "first_seen_block",
1389
+ "type": "bigint",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "last_tried_block": {
1394
+ "name": "last_tried_block",
1395
+ "type": "bigint",
1396
+ "primaryKey": false,
1397
+ "notNull": false
1398
+ },
1399
+ "attempts": {
1400
+ "name": "attempts",
1401
+ "type": "integer",
1402
+ "primaryKey": false,
1403
+ "notNull": true,
1404
+ "default": 0
1405
+ },
1406
+ "ignored_reason": {
1407
+ "name": "ignored_reason",
1408
+ "type": "text",
1409
+ "primaryKey": false,
1410
+ "notNull": false
1411
+ },
1412
+ "resolved_at": {
1413
+ "name": "resolved_at",
1414
+ "type": "timestamp",
1415
+ "primaryKey": false,
1416
+ "notNull": false
1417
+ },
1418
+ "updated_at": {
1419
+ "name": "updated_at",
1420
+ "type": "timestamp",
1421
+ "primaryKey": false,
1422
+ "notNull": true,
1423
+ "default": "now()"
1424
+ }
1425
+ },
1426
+ "indexes": {
1427
+ "pending_links_pending_scan_idx": {
1428
+ "name": "pending_links_pending_scan_idx",
1429
+ "columns": [
1430
+ {
1431
+ "expression": "chain_id",
1432
+ "isExpression": false,
1433
+ "asc": true,
1434
+ "nulls": "last"
1435
+ },
1436
+ {
1437
+ "expression": "type",
1438
+ "isExpression": false,
1439
+ "asc": true,
1440
+ "nulls": "last"
1441
+ },
1442
+ {
1443
+ "expression": "status",
1444
+ "isExpression": false,
1445
+ "asc": true,
1446
+ "nulls": "last"
1447
+ },
1448
+ {
1449
+ "expression": "first_seen_block",
1450
+ "isExpression": false,
1451
+ "asc": true,
1452
+ "nulls": "last"
1453
+ }
1454
+ ],
1455
+ "isUnique": false,
1456
+ "concurrently": false,
1457
+ "method": "btree",
1458
+ "with": {}
1459
+ },
1460
+ "pending_links_event_id_idx": {
1461
+ "name": "pending_links_event_id_idx",
1462
+ "columns": [
1463
+ {
1464
+ "expression": "chain_id",
1465
+ "isExpression": false,
1466
+ "asc": true,
1467
+ "nulls": "last"
1468
+ },
1469
+ {
1470
+ "expression": "event_id",
1471
+ "isExpression": false,
1472
+ "asc": true,
1473
+ "nulls": "last"
1474
+ }
1475
+ ],
1476
+ "isUnique": false,
1477
+ "concurrently": false,
1478
+ "method": "btree",
1479
+ "with": {}
1480
+ }
1481
+ },
1482
+ "foreignKeys": {},
1483
+ "compositePrimaryKeys": {},
1484
+ "uniqueConstraints": {},
1485
+ "policies": {},
1486
+ "checkConstraints": {},
1487
+ "isRLSEnabled": false
1488
+ },
1489
+ "router_v1.14.position_types": {
1490
+ "name": "position_types",
1491
+ "schema": "router_v1.14",
1492
+ "columns": {
1493
+ "id": {
1494
+ "name": "id",
1495
+ "type": "serial",
1496
+ "primaryKey": true,
1497
+ "notNull": true
1498
+ },
1499
+ "type": {
1500
+ "name": "type",
1501
+ "type": "position_type",
1502
+ "typeSchema": "router_v1.14",
1503
+ "primaryKey": false,
1504
+ "notNull": true
1505
+ }
1506
+ },
1507
+ "indexes": {},
1508
+ "foreignKeys": {},
1509
+ "compositePrimaryKeys": {},
1510
+ "uniqueConstraints": {},
1511
+ "policies": {},
1512
+ "checkConstraints": {},
1513
+ "isRLSEnabled": false
1514
+ },
1515
+ "router_v1.14.positions": {
1516
+ "name": "positions",
1517
+ "schema": "router_v1.14",
1518
+ "columns": {
1519
+ "chain_id": {
1520
+ "name": "chain_id",
1521
+ "type": "bigint",
1522
+ "primaryKey": false,
1523
+ "notNull": true
1524
+ },
1525
+ "contract": {
1526
+ "name": "contract",
1527
+ "type": "varchar(66)",
1528
+ "primaryKey": false,
1529
+ "notNull": true
1530
+ },
1531
+ "user": {
1532
+ "name": "user",
1533
+ "type": "varchar(42)",
1534
+ "primaryKey": false,
1535
+ "notNull": true
1536
+ },
1537
+ "position_type_id": {
1538
+ "name": "position_type_id",
1539
+ "type": "integer",
1540
+ "primaryKey": false,
1541
+ "notNull": true
1542
+ },
1543
+ "balance": {
1544
+ "name": "balance",
1545
+ "type": "numeric(78, 0)",
1546
+ "primaryKey": false,
1547
+ "notNull": false
1548
+ },
1549
+ "asset": {
1550
+ "name": "asset",
1551
+ "type": "varchar(42)",
1552
+ "primaryKey": false,
1553
+ "notNull": true
1554
+ },
1555
+ "block_number": {
1556
+ "name": "block_number",
1557
+ "type": "bigint",
1558
+ "primaryKey": false,
1559
+ "notNull": true
1560
+ },
1561
+ "updated_at": {
1562
+ "name": "updated_at",
1563
+ "type": "timestamp",
1564
+ "primaryKey": false,
1565
+ "notNull": true,
1566
+ "default": "now()"
1567
+ }
1568
+ },
1569
+ "indexes": {},
1570
+ "foreignKeys": {
1571
+ "positions_position_type_id_position_types_id_fk": {
1572
+ "name": "positions_position_type_id_position_types_id_fk",
1573
+ "tableFrom": "positions",
1574
+ "tableTo": "position_types",
1575
+ "schemaTo": "router_v1.14",
1576
+ "columnsFrom": ["position_type_id"],
1577
+ "columnsTo": ["id"],
1578
+ "onDelete": "no action",
1579
+ "onUpdate": "no action"
1580
+ }
1581
+ },
1582
+ "compositePrimaryKeys": {
1583
+ "positions_pk": {
1584
+ "name": "positions_pk",
1585
+ "columns": ["chain_id", "contract", "user", "position_type_id", "asset"]
1586
+ }
1587
+ },
1588
+ "uniqueConstraints": {},
1589
+ "policies": {},
1590
+ "checkConstraints": {},
1591
+ "isRLSEnabled": false
1592
+ },
1593
+ "router_v1.14.status": {
1594
+ "name": "status",
1595
+ "schema": "router_v1.14",
1596
+ "columns": {
1597
+ "id": {
1598
+ "name": "id",
1599
+ "type": "serial",
1600
+ "primaryKey": true,
1601
+ "notNull": true
1602
+ },
1603
+ "code": {
1604
+ "name": "code",
1605
+ "type": "status_code",
1606
+ "typeSchema": "router_v1.14",
1607
+ "primaryKey": false,
1608
+ "notNull": false
1609
+ }
1610
+ },
1611
+ "indexes": {},
1612
+ "foreignKeys": {},
1613
+ "compositePrimaryKeys": {},
1614
+ "uniqueConstraints": {
1615
+ "status_code_unique": {
1616
+ "name": "status_code_unique",
1617
+ "nullsNotDistinct": false,
1618
+ "columns": ["code"]
1619
+ }
1620
+ },
1621
+ "policies": {},
1622
+ "checkConstraints": {},
1623
+ "isRLSEnabled": false
1624
+ },
1625
+ "router_v1.14.transfers": {
1626
+ "name": "transfers",
1627
+ "schema": "router_v1.14",
1628
+ "columns": {
1629
+ "event_id": {
1630
+ "name": "event_id",
1631
+ "type": "varchar(128)",
1632
+ "primaryKey": true,
1633
+ "notNull": true
1634
+ },
1635
+ "chain_id": {
1636
+ "name": "chain_id",
1637
+ "type": "bigint",
1638
+ "primaryKey": false,
1639
+ "notNull": true
1640
+ },
1641
+ "contract": {
1642
+ "name": "contract",
1643
+ "type": "varchar(66)",
1644
+ "primaryKey": false,
1645
+ "notNull": true
1646
+ },
1647
+ "from": {
1648
+ "name": "from",
1649
+ "type": "varchar(42)",
1650
+ "primaryKey": false,
1651
+ "notNull": true
1652
+ },
1653
+ "to": {
1654
+ "name": "to",
1655
+ "type": "varchar(42)",
1656
+ "primaryKey": false,
1657
+ "notNull": true
1658
+ },
1659
+ "value": {
1660
+ "name": "value",
1661
+ "type": "numeric(78, 0)",
1662
+ "primaryKey": false,
1663
+ "notNull": true
1664
+ },
1665
+ "position_type_id": {
1666
+ "name": "position_type_id",
1667
+ "type": "integer",
1668
+ "primaryKey": false,
1669
+ "notNull": true
1670
+ },
1671
+ "asset": {
1672
+ "name": "asset",
1673
+ "type": "varchar(42)",
1674
+ "primaryKey": false,
1675
+ "notNull": true
1676
+ },
1677
+ "block_number": {
1678
+ "name": "block_number",
1679
+ "type": "bigint",
1680
+ "primaryKey": false,
1681
+ "notNull": true
1682
+ },
1683
+ "created_at": {
1684
+ "name": "created_at",
1685
+ "type": "timestamp",
1686
+ "primaryKey": false,
1687
+ "notNull": true,
1688
+ "default": "now()"
1689
+ }
1690
+ },
1691
+ "indexes": {
1692
+ "transfers_chain_contract_user_idx": {
1693
+ "name": "transfers_chain_contract_user_idx",
1694
+ "columns": [
1695
+ {
1696
+ "expression": "chain_id",
1697
+ "isExpression": false,
1698
+ "asc": true,
1699
+ "nulls": "last"
1700
+ },
1701
+ {
1702
+ "expression": "contract",
1703
+ "isExpression": false,
1704
+ "asc": true,
1705
+ "nulls": "last"
1706
+ },
1707
+ {
1708
+ "expression": "from",
1709
+ "isExpression": false,
1710
+ "asc": true,
1711
+ "nulls": "last"
1712
+ },
1713
+ {
1714
+ "expression": "to",
1715
+ "isExpression": false,
1716
+ "asc": true,
1717
+ "nulls": "last"
1718
+ },
1719
+ {
1720
+ "expression": "block_number",
1721
+ "isExpression": false,
1722
+ "asc": true,
1723
+ "nulls": "last"
1724
+ }
1725
+ ],
1726
+ "isUnique": false,
1727
+ "concurrently": false,
1728
+ "method": "btree",
1729
+ "with": {}
1730
+ },
1731
+ "transfers_chain_type_block_idx": {
1732
+ "name": "transfers_chain_type_block_idx",
1733
+ "columns": [
1734
+ {
1735
+ "expression": "chain_id",
1736
+ "isExpression": false,
1737
+ "asc": true,
1738
+ "nulls": "last"
1739
+ },
1740
+ {
1741
+ "expression": "position_type_id",
1742
+ "isExpression": false,
1743
+ "asc": true,
1744
+ "nulls": "last"
1745
+ },
1746
+ {
1747
+ "expression": "block_number",
1748
+ "isExpression": false,
1749
+ "asc": true,
1750
+ "nulls": "last"
1751
+ }
1752
+ ],
1753
+ "isUnique": false,
1754
+ "concurrently": false,
1755
+ "method": "btree",
1756
+ "with": {}
1757
+ }
1758
+ },
1759
+ "foreignKeys": {
1760
+ "transfers_position_type_id_position_types_id_fk": {
1761
+ "name": "transfers_position_type_id_position_types_id_fk",
1762
+ "tableFrom": "transfers",
1763
+ "tableTo": "position_types",
1764
+ "schemaTo": "router_v1.14",
1765
+ "columnsFrom": ["position_type_id"],
1766
+ "columnsTo": ["id"],
1767
+ "onDelete": "no action",
1768
+ "onUpdate": "no action"
1769
+ },
1770
+ "transfers_positions_from_fk": {
1771
+ "name": "transfers_positions_from_fk",
1772
+ "tableFrom": "transfers",
1773
+ "tableTo": "positions",
1774
+ "schemaTo": "router_v1.14",
1775
+ "columnsFrom": ["chain_id", "contract", "from", "position_type_id", "asset"],
1776
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1777
+ "onDelete": "cascade",
1778
+ "onUpdate": "no action"
1779
+ },
1780
+ "transfers_positions_to_fk": {
1781
+ "name": "transfers_positions_to_fk",
1782
+ "tableFrom": "transfers",
1783
+ "tableTo": "positions",
1784
+ "schemaTo": "router_v1.14",
1785
+ "columnsFrom": ["chain_id", "contract", "to", "position_type_id", "asset"],
1786
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1787
+ "onDelete": "cascade",
1788
+ "onUpdate": "no action"
1789
+ }
1790
+ },
1791
+ "compositePrimaryKeys": {},
1792
+ "uniqueConstraints": {},
1793
+ "policies": {},
1794
+ "checkConstraints": {},
1795
+ "isRLSEnabled": false
1796
+ },
1797
+ "router_v1.14.trees": {
1798
+ "name": "trees",
1799
+ "schema": "router_v1.14",
1800
+ "columns": {
1801
+ "root": {
1802
+ "name": "root",
1803
+ "type": "varchar(66)",
1804
+ "primaryKey": true,
1805
+ "notNull": true
1806
+ },
1807
+ "root_signature": {
1808
+ "name": "root_signature",
1809
+ "type": "varchar(132)",
1810
+ "primaryKey": false,
1811
+ "notNull": true
1812
+ },
1813
+ "created_at": {
1814
+ "name": "created_at",
1815
+ "type": "timestamp",
1816
+ "primaryKey": false,
1817
+ "notNull": true,
1818
+ "default": "now()"
1819
+ }
1820
+ },
1821
+ "indexes": {},
1822
+ "foreignKeys": {},
1823
+ "compositePrimaryKeys": {},
1824
+ "uniqueConstraints": {},
1825
+ "policies": {},
1826
+ "checkConstraints": {},
1827
+ "isRLSEnabled": false
1828
+ },
1829
+ "router_v1.14.validations": {
1830
+ "name": "validations",
1831
+ "schema": "router_v1.14",
1832
+ "columns": {
1833
+ "offer_hash": {
1834
+ "name": "offer_hash",
1835
+ "type": "varchar(66)",
1836
+ "primaryKey": false,
1837
+ "notNull": true
1838
+ },
1839
+ "obligation_id": {
1840
+ "name": "obligation_id",
1841
+ "type": "varchar(66)",
1842
+ "primaryKey": false,
1843
+ "notNull": true
1844
+ },
1845
+ "status_id": {
1846
+ "name": "status_id",
1847
+ "type": "integer",
1848
+ "primaryKey": false,
1849
+ "notNull": true
1850
+ },
1851
+ "updated_at": {
1852
+ "name": "updated_at",
1853
+ "type": "timestamp",
1854
+ "primaryKey": false,
1855
+ "notNull": true,
1856
+ "default": "now()"
1857
+ }
1858
+ },
1859
+ "indexes": {},
1860
+ "foreignKeys": {
1861
+ "validations_status_id_status_id_fk": {
1862
+ "name": "validations_status_id_status_id_fk",
1863
+ "tableFrom": "validations",
1864
+ "tableTo": "status",
1865
+ "schemaTo": "router_v1.14",
1866
+ "columnsFrom": ["status_id"],
1867
+ "columnsTo": ["id"],
1868
+ "onDelete": "no action",
1869
+ "onUpdate": "no action"
1870
+ },
1871
+ "validations_offer_fk": {
1872
+ "name": "validations_offer_fk",
1873
+ "tableFrom": "validations",
1874
+ "tableTo": "offers",
1875
+ "schemaTo": "router_v1.14",
1876
+ "columnsFrom": ["offer_hash", "obligation_id"],
1877
+ "columnsTo": ["hash", "obligation_id"],
1878
+ "onDelete": "cascade",
1879
+ "onUpdate": "no action"
1880
+ }
1881
+ },
1882
+ "compositePrimaryKeys": {
1883
+ "validations_pk": {
1884
+ "name": "validations_pk",
1885
+ "columns": ["offer_hash", "obligation_id"]
1886
+ }
1887
+ },
1888
+ "uniqueConstraints": {},
1889
+ "policies": {},
1890
+ "checkConstraints": {},
1891
+ "isRLSEnabled": false
1892
+ }
1893
+ },
1894
+ "enums": {
1895
+ "router_v1.14.callback_type": {
1896
+ "name": "callback_type",
1897
+ "schema": "router_v1.14",
1898
+ "values": ["empty"]
1899
+ },
1900
+ "router_v1.14.position_type": {
1901
+ "name": "position_type",
1902
+ "schema": "router_v1.14",
1903
+ "values": ["erc20", "vault_v1", "debtOf", "collateralOf"]
1904
+ },
1905
+ "router_v1.14.status_code": {
1906
+ "name": "status_code",
1907
+ "schema": "router_v1.14",
1908
+ "values": ["VALID", "SIMULATION_ERROR"]
1909
+ }
1910
+ },
1911
+ "schemas": {},
1912
+ "sequences": {},
1913
+ "roles": {},
1914
+ "policies": {},
1915
+ "views": {},
1916
+ "_meta": {
1917
+ "columns": {},
1918
+ "schemas": {},
1919
+ "tables": {}
1920
+ }
1921
+ }