@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,1912 @@
1
+ {
2
+ "id": "f7014bb8-42e3-4bef-af77-a8cfdc879d54",
3
+ "prevId": "526a24bc-3f09-47a6-8562-371bcd877626",
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_and_hash_idx": {
982
+ "name": "offers_group_and_hash_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
+ "expression": "hash",
1004
+ "isExpression": false,
1005
+ "asc": true,
1006
+ "nulls": "last"
1007
+ }
1008
+ ],
1009
+ "isUnique": false,
1010
+ "concurrently": false,
1011
+ "method": "btree",
1012
+ "with": {}
1013
+ },
1014
+ "offers_obligation_side_group_idx": {
1015
+ "name": "offers_obligation_side_group_idx",
1016
+ "columns": [
1017
+ {
1018
+ "expression": "obligation_id",
1019
+ "isExpression": false,
1020
+ "asc": true,
1021
+ "nulls": "last"
1022
+ },
1023
+ {
1024
+ "expression": "buy",
1025
+ "isExpression": false,
1026
+ "asc": true,
1027
+ "nulls": "last"
1028
+ },
1029
+ {
1030
+ "expression": "group_chain_id",
1031
+ "isExpression": false,
1032
+ "asc": true,
1033
+ "nulls": "last"
1034
+ },
1035
+ {
1036
+ "expression": "group_maker",
1037
+ "isExpression": false,
1038
+ "asc": true,
1039
+ "nulls": "last"
1040
+ },
1041
+ {
1042
+ "expression": "group_group",
1043
+ "isExpression": false,
1044
+ "asc": true,
1045
+ "nulls": "last"
1046
+ }
1047
+ ],
1048
+ "isUnique": false,
1049
+ "concurrently": false,
1050
+ "method": "btree",
1051
+ "with": {}
1052
+ },
1053
+ "offers_group_obligation_side_idx": {
1054
+ "name": "offers_group_obligation_side_idx",
1055
+ "columns": [
1056
+ {
1057
+ "expression": "group_chain_id",
1058
+ "isExpression": false,
1059
+ "asc": true,
1060
+ "nulls": "last"
1061
+ },
1062
+ {
1063
+ "expression": "group_maker",
1064
+ "isExpression": false,
1065
+ "asc": true,
1066
+ "nulls": "last"
1067
+ },
1068
+ {
1069
+ "expression": "group_group",
1070
+ "isExpression": false,
1071
+ "asc": true,
1072
+ "nulls": "last"
1073
+ },
1074
+ {
1075
+ "expression": "obligation_id",
1076
+ "isExpression": false,
1077
+ "asc": true,
1078
+ "nulls": "last"
1079
+ },
1080
+ {
1081
+ "expression": "buy",
1082
+ "isExpression": false,
1083
+ "asc": true,
1084
+ "nulls": "last"
1085
+ }
1086
+ ],
1087
+ "isUnique": false,
1088
+ "concurrently": false,
1089
+ "method": "btree",
1090
+ "with": {}
1091
+ }
1092
+ },
1093
+ "foreignKeys": {
1094
+ "offers_obligation_id_obligation_id_keys_obligation_id_fk": {
1095
+ "name": "offers_obligation_id_obligation_id_keys_obligation_id_fk",
1096
+ "tableFrom": "offers",
1097
+ "tableTo": "obligation_id_keys",
1098
+ "schemaTo": "router_v1.13",
1099
+ "columnsFrom": ["obligation_id"],
1100
+ "columnsTo": ["obligation_id"],
1101
+ "onDelete": "cascade",
1102
+ "onUpdate": "no action"
1103
+ },
1104
+ "offers_groups_fk": {
1105
+ "name": "offers_groups_fk",
1106
+ "tableFrom": "offers",
1107
+ "tableTo": "groups",
1108
+ "schemaTo": "router_v1.13",
1109
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1110
+ "columnsTo": ["chain_id", "maker", "group"],
1111
+ "onDelete": "cascade",
1112
+ "onUpdate": "no action"
1113
+ }
1114
+ },
1115
+ "compositePrimaryKeys": {
1116
+ "offers_pk": {
1117
+ "name": "offers_pk",
1118
+ "columns": ["hash", "obligation_id"]
1119
+ }
1120
+ },
1121
+ "uniqueConstraints": {},
1122
+ "policies": {},
1123
+ "checkConstraints": {},
1124
+ "isRLSEnabled": false
1125
+ },
1126
+ "router_v1.13.offers_callbacks": {
1127
+ "name": "offers_callbacks",
1128
+ "schema": "router_v1.13",
1129
+ "columns": {
1130
+ "offer_hash": {
1131
+ "name": "offer_hash",
1132
+ "type": "varchar(66)",
1133
+ "primaryKey": false,
1134
+ "notNull": true
1135
+ },
1136
+ "obligation_id": {
1137
+ "name": "obligation_id",
1138
+ "type": "varchar(42)",
1139
+ "primaryKey": false,
1140
+ "notNull": true
1141
+ },
1142
+ "callback_id": {
1143
+ "name": "callback_id",
1144
+ "type": "varchar(66)",
1145
+ "primaryKey": false,
1146
+ "notNull": false
1147
+ }
1148
+ },
1149
+ "indexes": {},
1150
+ "foreignKeys": {
1151
+ "offers_callbacks_offer_fk": {
1152
+ "name": "offers_callbacks_offer_fk",
1153
+ "tableFrom": "offers_callbacks",
1154
+ "tableTo": "offers",
1155
+ "schemaTo": "router_v1.13",
1156
+ "columnsFrom": ["offer_hash", "obligation_id"],
1157
+ "columnsTo": ["hash", "obligation_id"],
1158
+ "onDelete": "cascade",
1159
+ "onUpdate": "no action"
1160
+ }
1161
+ },
1162
+ "compositePrimaryKeys": {
1163
+ "offers_callbacks_pk": {
1164
+ "name": "offers_callbacks_pk",
1165
+ "columns": ["offer_hash", "obligation_id", "callback_id"]
1166
+ }
1167
+ },
1168
+ "uniqueConstraints": {},
1169
+ "policies": {},
1170
+ "checkConstraints": {},
1171
+ "isRLSEnabled": false
1172
+ },
1173
+ "router_v1.13.offsets": {
1174
+ "name": "offsets",
1175
+ "schema": "router_v1.13",
1176
+ "columns": {
1177
+ "chain_id": {
1178
+ "name": "chain_id",
1179
+ "type": "bigint",
1180
+ "primaryKey": false,
1181
+ "notNull": true
1182
+ },
1183
+ "user": {
1184
+ "name": "user",
1185
+ "type": "varchar(42)",
1186
+ "primaryKey": false,
1187
+ "notNull": true
1188
+ },
1189
+ "contract": {
1190
+ "name": "contract",
1191
+ "type": "varchar(66)",
1192
+ "primaryKey": false,
1193
+ "notNull": true
1194
+ },
1195
+ "group": {
1196
+ "name": "group",
1197
+ "type": "varchar(66)",
1198
+ "primaryKey": false,
1199
+ "notNull": true
1200
+ },
1201
+ "obligation_id": {
1202
+ "name": "obligation_id",
1203
+ "type": "varchar(42)",
1204
+ "primaryKey": false,
1205
+ "notNull": true
1206
+ },
1207
+ "value": {
1208
+ "name": "value",
1209
+ "type": "numeric(78, 0)",
1210
+ "primaryKey": false,
1211
+ "notNull": true
1212
+ }
1213
+ },
1214
+ "indexes": {},
1215
+ "foreignKeys": {
1216
+ "offsets_lots_positions_fk": {
1217
+ "name": "offsets_lots_positions_fk",
1218
+ "tableFrom": "offsets",
1219
+ "tableTo": "lots_positions",
1220
+ "schemaTo": "router_v1.13",
1221
+ "columnsFrom": ["chain_id", "contract", "user"],
1222
+ "columnsTo": ["chain_id", "contract", "user"],
1223
+ "onDelete": "cascade",
1224
+ "onUpdate": "no action"
1225
+ }
1226
+ },
1227
+ "compositePrimaryKeys": {
1228
+ "offsets_pk": {
1229
+ "name": "offsets_pk",
1230
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
1231
+ }
1232
+ },
1233
+ "uniqueConstraints": {},
1234
+ "policies": {},
1235
+ "checkConstraints": {},
1236
+ "isRLSEnabled": false
1237
+ },
1238
+ "router_v1.13.oracles": {
1239
+ "name": "oracles",
1240
+ "schema": "router_v1.13",
1241
+ "columns": {
1242
+ "chain_id": {
1243
+ "name": "chain_id",
1244
+ "type": "bigint",
1245
+ "primaryKey": false,
1246
+ "notNull": true
1247
+ },
1248
+ "address": {
1249
+ "name": "address",
1250
+ "type": "varchar(42)",
1251
+ "primaryKey": false,
1252
+ "notNull": true
1253
+ },
1254
+ "price": {
1255
+ "name": "price",
1256
+ "type": "numeric(78, 0)",
1257
+ "primaryKey": false,
1258
+ "notNull": false
1259
+ },
1260
+ "block_number": {
1261
+ "name": "block_number",
1262
+ "type": "bigint",
1263
+ "primaryKey": false,
1264
+ "notNull": true
1265
+ },
1266
+ "updated_at": {
1267
+ "name": "updated_at",
1268
+ "type": "timestamp",
1269
+ "primaryKey": false,
1270
+ "notNull": true,
1271
+ "default": "now()"
1272
+ }
1273
+ },
1274
+ "indexes": {},
1275
+ "foreignKeys": {},
1276
+ "compositePrimaryKeys": {
1277
+ "oracles_pk": {
1278
+ "name": "oracles_pk",
1279
+ "columns": ["chain_id", "address"]
1280
+ }
1281
+ },
1282
+ "uniqueConstraints": {},
1283
+ "policies": {},
1284
+ "checkConstraints": {},
1285
+ "isRLSEnabled": false
1286
+ },
1287
+ "router_v1.13.pending_links": {
1288
+ "name": "pending_links",
1289
+ "schema": "router_v1.13",
1290
+ "columns": {
1291
+ "key": {
1292
+ "name": "key",
1293
+ "type": "varchar(191)",
1294
+ "primaryKey": true,
1295
+ "notNull": true
1296
+ },
1297
+ "type": {
1298
+ "name": "type",
1299
+ "type": "text",
1300
+ "primaryKey": false,
1301
+ "notNull": true
1302
+ },
1303
+ "status": {
1304
+ "name": "status",
1305
+ "type": "text",
1306
+ "primaryKey": false,
1307
+ "notNull": true
1308
+ },
1309
+ "chain_id": {
1310
+ "name": "chain_id",
1311
+ "type": "bigint",
1312
+ "primaryKey": false,
1313
+ "notNull": true
1314
+ },
1315
+ "event_id": {
1316
+ "name": "event_id",
1317
+ "type": "varchar(128)",
1318
+ "primaryKey": false,
1319
+ "notNull": true
1320
+ },
1321
+ "obligation_id": {
1322
+ "name": "obligation_id",
1323
+ "type": "varchar(42)",
1324
+ "primaryKey": false,
1325
+ "notNull": true
1326
+ },
1327
+ "collateral_index": {
1328
+ "name": "collateral_index",
1329
+ "type": "integer",
1330
+ "primaryKey": false,
1331
+ "notNull": true
1332
+ },
1333
+ "user": {
1334
+ "name": "user",
1335
+ "type": "varchar(42)",
1336
+ "primaryKey": false,
1337
+ "notNull": true
1338
+ },
1339
+ "amount": {
1340
+ "name": "amount",
1341
+ "type": "numeric(78, 0)",
1342
+ "primaryKey": false,
1343
+ "notNull": true
1344
+ },
1345
+ "block_number": {
1346
+ "name": "block_number",
1347
+ "type": "bigint",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "first_seen_block": {
1352
+ "name": "first_seen_block",
1353
+ "type": "bigint",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "last_tried_block": {
1358
+ "name": "last_tried_block",
1359
+ "type": "bigint",
1360
+ "primaryKey": false,
1361
+ "notNull": false
1362
+ },
1363
+ "attempts": {
1364
+ "name": "attempts",
1365
+ "type": "integer",
1366
+ "primaryKey": false,
1367
+ "notNull": true,
1368
+ "default": 0
1369
+ },
1370
+ "ignored_reason": {
1371
+ "name": "ignored_reason",
1372
+ "type": "text",
1373
+ "primaryKey": false,
1374
+ "notNull": false
1375
+ },
1376
+ "resolved_at": {
1377
+ "name": "resolved_at",
1378
+ "type": "timestamp",
1379
+ "primaryKey": false,
1380
+ "notNull": false
1381
+ },
1382
+ "updated_at": {
1383
+ "name": "updated_at",
1384
+ "type": "timestamp",
1385
+ "primaryKey": false,
1386
+ "notNull": true,
1387
+ "default": "now()"
1388
+ }
1389
+ },
1390
+ "indexes": {
1391
+ "pending_links_chain_type_status_idx": {
1392
+ "name": "pending_links_chain_type_status_idx",
1393
+ "columns": [
1394
+ {
1395
+ "expression": "chain_id",
1396
+ "isExpression": false,
1397
+ "asc": true,
1398
+ "nulls": "last"
1399
+ },
1400
+ {
1401
+ "expression": "type",
1402
+ "isExpression": false,
1403
+ "asc": true,
1404
+ "nulls": "last"
1405
+ },
1406
+ {
1407
+ "expression": "status",
1408
+ "isExpression": false,
1409
+ "asc": true,
1410
+ "nulls": "last"
1411
+ }
1412
+ ],
1413
+ "isUnique": false,
1414
+ "concurrently": false,
1415
+ "method": "btree",
1416
+ "with": {}
1417
+ },
1418
+ "pending_links_pending_scan_idx": {
1419
+ "name": "pending_links_pending_scan_idx",
1420
+ "columns": [
1421
+ {
1422
+ "expression": "chain_id",
1423
+ "isExpression": false,
1424
+ "asc": true,
1425
+ "nulls": "last"
1426
+ },
1427
+ {
1428
+ "expression": "type",
1429
+ "isExpression": false,
1430
+ "asc": true,
1431
+ "nulls": "last"
1432
+ },
1433
+ {
1434
+ "expression": "status",
1435
+ "isExpression": false,
1436
+ "asc": true,
1437
+ "nulls": "last"
1438
+ },
1439
+ {
1440
+ "expression": "first_seen_block",
1441
+ "isExpression": false,
1442
+ "asc": true,
1443
+ "nulls": "last"
1444
+ }
1445
+ ],
1446
+ "isUnique": false,
1447
+ "concurrently": false,
1448
+ "method": "btree",
1449
+ "with": {}
1450
+ },
1451
+ "pending_links_event_id_idx": {
1452
+ "name": "pending_links_event_id_idx",
1453
+ "columns": [
1454
+ {
1455
+ "expression": "chain_id",
1456
+ "isExpression": false,
1457
+ "asc": true,
1458
+ "nulls": "last"
1459
+ },
1460
+ {
1461
+ "expression": "event_id",
1462
+ "isExpression": false,
1463
+ "asc": true,
1464
+ "nulls": "last"
1465
+ }
1466
+ ],
1467
+ "isUnique": false,
1468
+ "concurrently": false,
1469
+ "method": "btree",
1470
+ "with": {}
1471
+ }
1472
+ },
1473
+ "foreignKeys": {},
1474
+ "compositePrimaryKeys": {},
1475
+ "uniqueConstraints": {},
1476
+ "policies": {},
1477
+ "checkConstraints": {},
1478
+ "isRLSEnabled": false
1479
+ },
1480
+ "router_v1.13.position_types": {
1481
+ "name": "position_types",
1482
+ "schema": "router_v1.13",
1483
+ "columns": {
1484
+ "id": {
1485
+ "name": "id",
1486
+ "type": "serial",
1487
+ "primaryKey": true,
1488
+ "notNull": true
1489
+ },
1490
+ "type": {
1491
+ "name": "type",
1492
+ "type": "position_type",
1493
+ "typeSchema": "router_v1.13",
1494
+ "primaryKey": false,
1495
+ "notNull": true
1496
+ }
1497
+ },
1498
+ "indexes": {},
1499
+ "foreignKeys": {},
1500
+ "compositePrimaryKeys": {},
1501
+ "uniqueConstraints": {},
1502
+ "policies": {},
1503
+ "checkConstraints": {},
1504
+ "isRLSEnabled": false
1505
+ },
1506
+ "router_v1.13.positions": {
1507
+ "name": "positions",
1508
+ "schema": "router_v1.13",
1509
+ "columns": {
1510
+ "chain_id": {
1511
+ "name": "chain_id",
1512
+ "type": "bigint",
1513
+ "primaryKey": false,
1514
+ "notNull": true
1515
+ },
1516
+ "contract": {
1517
+ "name": "contract",
1518
+ "type": "varchar(66)",
1519
+ "primaryKey": false,
1520
+ "notNull": true
1521
+ },
1522
+ "user": {
1523
+ "name": "user",
1524
+ "type": "varchar(42)",
1525
+ "primaryKey": false,
1526
+ "notNull": true
1527
+ },
1528
+ "position_type_id": {
1529
+ "name": "position_type_id",
1530
+ "type": "integer",
1531
+ "primaryKey": false,
1532
+ "notNull": true
1533
+ },
1534
+ "balance": {
1535
+ "name": "balance",
1536
+ "type": "numeric(78, 0)",
1537
+ "primaryKey": false,
1538
+ "notNull": false
1539
+ },
1540
+ "asset": {
1541
+ "name": "asset",
1542
+ "type": "varchar(42)",
1543
+ "primaryKey": false,
1544
+ "notNull": true
1545
+ },
1546
+ "block_number": {
1547
+ "name": "block_number",
1548
+ "type": "bigint",
1549
+ "primaryKey": false,
1550
+ "notNull": true
1551
+ },
1552
+ "updated_at": {
1553
+ "name": "updated_at",
1554
+ "type": "timestamp",
1555
+ "primaryKey": false,
1556
+ "notNull": true,
1557
+ "default": "now()"
1558
+ }
1559
+ },
1560
+ "indexes": {},
1561
+ "foreignKeys": {
1562
+ "positions_position_type_id_position_types_id_fk": {
1563
+ "name": "positions_position_type_id_position_types_id_fk",
1564
+ "tableFrom": "positions",
1565
+ "tableTo": "position_types",
1566
+ "schemaTo": "router_v1.13",
1567
+ "columnsFrom": ["position_type_id"],
1568
+ "columnsTo": ["id"],
1569
+ "onDelete": "no action",
1570
+ "onUpdate": "no action"
1571
+ }
1572
+ },
1573
+ "compositePrimaryKeys": {
1574
+ "positions_pk": {
1575
+ "name": "positions_pk",
1576
+ "columns": ["chain_id", "contract", "user", "position_type_id", "asset"]
1577
+ }
1578
+ },
1579
+ "uniqueConstraints": {},
1580
+ "policies": {},
1581
+ "checkConstraints": {},
1582
+ "isRLSEnabled": false
1583
+ },
1584
+ "router_v1.13.status": {
1585
+ "name": "status",
1586
+ "schema": "router_v1.13",
1587
+ "columns": {
1588
+ "id": {
1589
+ "name": "id",
1590
+ "type": "serial",
1591
+ "primaryKey": true,
1592
+ "notNull": true
1593
+ },
1594
+ "code": {
1595
+ "name": "code",
1596
+ "type": "status_code",
1597
+ "typeSchema": "router_v1.13",
1598
+ "primaryKey": false,
1599
+ "notNull": false
1600
+ }
1601
+ },
1602
+ "indexes": {},
1603
+ "foreignKeys": {},
1604
+ "compositePrimaryKeys": {},
1605
+ "uniqueConstraints": {
1606
+ "status_code_unique": {
1607
+ "name": "status_code_unique",
1608
+ "nullsNotDistinct": false,
1609
+ "columns": ["code"]
1610
+ }
1611
+ },
1612
+ "policies": {},
1613
+ "checkConstraints": {},
1614
+ "isRLSEnabled": false
1615
+ },
1616
+ "router_v1.13.transfers": {
1617
+ "name": "transfers",
1618
+ "schema": "router_v1.13",
1619
+ "columns": {
1620
+ "event_id": {
1621
+ "name": "event_id",
1622
+ "type": "varchar(128)",
1623
+ "primaryKey": true,
1624
+ "notNull": true
1625
+ },
1626
+ "chain_id": {
1627
+ "name": "chain_id",
1628
+ "type": "bigint",
1629
+ "primaryKey": false,
1630
+ "notNull": true
1631
+ },
1632
+ "contract": {
1633
+ "name": "contract",
1634
+ "type": "varchar(66)",
1635
+ "primaryKey": false,
1636
+ "notNull": true
1637
+ },
1638
+ "from": {
1639
+ "name": "from",
1640
+ "type": "varchar(42)",
1641
+ "primaryKey": false,
1642
+ "notNull": true
1643
+ },
1644
+ "to": {
1645
+ "name": "to",
1646
+ "type": "varchar(42)",
1647
+ "primaryKey": false,
1648
+ "notNull": true
1649
+ },
1650
+ "value": {
1651
+ "name": "value",
1652
+ "type": "numeric(78, 0)",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "position_type_id": {
1657
+ "name": "position_type_id",
1658
+ "type": "integer",
1659
+ "primaryKey": false,
1660
+ "notNull": true
1661
+ },
1662
+ "asset": {
1663
+ "name": "asset",
1664
+ "type": "varchar(42)",
1665
+ "primaryKey": false,
1666
+ "notNull": true
1667
+ },
1668
+ "block_number": {
1669
+ "name": "block_number",
1670
+ "type": "bigint",
1671
+ "primaryKey": false,
1672
+ "notNull": true
1673
+ },
1674
+ "created_at": {
1675
+ "name": "created_at",
1676
+ "type": "timestamp",
1677
+ "primaryKey": false,
1678
+ "notNull": true,
1679
+ "default": "now()"
1680
+ }
1681
+ },
1682
+ "indexes": {
1683
+ "transfers_chain_contract_user_idx": {
1684
+ "name": "transfers_chain_contract_user_idx",
1685
+ "columns": [
1686
+ {
1687
+ "expression": "chain_id",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last"
1691
+ },
1692
+ {
1693
+ "expression": "contract",
1694
+ "isExpression": false,
1695
+ "asc": true,
1696
+ "nulls": "last"
1697
+ },
1698
+ {
1699
+ "expression": "from",
1700
+ "isExpression": false,
1701
+ "asc": true,
1702
+ "nulls": "last"
1703
+ },
1704
+ {
1705
+ "expression": "to",
1706
+ "isExpression": false,
1707
+ "asc": true,
1708
+ "nulls": "last"
1709
+ },
1710
+ {
1711
+ "expression": "block_number",
1712
+ "isExpression": false,
1713
+ "asc": true,
1714
+ "nulls": "last"
1715
+ }
1716
+ ],
1717
+ "isUnique": false,
1718
+ "concurrently": false,
1719
+ "method": "btree",
1720
+ "with": {}
1721
+ },
1722
+ "transfers_chain_type_block_idx": {
1723
+ "name": "transfers_chain_type_block_idx",
1724
+ "columns": [
1725
+ {
1726
+ "expression": "chain_id",
1727
+ "isExpression": false,
1728
+ "asc": true,
1729
+ "nulls": "last"
1730
+ },
1731
+ {
1732
+ "expression": "position_type_id",
1733
+ "isExpression": false,
1734
+ "asc": true,
1735
+ "nulls": "last"
1736
+ },
1737
+ {
1738
+ "expression": "block_number",
1739
+ "isExpression": false,
1740
+ "asc": true,
1741
+ "nulls": "last"
1742
+ }
1743
+ ],
1744
+ "isUnique": false,
1745
+ "concurrently": false,
1746
+ "method": "btree",
1747
+ "with": {}
1748
+ }
1749
+ },
1750
+ "foreignKeys": {
1751
+ "transfers_position_type_id_position_types_id_fk": {
1752
+ "name": "transfers_position_type_id_position_types_id_fk",
1753
+ "tableFrom": "transfers",
1754
+ "tableTo": "position_types",
1755
+ "schemaTo": "router_v1.13",
1756
+ "columnsFrom": ["position_type_id"],
1757
+ "columnsTo": ["id"],
1758
+ "onDelete": "no action",
1759
+ "onUpdate": "no action"
1760
+ },
1761
+ "transfers_positions_from_fk": {
1762
+ "name": "transfers_positions_from_fk",
1763
+ "tableFrom": "transfers",
1764
+ "tableTo": "positions",
1765
+ "schemaTo": "router_v1.13",
1766
+ "columnsFrom": ["chain_id", "contract", "from", "position_type_id", "asset"],
1767
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1768
+ "onDelete": "cascade",
1769
+ "onUpdate": "no action"
1770
+ },
1771
+ "transfers_positions_to_fk": {
1772
+ "name": "transfers_positions_to_fk",
1773
+ "tableFrom": "transfers",
1774
+ "tableTo": "positions",
1775
+ "schemaTo": "router_v1.13",
1776
+ "columnsFrom": ["chain_id", "contract", "to", "position_type_id", "asset"],
1777
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1778
+ "onDelete": "cascade",
1779
+ "onUpdate": "no action"
1780
+ }
1781
+ },
1782
+ "compositePrimaryKeys": {},
1783
+ "uniqueConstraints": {},
1784
+ "policies": {},
1785
+ "checkConstraints": {},
1786
+ "isRLSEnabled": false
1787
+ },
1788
+ "router_v1.13.trees": {
1789
+ "name": "trees",
1790
+ "schema": "router_v1.13",
1791
+ "columns": {
1792
+ "root": {
1793
+ "name": "root",
1794
+ "type": "varchar(66)",
1795
+ "primaryKey": true,
1796
+ "notNull": true
1797
+ },
1798
+ "root_signature": {
1799
+ "name": "root_signature",
1800
+ "type": "varchar(132)",
1801
+ "primaryKey": false,
1802
+ "notNull": true
1803
+ },
1804
+ "created_at": {
1805
+ "name": "created_at",
1806
+ "type": "timestamp",
1807
+ "primaryKey": false,
1808
+ "notNull": true,
1809
+ "default": "now()"
1810
+ }
1811
+ },
1812
+ "indexes": {},
1813
+ "foreignKeys": {},
1814
+ "compositePrimaryKeys": {},
1815
+ "uniqueConstraints": {},
1816
+ "policies": {},
1817
+ "checkConstraints": {},
1818
+ "isRLSEnabled": false
1819
+ },
1820
+ "router_v1.13.validations": {
1821
+ "name": "validations",
1822
+ "schema": "router_v1.13",
1823
+ "columns": {
1824
+ "offer_hash": {
1825
+ "name": "offer_hash",
1826
+ "type": "varchar(66)",
1827
+ "primaryKey": false,
1828
+ "notNull": true
1829
+ },
1830
+ "obligation_id": {
1831
+ "name": "obligation_id",
1832
+ "type": "varchar(42)",
1833
+ "primaryKey": false,
1834
+ "notNull": true
1835
+ },
1836
+ "status_id": {
1837
+ "name": "status_id",
1838
+ "type": "integer",
1839
+ "primaryKey": false,
1840
+ "notNull": true
1841
+ },
1842
+ "updated_at": {
1843
+ "name": "updated_at",
1844
+ "type": "timestamp",
1845
+ "primaryKey": false,
1846
+ "notNull": true,
1847
+ "default": "now()"
1848
+ }
1849
+ },
1850
+ "indexes": {},
1851
+ "foreignKeys": {
1852
+ "validations_status_id_status_id_fk": {
1853
+ "name": "validations_status_id_status_id_fk",
1854
+ "tableFrom": "validations",
1855
+ "tableTo": "status",
1856
+ "schemaTo": "router_v1.13",
1857
+ "columnsFrom": ["status_id"],
1858
+ "columnsTo": ["id"],
1859
+ "onDelete": "no action",
1860
+ "onUpdate": "no action"
1861
+ },
1862
+ "validations_offer_fk": {
1863
+ "name": "validations_offer_fk",
1864
+ "tableFrom": "validations",
1865
+ "tableTo": "offers",
1866
+ "schemaTo": "router_v1.13",
1867
+ "columnsFrom": ["offer_hash", "obligation_id"],
1868
+ "columnsTo": ["hash", "obligation_id"],
1869
+ "onDelete": "cascade",
1870
+ "onUpdate": "no action"
1871
+ }
1872
+ },
1873
+ "compositePrimaryKeys": {
1874
+ "validations_pk": {
1875
+ "name": "validations_pk",
1876
+ "columns": ["offer_hash", "obligation_id"]
1877
+ }
1878
+ },
1879
+ "uniqueConstraints": {},
1880
+ "policies": {},
1881
+ "checkConstraints": {},
1882
+ "isRLSEnabled": false
1883
+ }
1884
+ },
1885
+ "enums": {
1886
+ "router_v1.13.callback_type": {
1887
+ "name": "callback_type",
1888
+ "schema": "router_v1.13",
1889
+ "values": ["empty"]
1890
+ },
1891
+ "router_v1.13.position_type": {
1892
+ "name": "position_type",
1893
+ "schema": "router_v1.13",
1894
+ "values": ["erc20", "vault_v1", "debtOf", "collateralOf"]
1895
+ },
1896
+ "router_v1.13.status_code": {
1897
+ "name": "status_code",
1898
+ "schema": "router_v1.13",
1899
+ "values": ["VALID", "SIMULATION_ERROR"]
1900
+ }
1901
+ },
1902
+ "schemas": {},
1903
+ "sequences": {},
1904
+ "roles": {},
1905
+ "policies": {},
1906
+ "views": {},
1907
+ "_meta": {
1908
+ "columns": {},
1909
+ "schemas": {},
1910
+ "tables": {}
1911
+ }
1912
+ }