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