@morpho-dev/router 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +20 -5
  2. package/dist/cli.js +12198 -6809
  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/0050_contract-sync-v1.16.sql +305 -0
  20. package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
  21. package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
  22. package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
  23. package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
  24. package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
  25. package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
  26. package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
  27. package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
  28. package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
  29. package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
  30. package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
  31. package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
  32. package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
  33. package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
  34. package/dist/drizzle/migrations/meta/0050_snapshot.json +2035 -0
  35. package/dist/drizzle/migrations/meta/_journal.json +119 -0
  36. package/dist/evm/bytecode/morpho.txt +1 -1
  37. package/dist/index.browser.d.mts +611 -282
  38. package/dist/index.browser.d.mts.map +1 -1
  39. package/dist/index.browser.mjs +735 -448
  40. package/dist/index.browser.mjs.map +1 -1
  41. package/dist/index.node.d.mts +1525 -614
  42. package/dist/index.node.d.mts.map +1 -1
  43. package/dist/index.node.mjs +9493 -5238
  44. package/dist/index.node.mjs.map +1 -1
  45. package/dist/server-DNFuP89-.js +9573 -0
  46. package/dist/server.js +9617 -0
  47. package/docs/integrator.md +14 -24
  48. package/package.json +7 -4
@@ -0,0 +1,1960 @@
1
+ {
2
+ "id": "526a24bc-3f09-47a6-8562-371bcd877626",
3
+ "prevId": "ac74b0b5-6030-4723-b5f1-dc8dcaad4e08",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "router_v1.13.callbacks": {
8
+ "name": "callbacks",
9
+ "schema": "router_v1.13",
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.13",
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.13",
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.13.chains": {
69
+ "name": "chains",
70
+ "schema": "router_v1.13",
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.13.collectors": {
149
+ "name": "collectors",
150
+ "schema": "router_v1.13",
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.13",
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.13.consumed_events": {
227
+ "name": "consumed_events",
228
+ "schema": "router_v1.13",
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.13",
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.13.groups": {
337
+ "name": "groups",
338
+ "schema": "router_v1.13",
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
+ "groups_chain_id_maker_group_consumed_idx": {
380
+ "name": "groups_chain_id_maker_group_consumed_idx",
381
+ "columns": [
382
+ {
383
+ "expression": "chain_id",
384
+ "isExpression": false,
385
+ "asc": true,
386
+ "nulls": "last"
387
+ },
388
+ {
389
+ "expression": "maker",
390
+ "isExpression": false,
391
+ "asc": true,
392
+ "nulls": "last"
393
+ },
394
+ {
395
+ "expression": "group",
396
+ "isExpression": false,
397
+ "asc": true,
398
+ "nulls": "last"
399
+ },
400
+ {
401
+ "expression": "consumed",
402
+ "isExpression": false,
403
+ "asc": true,
404
+ "nulls": "last"
405
+ }
406
+ ],
407
+ "isUnique": false,
408
+ "concurrently": false,
409
+ "method": "btree",
410
+ "with": {}
411
+ }
412
+ },
413
+ "foreignKeys": {},
414
+ "compositePrimaryKeys": {
415
+ "groups_pk": {
416
+ "name": "groups_pk",
417
+ "columns": ["chain_id", "maker", "group"]
418
+ }
419
+ },
420
+ "uniqueConstraints": {},
421
+ "policies": {},
422
+ "checkConstraints": {},
423
+ "isRLSEnabled": false
424
+ },
425
+ "router_v1.13.lots": {
426
+ "name": "lots",
427
+ "schema": "router_v1.13",
428
+ "columns": {
429
+ "chain_id": {
430
+ "name": "chain_id",
431
+ "type": "bigint",
432
+ "primaryKey": false,
433
+ "notNull": true
434
+ },
435
+ "user": {
436
+ "name": "user",
437
+ "type": "varchar(42)",
438
+ "primaryKey": false,
439
+ "notNull": true
440
+ },
441
+ "contract": {
442
+ "name": "contract",
443
+ "type": "varchar(66)",
444
+ "primaryKey": false,
445
+ "notNull": true
446
+ },
447
+ "group": {
448
+ "name": "group",
449
+ "type": "varchar(66)",
450
+ "primaryKey": false,
451
+ "notNull": true
452
+ },
453
+ "obligation_id": {
454
+ "name": "obligation_id",
455
+ "type": "varchar(42)",
456
+ "primaryKey": false,
457
+ "notNull": true
458
+ },
459
+ "lower": {
460
+ "name": "lower",
461
+ "type": "numeric(78, 0)",
462
+ "primaryKey": false,
463
+ "notNull": true
464
+ },
465
+ "upper": {
466
+ "name": "upper",
467
+ "type": "numeric(78, 0)",
468
+ "primaryKey": false,
469
+ "notNull": true
470
+ }
471
+ },
472
+ "indexes": {},
473
+ "foreignKeys": {
474
+ "lots_lots_positions_fk": {
475
+ "name": "lots_lots_positions_fk",
476
+ "tableFrom": "lots",
477
+ "tableTo": "lots_positions",
478
+ "schemaTo": "router_v1.13",
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.13",
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.13.lots_positions": {
507
+ "name": "lots_positions",
508
+ "schema": "router_v1.13",
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.13",
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.13.merkle_paths": {
560
+ "name": "merkle_paths",
561
+ "schema": "router_v1.13",
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(42)",
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.13",
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.13",
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.13.obligation_collaterals_v2": {
646
+ "name": "obligation_collaterals_v2",
647
+ "schema": "router_v1.13",
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
+ "collateral_index": {
674
+ "name": "collateral_index",
675
+ "type": "integer",
676
+ "primaryKey": false,
677
+ "notNull": true
678
+ },
679
+ "updated_at": {
680
+ "name": "updated_at",
681
+ "type": "timestamp",
682
+ "primaryKey": false,
683
+ "notNull": true,
684
+ "default": "now()"
685
+ }
686
+ },
687
+ "indexes": {
688
+ "obligation_collaterals_v2_obligation_key_idx": {
689
+ "name": "obligation_collaterals_v2_obligation_key_idx",
690
+ "columns": [
691
+ {
692
+ "expression": "obligation_key",
693
+ "isExpression": false,
694
+ "asc": true,
695
+ "nulls": "last"
696
+ }
697
+ ],
698
+ "isUnique": false,
699
+ "concurrently": false,
700
+ "method": "btree",
701
+ "with": {}
702
+ },
703
+ "obligation_collaterals_v2_oracle_address_idx": {
704
+ "name": "obligation_collaterals_v2_oracle_address_idx",
705
+ "columns": [
706
+ {
707
+ "expression": "oracle_address",
708
+ "isExpression": false,
709
+ "asc": true,
710
+ "nulls": "last"
711
+ }
712
+ ],
713
+ "isUnique": false,
714
+ "concurrently": false,
715
+ "method": "btree",
716
+ "with": {}
717
+ }
718
+ },
719
+ "foreignKeys": {
720
+ "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk": {
721
+ "name": "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk",
722
+ "tableFrom": "obligation_collaterals_v2",
723
+ "tableTo": "obligations",
724
+ "schemaTo": "router_v1.13",
725
+ "columnsFrom": ["obligation_key"],
726
+ "columnsTo": ["obligation_key"],
727
+ "onDelete": "cascade",
728
+ "onUpdate": "no action"
729
+ }
730
+ },
731
+ "compositePrimaryKeys": {
732
+ "obligation_collaterals_v2_pk": {
733
+ "name": "obligation_collaterals_v2_pk",
734
+ "columns": ["obligation_key", "asset"]
735
+ }
736
+ },
737
+ "uniqueConstraints": {},
738
+ "policies": {},
739
+ "checkConstraints": {},
740
+ "isRLSEnabled": false
741
+ },
742
+ "router_v1.13.obligation_id_keys": {
743
+ "name": "obligation_id_keys",
744
+ "schema": "router_v1.13",
745
+ "columns": {
746
+ "obligation_id": {
747
+ "name": "obligation_id",
748
+ "type": "varchar(42)",
749
+ "primaryKey": true,
750
+ "notNull": true
751
+ },
752
+ "obligation_key": {
753
+ "name": "obligation_key",
754
+ "type": "varchar(66)",
755
+ "primaryKey": false,
756
+ "notNull": true
757
+ },
758
+ "chain_id": {
759
+ "name": "chain_id",
760
+ "type": "bigint",
761
+ "primaryKey": false,
762
+ "notNull": true
763
+ },
764
+ "morpho_v2": {
765
+ "name": "morpho_v2",
766
+ "type": "varchar(42)",
767
+ "primaryKey": false,
768
+ "notNull": true
769
+ }
770
+ },
771
+ "indexes": {
772
+ "obligation_id_keys_obligation_key_idx": {
773
+ "name": "obligation_id_keys_obligation_key_idx",
774
+ "columns": [
775
+ {
776
+ "expression": "obligation_key",
777
+ "isExpression": false,
778
+ "asc": true,
779
+ "nulls": "last"
780
+ }
781
+ ],
782
+ "isUnique": false,
783
+ "concurrently": false,
784
+ "method": "btree",
785
+ "with": {}
786
+ },
787
+ "obligation_id_keys_chain_id_idx": {
788
+ "name": "obligation_id_keys_chain_id_idx",
789
+ "columns": [
790
+ {
791
+ "expression": "chain_id",
792
+ "isExpression": false,
793
+ "asc": true,
794
+ "nulls": "last"
795
+ }
796
+ ],
797
+ "isUnique": false,
798
+ "concurrently": false,
799
+ "method": "btree",
800
+ "with": {}
801
+ }
802
+ },
803
+ "foreignKeys": {
804
+ "obligation_id_keys_obligation_key_obligations_obligation_key_fk": {
805
+ "name": "obligation_id_keys_obligation_key_obligations_obligation_key_fk",
806
+ "tableFrom": "obligation_id_keys",
807
+ "tableTo": "obligations",
808
+ "schemaTo": "router_v1.13",
809
+ "columnsFrom": ["obligation_key"],
810
+ "columnsTo": ["obligation_key"],
811
+ "onDelete": "cascade",
812
+ "onUpdate": "no action"
813
+ }
814
+ },
815
+ "compositePrimaryKeys": {},
816
+ "uniqueConstraints": {},
817
+ "policies": {},
818
+ "checkConstraints": {},
819
+ "isRLSEnabled": false
820
+ },
821
+ "router_v1.13.obligations": {
822
+ "name": "obligations",
823
+ "schema": "router_v1.13",
824
+ "columns": {
825
+ "obligation_key": {
826
+ "name": "obligation_key",
827
+ "type": "varchar(66)",
828
+ "primaryKey": true,
829
+ "notNull": true
830
+ },
831
+ "loan_token": {
832
+ "name": "loan_token",
833
+ "type": "varchar(42)",
834
+ "primaryKey": false,
835
+ "notNull": true
836
+ },
837
+ "maturity": {
838
+ "name": "maturity",
839
+ "type": "integer",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "rcf_threshold": {
844
+ "name": "rcf_threshold",
845
+ "type": "numeric(78, 0)",
846
+ "primaryKey": false,
847
+ "notNull": true
848
+ }
849
+ },
850
+ "indexes": {},
851
+ "foreignKeys": {},
852
+ "compositePrimaryKeys": {},
853
+ "uniqueConstraints": {},
854
+ "policies": {},
855
+ "checkConstraints": {},
856
+ "isRLSEnabled": false
857
+ },
858
+ "router_v1.13.offers": {
859
+ "name": "offers",
860
+ "schema": "router_v1.13",
861
+ "columns": {
862
+ "hash": {
863
+ "name": "hash",
864
+ "type": "varchar(66)",
865
+ "primaryKey": false,
866
+ "notNull": true
867
+ },
868
+ "obligation_id": {
869
+ "name": "obligation_id",
870
+ "type": "varchar(42)",
871
+ "primaryKey": false,
872
+ "notNull": true
873
+ },
874
+ "assets": {
875
+ "name": "assets",
876
+ "type": "numeric(78, 0)",
877
+ "primaryKey": false,
878
+ "notNull": true
879
+ },
880
+ "obligation_units": {
881
+ "name": "obligation_units",
882
+ "type": "numeric(78, 0)",
883
+ "primaryKey": false,
884
+ "notNull": true,
885
+ "default": "'0'"
886
+ },
887
+ "obligation_shares": {
888
+ "name": "obligation_shares",
889
+ "type": "numeric(78, 0)",
890
+ "primaryKey": false,
891
+ "notNull": true,
892
+ "default": "'0'"
893
+ },
894
+ "tick": {
895
+ "name": "tick",
896
+ "type": "integer",
897
+ "primaryKey": false,
898
+ "notNull": true
899
+ },
900
+ "maturity": {
901
+ "name": "maturity",
902
+ "type": "integer",
903
+ "primaryKey": false,
904
+ "notNull": true
905
+ },
906
+ "expiry": {
907
+ "name": "expiry",
908
+ "type": "integer",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "start": {
913
+ "name": "start",
914
+ "type": "integer",
915
+ "primaryKey": false,
916
+ "notNull": true
917
+ },
918
+ "group_chain_id": {
919
+ "name": "group_chain_id",
920
+ "type": "bigint",
921
+ "primaryKey": false,
922
+ "notNull": true
923
+ },
924
+ "group_maker": {
925
+ "name": "group_maker",
926
+ "type": "varchar(42)",
927
+ "primaryKey": false,
928
+ "notNull": true
929
+ },
930
+ "group_group": {
931
+ "name": "group_group",
932
+ "type": "varchar(66)",
933
+ "primaryKey": false,
934
+ "notNull": true
935
+ },
936
+ "session": {
937
+ "name": "session",
938
+ "type": "varchar(66)",
939
+ "primaryKey": false,
940
+ "notNull": true
941
+ },
942
+ "buy": {
943
+ "name": "buy",
944
+ "type": "boolean",
945
+ "primaryKey": false,
946
+ "notNull": true
947
+ },
948
+ "callback_address": {
949
+ "name": "callback_address",
950
+ "type": "varchar(42)",
951
+ "primaryKey": false,
952
+ "notNull": true
953
+ },
954
+ "callback_data": {
955
+ "name": "callback_data",
956
+ "type": "text",
957
+ "primaryKey": false,
958
+ "notNull": true
959
+ },
960
+ "receiver_if_maker_is_seller": {
961
+ "name": "receiver_if_maker_is_seller",
962
+ "type": "varchar(42)",
963
+ "primaryKey": false,
964
+ "notNull": false
965
+ },
966
+ "block_number": {
967
+ "name": "block_number",
968
+ "type": "bigint",
969
+ "primaryKey": false,
970
+ "notNull": true
971
+ },
972
+ "updated_at": {
973
+ "name": "updated_at",
974
+ "type": "timestamp",
975
+ "primaryKey": false,
976
+ "notNull": true,
977
+ "default": "now()"
978
+ }
979
+ },
980
+ "indexes": {
981
+ "offers_group_fk_idx": {
982
+ "name": "offers_group_fk_idx",
983
+ "columns": [
984
+ {
985
+ "expression": "group_chain_id",
986
+ "isExpression": false,
987
+ "asc": true,
988
+ "nulls": "last"
989
+ },
990
+ {
991
+ "expression": "group_maker",
992
+ "isExpression": false,
993
+ "asc": true,
994
+ "nulls": "last"
995
+ },
996
+ {
997
+ "expression": "group_group",
998
+ "isExpression": false,
999
+ "asc": true,
1000
+ "nulls": "last"
1001
+ }
1002
+ ],
1003
+ "isUnique": false,
1004
+ "concurrently": false,
1005
+ "method": "btree",
1006
+ "with": {}
1007
+ },
1008
+ "offers_group_and_hash_idx": {
1009
+ "name": "offers_group_and_hash_idx",
1010
+ "columns": [
1011
+ {
1012
+ "expression": "group_chain_id",
1013
+ "isExpression": false,
1014
+ "asc": true,
1015
+ "nulls": "last"
1016
+ },
1017
+ {
1018
+ "expression": "group_maker",
1019
+ "isExpression": false,
1020
+ "asc": true,
1021
+ "nulls": "last"
1022
+ },
1023
+ {
1024
+ "expression": "group_group",
1025
+ "isExpression": false,
1026
+ "asc": true,
1027
+ "nulls": "last"
1028
+ },
1029
+ {
1030
+ "expression": "hash",
1031
+ "isExpression": false,
1032
+ "asc": true,
1033
+ "nulls": "last"
1034
+ }
1035
+ ],
1036
+ "isUnique": false,
1037
+ "concurrently": false,
1038
+ "method": "btree",
1039
+ "with": {}
1040
+ },
1041
+ "offers_obligation_id_side_idx": {
1042
+ "name": "offers_obligation_id_side_idx",
1043
+ "columns": [
1044
+ {
1045
+ "expression": "obligation_id",
1046
+ "isExpression": false,
1047
+ "asc": true,
1048
+ "nulls": "last"
1049
+ },
1050
+ {
1051
+ "expression": "buy",
1052
+ "isExpression": false,
1053
+ "asc": true,
1054
+ "nulls": "last"
1055
+ }
1056
+ ],
1057
+ "isUnique": false,
1058
+ "concurrently": false,
1059
+ "method": "btree",
1060
+ "with": {}
1061
+ },
1062
+ "offers_obligation_side_group_idx": {
1063
+ "name": "offers_obligation_side_group_idx",
1064
+ "columns": [
1065
+ {
1066
+ "expression": "obligation_id",
1067
+ "isExpression": false,
1068
+ "asc": true,
1069
+ "nulls": "last"
1070
+ },
1071
+ {
1072
+ "expression": "buy",
1073
+ "isExpression": false,
1074
+ "asc": true,
1075
+ "nulls": "last"
1076
+ },
1077
+ {
1078
+ "expression": "group_chain_id",
1079
+ "isExpression": false,
1080
+ "asc": true,
1081
+ "nulls": "last"
1082
+ },
1083
+ {
1084
+ "expression": "group_maker",
1085
+ "isExpression": false,
1086
+ "asc": true,
1087
+ "nulls": "last"
1088
+ },
1089
+ {
1090
+ "expression": "group_group",
1091
+ "isExpression": false,
1092
+ "asc": true,
1093
+ "nulls": "last"
1094
+ }
1095
+ ],
1096
+ "isUnique": false,
1097
+ "concurrently": false,
1098
+ "method": "btree",
1099
+ "with": {}
1100
+ },
1101
+ "offers_group_obligation_side_idx": {
1102
+ "name": "offers_group_obligation_side_idx",
1103
+ "columns": [
1104
+ {
1105
+ "expression": "group_chain_id",
1106
+ "isExpression": false,
1107
+ "asc": true,
1108
+ "nulls": "last"
1109
+ },
1110
+ {
1111
+ "expression": "group_maker",
1112
+ "isExpression": false,
1113
+ "asc": true,
1114
+ "nulls": "last"
1115
+ },
1116
+ {
1117
+ "expression": "group_group",
1118
+ "isExpression": false,
1119
+ "asc": true,
1120
+ "nulls": "last"
1121
+ },
1122
+ {
1123
+ "expression": "obligation_id",
1124
+ "isExpression": false,
1125
+ "asc": true,
1126
+ "nulls": "last"
1127
+ },
1128
+ {
1129
+ "expression": "buy",
1130
+ "isExpression": false,
1131
+ "asc": true,
1132
+ "nulls": "last"
1133
+ }
1134
+ ],
1135
+ "isUnique": false,
1136
+ "concurrently": false,
1137
+ "method": "btree",
1138
+ "with": {}
1139
+ }
1140
+ },
1141
+ "foreignKeys": {
1142
+ "offers_obligation_id_obligation_id_keys_obligation_id_fk": {
1143
+ "name": "offers_obligation_id_obligation_id_keys_obligation_id_fk",
1144
+ "tableFrom": "offers",
1145
+ "tableTo": "obligation_id_keys",
1146
+ "schemaTo": "router_v1.13",
1147
+ "columnsFrom": ["obligation_id"],
1148
+ "columnsTo": ["obligation_id"],
1149
+ "onDelete": "cascade",
1150
+ "onUpdate": "no action"
1151
+ },
1152
+ "offers_groups_fk": {
1153
+ "name": "offers_groups_fk",
1154
+ "tableFrom": "offers",
1155
+ "tableTo": "groups",
1156
+ "schemaTo": "router_v1.13",
1157
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1158
+ "columnsTo": ["chain_id", "maker", "group"],
1159
+ "onDelete": "cascade",
1160
+ "onUpdate": "no action"
1161
+ }
1162
+ },
1163
+ "compositePrimaryKeys": {
1164
+ "offers_pk": {
1165
+ "name": "offers_pk",
1166
+ "columns": ["hash", "obligation_id"]
1167
+ }
1168
+ },
1169
+ "uniqueConstraints": {},
1170
+ "policies": {},
1171
+ "checkConstraints": {},
1172
+ "isRLSEnabled": false
1173
+ },
1174
+ "router_v1.13.offers_callbacks": {
1175
+ "name": "offers_callbacks",
1176
+ "schema": "router_v1.13",
1177
+ "columns": {
1178
+ "offer_hash": {
1179
+ "name": "offer_hash",
1180
+ "type": "varchar(66)",
1181
+ "primaryKey": false,
1182
+ "notNull": true
1183
+ },
1184
+ "obligation_id": {
1185
+ "name": "obligation_id",
1186
+ "type": "varchar(42)",
1187
+ "primaryKey": false,
1188
+ "notNull": true
1189
+ },
1190
+ "callback_id": {
1191
+ "name": "callback_id",
1192
+ "type": "varchar(66)",
1193
+ "primaryKey": false,
1194
+ "notNull": false
1195
+ }
1196
+ },
1197
+ "indexes": {},
1198
+ "foreignKeys": {
1199
+ "offers_callbacks_offer_fk": {
1200
+ "name": "offers_callbacks_offer_fk",
1201
+ "tableFrom": "offers_callbacks",
1202
+ "tableTo": "offers",
1203
+ "schemaTo": "router_v1.13",
1204
+ "columnsFrom": ["offer_hash", "obligation_id"],
1205
+ "columnsTo": ["hash", "obligation_id"],
1206
+ "onDelete": "cascade",
1207
+ "onUpdate": "no action"
1208
+ }
1209
+ },
1210
+ "compositePrimaryKeys": {
1211
+ "offers_callbacks_pk": {
1212
+ "name": "offers_callbacks_pk",
1213
+ "columns": ["offer_hash", "obligation_id", "callback_id"]
1214
+ }
1215
+ },
1216
+ "uniqueConstraints": {},
1217
+ "policies": {},
1218
+ "checkConstraints": {},
1219
+ "isRLSEnabled": false
1220
+ },
1221
+ "router_v1.13.offsets": {
1222
+ "name": "offsets",
1223
+ "schema": "router_v1.13",
1224
+ "columns": {
1225
+ "chain_id": {
1226
+ "name": "chain_id",
1227
+ "type": "bigint",
1228
+ "primaryKey": false,
1229
+ "notNull": true
1230
+ },
1231
+ "user": {
1232
+ "name": "user",
1233
+ "type": "varchar(42)",
1234
+ "primaryKey": false,
1235
+ "notNull": true
1236
+ },
1237
+ "contract": {
1238
+ "name": "contract",
1239
+ "type": "varchar(66)",
1240
+ "primaryKey": false,
1241
+ "notNull": true
1242
+ },
1243
+ "group": {
1244
+ "name": "group",
1245
+ "type": "varchar(66)",
1246
+ "primaryKey": false,
1247
+ "notNull": true
1248
+ },
1249
+ "obligation_id": {
1250
+ "name": "obligation_id",
1251
+ "type": "varchar(42)",
1252
+ "primaryKey": false,
1253
+ "notNull": true
1254
+ },
1255
+ "value": {
1256
+ "name": "value",
1257
+ "type": "numeric(78, 0)",
1258
+ "primaryKey": false,
1259
+ "notNull": true
1260
+ }
1261
+ },
1262
+ "indexes": {},
1263
+ "foreignKeys": {
1264
+ "offsets_lots_positions_fk": {
1265
+ "name": "offsets_lots_positions_fk",
1266
+ "tableFrom": "offsets",
1267
+ "tableTo": "lots_positions",
1268
+ "schemaTo": "router_v1.13",
1269
+ "columnsFrom": ["chain_id", "contract", "user"],
1270
+ "columnsTo": ["chain_id", "contract", "user"],
1271
+ "onDelete": "cascade",
1272
+ "onUpdate": "no action"
1273
+ }
1274
+ },
1275
+ "compositePrimaryKeys": {
1276
+ "offsets_pk": {
1277
+ "name": "offsets_pk",
1278
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
1279
+ }
1280
+ },
1281
+ "uniqueConstraints": {},
1282
+ "policies": {},
1283
+ "checkConstraints": {},
1284
+ "isRLSEnabled": false
1285
+ },
1286
+ "router_v1.13.oracles": {
1287
+ "name": "oracles",
1288
+ "schema": "router_v1.13",
1289
+ "columns": {
1290
+ "chain_id": {
1291
+ "name": "chain_id",
1292
+ "type": "bigint",
1293
+ "primaryKey": false,
1294
+ "notNull": true
1295
+ },
1296
+ "address": {
1297
+ "name": "address",
1298
+ "type": "varchar(42)",
1299
+ "primaryKey": false,
1300
+ "notNull": true
1301
+ },
1302
+ "price": {
1303
+ "name": "price",
1304
+ "type": "numeric(78, 0)",
1305
+ "primaryKey": false,
1306
+ "notNull": false
1307
+ },
1308
+ "block_number": {
1309
+ "name": "block_number",
1310
+ "type": "bigint",
1311
+ "primaryKey": false,
1312
+ "notNull": true
1313
+ },
1314
+ "updated_at": {
1315
+ "name": "updated_at",
1316
+ "type": "timestamp",
1317
+ "primaryKey": false,
1318
+ "notNull": true,
1319
+ "default": "now()"
1320
+ }
1321
+ },
1322
+ "indexes": {},
1323
+ "foreignKeys": {},
1324
+ "compositePrimaryKeys": {
1325
+ "oracles_pk": {
1326
+ "name": "oracles_pk",
1327
+ "columns": ["chain_id", "address"]
1328
+ }
1329
+ },
1330
+ "uniqueConstraints": {},
1331
+ "policies": {},
1332
+ "checkConstraints": {},
1333
+ "isRLSEnabled": false
1334
+ },
1335
+ "router_v1.13.pending_links": {
1336
+ "name": "pending_links",
1337
+ "schema": "router_v1.13",
1338
+ "columns": {
1339
+ "key": {
1340
+ "name": "key",
1341
+ "type": "varchar(191)",
1342
+ "primaryKey": true,
1343
+ "notNull": true
1344
+ },
1345
+ "type": {
1346
+ "name": "type",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "status": {
1352
+ "name": "status",
1353
+ "type": "text",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "chain_id": {
1358
+ "name": "chain_id",
1359
+ "type": "bigint",
1360
+ "primaryKey": false,
1361
+ "notNull": true
1362
+ },
1363
+ "event_id": {
1364
+ "name": "event_id",
1365
+ "type": "varchar(128)",
1366
+ "primaryKey": false,
1367
+ "notNull": true
1368
+ },
1369
+ "obligation_id": {
1370
+ "name": "obligation_id",
1371
+ "type": "varchar(42)",
1372
+ "primaryKey": false,
1373
+ "notNull": true
1374
+ },
1375
+ "collateral_index": {
1376
+ "name": "collateral_index",
1377
+ "type": "integer",
1378
+ "primaryKey": false,
1379
+ "notNull": true
1380
+ },
1381
+ "user": {
1382
+ "name": "user",
1383
+ "type": "varchar(42)",
1384
+ "primaryKey": false,
1385
+ "notNull": true
1386
+ },
1387
+ "amount": {
1388
+ "name": "amount",
1389
+ "type": "numeric(78, 0)",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "block_number": {
1394
+ "name": "block_number",
1395
+ "type": "bigint",
1396
+ "primaryKey": false,
1397
+ "notNull": true
1398
+ },
1399
+ "first_seen_block": {
1400
+ "name": "first_seen_block",
1401
+ "type": "bigint",
1402
+ "primaryKey": false,
1403
+ "notNull": true
1404
+ },
1405
+ "last_tried_block": {
1406
+ "name": "last_tried_block",
1407
+ "type": "bigint",
1408
+ "primaryKey": false,
1409
+ "notNull": false
1410
+ },
1411
+ "attempts": {
1412
+ "name": "attempts",
1413
+ "type": "integer",
1414
+ "primaryKey": false,
1415
+ "notNull": true,
1416
+ "default": 0
1417
+ },
1418
+ "ignored_reason": {
1419
+ "name": "ignored_reason",
1420
+ "type": "text",
1421
+ "primaryKey": false,
1422
+ "notNull": false
1423
+ },
1424
+ "resolved_at": {
1425
+ "name": "resolved_at",
1426
+ "type": "timestamp",
1427
+ "primaryKey": false,
1428
+ "notNull": false
1429
+ },
1430
+ "updated_at": {
1431
+ "name": "updated_at",
1432
+ "type": "timestamp",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "default": "now()"
1436
+ }
1437
+ },
1438
+ "indexes": {
1439
+ "pending_links_chain_type_status_idx": {
1440
+ "name": "pending_links_chain_type_status_idx",
1441
+ "columns": [
1442
+ {
1443
+ "expression": "chain_id",
1444
+ "isExpression": false,
1445
+ "asc": true,
1446
+ "nulls": "last"
1447
+ },
1448
+ {
1449
+ "expression": "type",
1450
+ "isExpression": false,
1451
+ "asc": true,
1452
+ "nulls": "last"
1453
+ },
1454
+ {
1455
+ "expression": "status",
1456
+ "isExpression": false,
1457
+ "asc": true,
1458
+ "nulls": "last"
1459
+ }
1460
+ ],
1461
+ "isUnique": false,
1462
+ "concurrently": false,
1463
+ "method": "btree",
1464
+ "with": {}
1465
+ },
1466
+ "pending_links_pending_scan_idx": {
1467
+ "name": "pending_links_pending_scan_idx",
1468
+ "columns": [
1469
+ {
1470
+ "expression": "chain_id",
1471
+ "isExpression": false,
1472
+ "asc": true,
1473
+ "nulls": "last"
1474
+ },
1475
+ {
1476
+ "expression": "type",
1477
+ "isExpression": false,
1478
+ "asc": true,
1479
+ "nulls": "last"
1480
+ },
1481
+ {
1482
+ "expression": "status",
1483
+ "isExpression": false,
1484
+ "asc": true,
1485
+ "nulls": "last"
1486
+ },
1487
+ {
1488
+ "expression": "first_seen_block",
1489
+ "isExpression": false,
1490
+ "asc": true,
1491
+ "nulls": "last"
1492
+ }
1493
+ ],
1494
+ "isUnique": false,
1495
+ "concurrently": false,
1496
+ "method": "btree",
1497
+ "with": {}
1498
+ },
1499
+ "pending_links_event_id_idx": {
1500
+ "name": "pending_links_event_id_idx",
1501
+ "columns": [
1502
+ {
1503
+ "expression": "chain_id",
1504
+ "isExpression": false,
1505
+ "asc": true,
1506
+ "nulls": "last"
1507
+ },
1508
+ {
1509
+ "expression": "event_id",
1510
+ "isExpression": false,
1511
+ "asc": true,
1512
+ "nulls": "last"
1513
+ }
1514
+ ],
1515
+ "isUnique": false,
1516
+ "concurrently": false,
1517
+ "method": "btree",
1518
+ "with": {}
1519
+ }
1520
+ },
1521
+ "foreignKeys": {},
1522
+ "compositePrimaryKeys": {},
1523
+ "uniqueConstraints": {},
1524
+ "policies": {},
1525
+ "checkConstraints": {},
1526
+ "isRLSEnabled": false
1527
+ },
1528
+ "router_v1.13.position_types": {
1529
+ "name": "position_types",
1530
+ "schema": "router_v1.13",
1531
+ "columns": {
1532
+ "id": {
1533
+ "name": "id",
1534
+ "type": "serial",
1535
+ "primaryKey": true,
1536
+ "notNull": true
1537
+ },
1538
+ "type": {
1539
+ "name": "type",
1540
+ "type": "position_type",
1541
+ "typeSchema": "router_v1.13",
1542
+ "primaryKey": false,
1543
+ "notNull": true
1544
+ }
1545
+ },
1546
+ "indexes": {},
1547
+ "foreignKeys": {},
1548
+ "compositePrimaryKeys": {},
1549
+ "uniqueConstraints": {},
1550
+ "policies": {},
1551
+ "checkConstraints": {},
1552
+ "isRLSEnabled": false
1553
+ },
1554
+ "router_v1.13.positions": {
1555
+ "name": "positions",
1556
+ "schema": "router_v1.13",
1557
+ "columns": {
1558
+ "chain_id": {
1559
+ "name": "chain_id",
1560
+ "type": "bigint",
1561
+ "primaryKey": false,
1562
+ "notNull": true
1563
+ },
1564
+ "contract": {
1565
+ "name": "contract",
1566
+ "type": "varchar(66)",
1567
+ "primaryKey": false,
1568
+ "notNull": true
1569
+ },
1570
+ "user": {
1571
+ "name": "user",
1572
+ "type": "varchar(42)",
1573
+ "primaryKey": false,
1574
+ "notNull": true
1575
+ },
1576
+ "position_type_id": {
1577
+ "name": "position_type_id",
1578
+ "type": "integer",
1579
+ "primaryKey": false,
1580
+ "notNull": true
1581
+ },
1582
+ "balance": {
1583
+ "name": "balance",
1584
+ "type": "numeric(78, 0)",
1585
+ "primaryKey": false,
1586
+ "notNull": false
1587
+ },
1588
+ "asset": {
1589
+ "name": "asset",
1590
+ "type": "varchar(42)",
1591
+ "primaryKey": false,
1592
+ "notNull": true
1593
+ },
1594
+ "block_number": {
1595
+ "name": "block_number",
1596
+ "type": "bigint",
1597
+ "primaryKey": false,
1598
+ "notNull": true
1599
+ },
1600
+ "updated_at": {
1601
+ "name": "updated_at",
1602
+ "type": "timestamp",
1603
+ "primaryKey": false,
1604
+ "notNull": true,
1605
+ "default": "now()"
1606
+ }
1607
+ },
1608
+ "indexes": {},
1609
+ "foreignKeys": {
1610
+ "positions_position_type_id_position_types_id_fk": {
1611
+ "name": "positions_position_type_id_position_types_id_fk",
1612
+ "tableFrom": "positions",
1613
+ "tableTo": "position_types",
1614
+ "schemaTo": "router_v1.13",
1615
+ "columnsFrom": ["position_type_id"],
1616
+ "columnsTo": ["id"],
1617
+ "onDelete": "no action",
1618
+ "onUpdate": "no action"
1619
+ }
1620
+ },
1621
+ "compositePrimaryKeys": {
1622
+ "positions_pk": {
1623
+ "name": "positions_pk",
1624
+ "columns": ["chain_id", "contract", "user", "position_type_id", "asset"]
1625
+ }
1626
+ },
1627
+ "uniqueConstraints": {},
1628
+ "policies": {},
1629
+ "checkConstraints": {},
1630
+ "isRLSEnabled": false
1631
+ },
1632
+ "router_v1.13.status": {
1633
+ "name": "status",
1634
+ "schema": "router_v1.13",
1635
+ "columns": {
1636
+ "id": {
1637
+ "name": "id",
1638
+ "type": "serial",
1639
+ "primaryKey": true,
1640
+ "notNull": true
1641
+ },
1642
+ "code": {
1643
+ "name": "code",
1644
+ "type": "status_code",
1645
+ "typeSchema": "router_v1.13",
1646
+ "primaryKey": false,
1647
+ "notNull": false
1648
+ }
1649
+ },
1650
+ "indexes": {},
1651
+ "foreignKeys": {},
1652
+ "compositePrimaryKeys": {},
1653
+ "uniqueConstraints": {
1654
+ "status_code_unique": {
1655
+ "name": "status_code_unique",
1656
+ "nullsNotDistinct": false,
1657
+ "columns": ["code"]
1658
+ }
1659
+ },
1660
+ "policies": {},
1661
+ "checkConstraints": {},
1662
+ "isRLSEnabled": false
1663
+ },
1664
+ "router_v1.13.transfers": {
1665
+ "name": "transfers",
1666
+ "schema": "router_v1.13",
1667
+ "columns": {
1668
+ "event_id": {
1669
+ "name": "event_id",
1670
+ "type": "varchar(128)",
1671
+ "primaryKey": true,
1672
+ "notNull": true
1673
+ },
1674
+ "chain_id": {
1675
+ "name": "chain_id",
1676
+ "type": "bigint",
1677
+ "primaryKey": false,
1678
+ "notNull": true
1679
+ },
1680
+ "contract": {
1681
+ "name": "contract",
1682
+ "type": "varchar(66)",
1683
+ "primaryKey": false,
1684
+ "notNull": true
1685
+ },
1686
+ "from": {
1687
+ "name": "from",
1688
+ "type": "varchar(42)",
1689
+ "primaryKey": false,
1690
+ "notNull": true
1691
+ },
1692
+ "to": {
1693
+ "name": "to",
1694
+ "type": "varchar(42)",
1695
+ "primaryKey": false,
1696
+ "notNull": true
1697
+ },
1698
+ "value": {
1699
+ "name": "value",
1700
+ "type": "numeric(78, 0)",
1701
+ "primaryKey": false,
1702
+ "notNull": true
1703
+ },
1704
+ "position_type_id": {
1705
+ "name": "position_type_id",
1706
+ "type": "integer",
1707
+ "primaryKey": false,
1708
+ "notNull": true
1709
+ },
1710
+ "asset": {
1711
+ "name": "asset",
1712
+ "type": "varchar(42)",
1713
+ "primaryKey": false,
1714
+ "notNull": true
1715
+ },
1716
+ "block_number": {
1717
+ "name": "block_number",
1718
+ "type": "bigint",
1719
+ "primaryKey": false,
1720
+ "notNull": true
1721
+ },
1722
+ "created_at": {
1723
+ "name": "created_at",
1724
+ "type": "timestamp",
1725
+ "primaryKey": false,
1726
+ "notNull": true,
1727
+ "default": "now()"
1728
+ }
1729
+ },
1730
+ "indexes": {
1731
+ "transfers_chain_contract_user_idx": {
1732
+ "name": "transfers_chain_contract_user_idx",
1733
+ "columns": [
1734
+ {
1735
+ "expression": "chain_id",
1736
+ "isExpression": false,
1737
+ "asc": true,
1738
+ "nulls": "last"
1739
+ },
1740
+ {
1741
+ "expression": "contract",
1742
+ "isExpression": false,
1743
+ "asc": true,
1744
+ "nulls": "last"
1745
+ },
1746
+ {
1747
+ "expression": "from",
1748
+ "isExpression": false,
1749
+ "asc": true,
1750
+ "nulls": "last"
1751
+ },
1752
+ {
1753
+ "expression": "to",
1754
+ "isExpression": false,
1755
+ "asc": true,
1756
+ "nulls": "last"
1757
+ },
1758
+ {
1759
+ "expression": "block_number",
1760
+ "isExpression": false,
1761
+ "asc": true,
1762
+ "nulls": "last"
1763
+ }
1764
+ ],
1765
+ "isUnique": false,
1766
+ "concurrently": false,
1767
+ "method": "btree",
1768
+ "with": {}
1769
+ },
1770
+ "transfers_chain_type_block_idx": {
1771
+ "name": "transfers_chain_type_block_idx",
1772
+ "columns": [
1773
+ {
1774
+ "expression": "chain_id",
1775
+ "isExpression": false,
1776
+ "asc": true,
1777
+ "nulls": "last"
1778
+ },
1779
+ {
1780
+ "expression": "position_type_id",
1781
+ "isExpression": false,
1782
+ "asc": true,
1783
+ "nulls": "last"
1784
+ },
1785
+ {
1786
+ "expression": "block_number",
1787
+ "isExpression": false,
1788
+ "asc": true,
1789
+ "nulls": "last"
1790
+ }
1791
+ ],
1792
+ "isUnique": false,
1793
+ "concurrently": false,
1794
+ "method": "btree",
1795
+ "with": {}
1796
+ }
1797
+ },
1798
+ "foreignKeys": {
1799
+ "transfers_position_type_id_position_types_id_fk": {
1800
+ "name": "transfers_position_type_id_position_types_id_fk",
1801
+ "tableFrom": "transfers",
1802
+ "tableTo": "position_types",
1803
+ "schemaTo": "router_v1.13",
1804
+ "columnsFrom": ["position_type_id"],
1805
+ "columnsTo": ["id"],
1806
+ "onDelete": "no action",
1807
+ "onUpdate": "no action"
1808
+ },
1809
+ "transfers_positions_from_fk": {
1810
+ "name": "transfers_positions_from_fk",
1811
+ "tableFrom": "transfers",
1812
+ "tableTo": "positions",
1813
+ "schemaTo": "router_v1.13",
1814
+ "columnsFrom": ["chain_id", "contract", "from", "position_type_id", "asset"],
1815
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1816
+ "onDelete": "cascade",
1817
+ "onUpdate": "no action"
1818
+ },
1819
+ "transfers_positions_to_fk": {
1820
+ "name": "transfers_positions_to_fk",
1821
+ "tableFrom": "transfers",
1822
+ "tableTo": "positions",
1823
+ "schemaTo": "router_v1.13",
1824
+ "columnsFrom": ["chain_id", "contract", "to", "position_type_id", "asset"],
1825
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1826
+ "onDelete": "cascade",
1827
+ "onUpdate": "no action"
1828
+ }
1829
+ },
1830
+ "compositePrimaryKeys": {},
1831
+ "uniqueConstraints": {},
1832
+ "policies": {},
1833
+ "checkConstraints": {},
1834
+ "isRLSEnabled": false
1835
+ },
1836
+ "router_v1.13.trees": {
1837
+ "name": "trees",
1838
+ "schema": "router_v1.13",
1839
+ "columns": {
1840
+ "root": {
1841
+ "name": "root",
1842
+ "type": "varchar(66)",
1843
+ "primaryKey": true,
1844
+ "notNull": true
1845
+ },
1846
+ "root_signature": {
1847
+ "name": "root_signature",
1848
+ "type": "varchar(132)",
1849
+ "primaryKey": false,
1850
+ "notNull": true
1851
+ },
1852
+ "created_at": {
1853
+ "name": "created_at",
1854
+ "type": "timestamp",
1855
+ "primaryKey": false,
1856
+ "notNull": true,
1857
+ "default": "now()"
1858
+ }
1859
+ },
1860
+ "indexes": {},
1861
+ "foreignKeys": {},
1862
+ "compositePrimaryKeys": {},
1863
+ "uniqueConstraints": {},
1864
+ "policies": {},
1865
+ "checkConstraints": {},
1866
+ "isRLSEnabled": false
1867
+ },
1868
+ "router_v1.13.validations": {
1869
+ "name": "validations",
1870
+ "schema": "router_v1.13",
1871
+ "columns": {
1872
+ "offer_hash": {
1873
+ "name": "offer_hash",
1874
+ "type": "varchar(66)",
1875
+ "primaryKey": false,
1876
+ "notNull": true
1877
+ },
1878
+ "obligation_id": {
1879
+ "name": "obligation_id",
1880
+ "type": "varchar(42)",
1881
+ "primaryKey": false,
1882
+ "notNull": true
1883
+ },
1884
+ "status_id": {
1885
+ "name": "status_id",
1886
+ "type": "integer",
1887
+ "primaryKey": false,
1888
+ "notNull": true
1889
+ },
1890
+ "updated_at": {
1891
+ "name": "updated_at",
1892
+ "type": "timestamp",
1893
+ "primaryKey": false,
1894
+ "notNull": true,
1895
+ "default": "now()"
1896
+ }
1897
+ },
1898
+ "indexes": {},
1899
+ "foreignKeys": {
1900
+ "validations_status_id_status_id_fk": {
1901
+ "name": "validations_status_id_status_id_fk",
1902
+ "tableFrom": "validations",
1903
+ "tableTo": "status",
1904
+ "schemaTo": "router_v1.13",
1905
+ "columnsFrom": ["status_id"],
1906
+ "columnsTo": ["id"],
1907
+ "onDelete": "no action",
1908
+ "onUpdate": "no action"
1909
+ },
1910
+ "validations_offer_fk": {
1911
+ "name": "validations_offer_fk",
1912
+ "tableFrom": "validations",
1913
+ "tableTo": "offers",
1914
+ "schemaTo": "router_v1.13",
1915
+ "columnsFrom": ["offer_hash", "obligation_id"],
1916
+ "columnsTo": ["hash", "obligation_id"],
1917
+ "onDelete": "cascade",
1918
+ "onUpdate": "no action"
1919
+ }
1920
+ },
1921
+ "compositePrimaryKeys": {
1922
+ "validations_pk": {
1923
+ "name": "validations_pk",
1924
+ "columns": ["offer_hash", "obligation_id"]
1925
+ }
1926
+ },
1927
+ "uniqueConstraints": {},
1928
+ "policies": {},
1929
+ "checkConstraints": {},
1930
+ "isRLSEnabled": false
1931
+ }
1932
+ },
1933
+ "enums": {
1934
+ "router_v1.13.callback_type": {
1935
+ "name": "callback_type",
1936
+ "schema": "router_v1.13",
1937
+ "values": ["empty"]
1938
+ },
1939
+ "router_v1.13.position_type": {
1940
+ "name": "position_type",
1941
+ "schema": "router_v1.13",
1942
+ "values": ["erc20", "vault_v1", "debtOf", "collateralOf"]
1943
+ },
1944
+ "router_v1.13.status_code": {
1945
+ "name": "status_code",
1946
+ "schema": "router_v1.13",
1947
+ "values": ["VALID", "SIMULATION_ERROR"]
1948
+ }
1949
+ },
1950
+ "schemas": {},
1951
+ "sequences": {},
1952
+ "roles": {},
1953
+ "policies": {},
1954
+ "views": {},
1955
+ "_meta": {
1956
+ "columns": {},
1957
+ "schemas": {},
1958
+ "tables": {}
1959
+ }
1960
+ }