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