@morpho-dev/router 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +20 -5
  2. package/dist/cli.js +11700 -6794
  3. package/dist/drizzle/migrations/0034_chain-checkpoints.sql +1 -0
  4. package/dist/drizzle/migrations/0035_chain-tip-hash-cas.sql +1 -0
  5. package/dist/drizzle/migrations/0036_pending-links.sql +22 -0
  6. package/dist/drizzle/migrations/0037_chain-finalized-anchor.sql +2 -0
  7. package/dist/drizzle/migrations/0038_add-obligation-rcf-threshold.sql +2 -0
  8. package/dist/drizzle/migrations/0039_add-offers-composite-indexes.sql +2 -0
  9. package/dist/drizzle/migrations/0040_drop-redundant-offers-indexes.sql +2 -0
  10. package/dist/drizzle/migrations/0041_add-group-winner-expression-index.sql +10 -0
  11. package/dist/drizzle/migrations/0042_contract-sync-v1.14.sql +284 -0
  12. package/dist/drizzle/migrations/0043_add-obligation-side-tick-index.sql +1 -0
  13. package/dist/drizzle/migrations/0044_index-audit-cleanup.sql +27 -0
  14. package/dist/drizzle/migrations/0045_add-lots-offsets-availability-indexes.sql +5 -0
  15. package/dist/drizzle/migrations/0046_add-offers-active-tick-index.sql +1 -0
  16. package/dist/drizzle/migrations/0047_add-offers-book-winners-index.sql +1 -0
  17. package/dist/drizzle/migrations/0048_covering-indexes-for-winners-queries.sql +34 -0
  18. package/dist/drizzle/migrations/0049_contract-sync-v1.15.sql +305 -0
  19. package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
  20. package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
  21. package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
  22. package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
  23. package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
  24. package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
  25. package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
  26. package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
  27. package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
  28. package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
  29. package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
  30. package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
  31. package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
  32. package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
  33. package/dist/drizzle/migrations/meta/_journal.json +112 -0
  34. package/dist/evm/bytecode/morpho.txt +1 -1
  35. package/dist/index.browser.d.mts +587 -271
  36. package/dist/index.browser.d.mts.map +1 -1
  37. package/dist/index.browser.mjs +656 -419
  38. package/dist/index.browser.mjs.map +1 -1
  39. package/dist/index.node.d.mts +1454 -583
  40. package/dist/index.node.d.mts.map +1 -1
  41. package/dist/index.node.mjs +9064 -5228
  42. package/dist/index.node.mjs.map +1 -1
  43. package/dist/server-D4xxddev.js +9573 -0
  44. package/dist/server.js +9617 -0
  45. package/docs/integrator.md +14 -24
  46. package/package.json +7 -4
@@ -0,0 +1,1853 @@
1
+ {
2
+ "id": "d9b24437-61f6-43bc-b208-f913ad177670",
3
+ "prevId": "6e8eaef8-bd93-456c-b784-92b61579ae91",
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
+ "foreignKeys": {
440
+ "lots_lots_positions_fk": {
441
+ "name": "lots_lots_positions_fk",
442
+ "tableFrom": "lots",
443
+ "tableTo": "lots_positions",
444
+ "schemaTo": "router_v1.14",
445
+ "columnsFrom": ["chain_id", "contract", "user"],
446
+ "columnsTo": ["chain_id", "contract", "user"],
447
+ "onDelete": "cascade",
448
+ "onUpdate": "no action"
449
+ },
450
+ "lots_groups_fk": {
451
+ "name": "lots_groups_fk",
452
+ "tableFrom": "lots",
453
+ "tableTo": "groups",
454
+ "schemaTo": "router_v1.14",
455
+ "columnsFrom": ["chain_id", "user", "group"],
456
+ "columnsTo": ["chain_id", "maker", "group"],
457
+ "onDelete": "cascade",
458
+ "onUpdate": "no action"
459
+ }
460
+ },
461
+ "compositePrimaryKeys": {
462
+ "lots_pk": {
463
+ "name": "lots_pk",
464
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
465
+ }
466
+ },
467
+ "uniqueConstraints": {},
468
+ "policies": {},
469
+ "checkConstraints": {},
470
+ "isRLSEnabled": false
471
+ },
472
+ "router_v1.14.lots_positions": {
473
+ "name": "lots_positions",
474
+ "schema": "router_v1.14",
475
+ "columns": {
476
+ "chain_id": {
477
+ "name": "chain_id",
478
+ "type": "bigint",
479
+ "primaryKey": false,
480
+ "notNull": true
481
+ },
482
+ "contract": {
483
+ "name": "contract",
484
+ "type": "varchar(66)",
485
+ "primaryKey": false,
486
+ "notNull": true
487
+ },
488
+ "user": {
489
+ "name": "user",
490
+ "type": "varchar(42)",
491
+ "primaryKey": false,
492
+ "notNull": true
493
+ },
494
+ "position_type_id": {
495
+ "name": "position_type_id",
496
+ "type": "integer",
497
+ "primaryKey": false,
498
+ "notNull": true
499
+ }
500
+ },
501
+ "indexes": {},
502
+ "foreignKeys": {
503
+ "lots_positions_position_type_id_position_types_id_fk": {
504
+ "name": "lots_positions_position_type_id_position_types_id_fk",
505
+ "tableFrom": "lots_positions",
506
+ "tableTo": "position_types",
507
+ "schemaTo": "router_v1.14",
508
+ "columnsFrom": ["position_type_id"],
509
+ "columnsTo": ["id"],
510
+ "onDelete": "no action",
511
+ "onUpdate": "no action"
512
+ }
513
+ },
514
+ "compositePrimaryKeys": {
515
+ "lots_positions_pk": {
516
+ "name": "lots_positions_pk",
517
+ "columns": ["chain_id", "contract", "user"]
518
+ }
519
+ },
520
+ "uniqueConstraints": {},
521
+ "policies": {},
522
+ "checkConstraints": {},
523
+ "isRLSEnabled": false
524
+ },
525
+ "router_v1.14.merkle_paths": {
526
+ "name": "merkle_paths",
527
+ "schema": "router_v1.14",
528
+ "columns": {
529
+ "offer_hash": {
530
+ "name": "offer_hash",
531
+ "type": "varchar(66)",
532
+ "primaryKey": false,
533
+ "notNull": true
534
+ },
535
+ "obligation_id": {
536
+ "name": "obligation_id",
537
+ "type": "varchar(66)",
538
+ "primaryKey": false,
539
+ "notNull": true
540
+ },
541
+ "tree_root": {
542
+ "name": "tree_root",
543
+ "type": "varchar(66)",
544
+ "primaryKey": false,
545
+ "notNull": true
546
+ },
547
+ "proof_nodes": {
548
+ "name": "proof_nodes",
549
+ "type": "text",
550
+ "primaryKey": false,
551
+ "notNull": true
552
+ },
553
+ "created_at": {
554
+ "name": "created_at",
555
+ "type": "timestamp",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "default": "now()"
559
+ }
560
+ },
561
+ "indexes": {
562
+ "merkle_paths_tree_root_idx": {
563
+ "name": "merkle_paths_tree_root_idx",
564
+ "columns": [
565
+ {
566
+ "expression": "tree_root",
567
+ "isExpression": false,
568
+ "asc": true,
569
+ "nulls": "last"
570
+ }
571
+ ],
572
+ "isUnique": false,
573
+ "concurrently": false,
574
+ "method": "btree",
575
+ "with": {}
576
+ }
577
+ },
578
+ "foreignKeys": {
579
+ "merkle_paths_tree_root_trees_root_fk": {
580
+ "name": "merkle_paths_tree_root_trees_root_fk",
581
+ "tableFrom": "merkle_paths",
582
+ "tableTo": "trees",
583
+ "schemaTo": "router_v1.14",
584
+ "columnsFrom": ["tree_root"],
585
+ "columnsTo": ["root"],
586
+ "onDelete": "cascade",
587
+ "onUpdate": "no action"
588
+ },
589
+ "merkle_paths_offer_fk": {
590
+ "name": "merkle_paths_offer_fk",
591
+ "tableFrom": "merkle_paths",
592
+ "tableTo": "offers",
593
+ "schemaTo": "router_v1.14",
594
+ "columnsFrom": ["offer_hash", "obligation_id"],
595
+ "columnsTo": ["hash", "obligation_id"],
596
+ "onDelete": "cascade",
597
+ "onUpdate": "no action"
598
+ }
599
+ },
600
+ "compositePrimaryKeys": {
601
+ "merkle_paths_pk": {
602
+ "name": "merkle_paths_pk",
603
+ "columns": ["offer_hash", "obligation_id"]
604
+ }
605
+ },
606
+ "uniqueConstraints": {},
607
+ "policies": {},
608
+ "checkConstraints": {},
609
+ "isRLSEnabled": false
610
+ },
611
+ "router_v1.14.obligation_collaterals_v2": {
612
+ "name": "obligation_collaterals_v2",
613
+ "schema": "router_v1.14",
614
+ "columns": {
615
+ "obligation_key": {
616
+ "name": "obligation_key",
617
+ "type": "varchar(66)",
618
+ "primaryKey": false,
619
+ "notNull": true
620
+ },
621
+ "asset": {
622
+ "name": "asset",
623
+ "type": "varchar(42)",
624
+ "primaryKey": false,
625
+ "notNull": true
626
+ },
627
+ "oracle_address": {
628
+ "name": "oracle_address",
629
+ "type": "varchar(42)",
630
+ "primaryKey": false,
631
+ "notNull": true
632
+ },
633
+ "lltv": {
634
+ "name": "lltv",
635
+ "type": "bigint",
636
+ "primaryKey": false,
637
+ "notNull": true
638
+ },
639
+ "max_lif": {
640
+ "name": "max_lif",
641
+ "type": "bigint",
642
+ "primaryKey": false,
643
+ "notNull": true
644
+ },
645
+ "collateral_index": {
646
+ "name": "collateral_index",
647
+ "type": "integer",
648
+ "primaryKey": false,
649
+ "notNull": true
650
+ },
651
+ "updated_at": {
652
+ "name": "updated_at",
653
+ "type": "timestamp",
654
+ "primaryKey": false,
655
+ "notNull": true,
656
+ "default": "now()"
657
+ }
658
+ },
659
+ "indexes": {},
660
+ "foreignKeys": {
661
+ "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk": {
662
+ "name": "obligation_collaterals_v2_obligation_key_obligations_obligation_key_fk",
663
+ "tableFrom": "obligation_collaterals_v2",
664
+ "tableTo": "obligations",
665
+ "schemaTo": "router_v1.14",
666
+ "columnsFrom": ["obligation_key"],
667
+ "columnsTo": ["obligation_key"],
668
+ "onDelete": "cascade",
669
+ "onUpdate": "no action"
670
+ }
671
+ },
672
+ "compositePrimaryKeys": {
673
+ "obligation_collaterals_v2_pk": {
674
+ "name": "obligation_collaterals_v2_pk",
675
+ "columns": ["obligation_key", "asset"]
676
+ }
677
+ },
678
+ "uniqueConstraints": {},
679
+ "policies": {},
680
+ "checkConstraints": {},
681
+ "isRLSEnabled": false
682
+ },
683
+ "router_v1.14.obligation_id_keys": {
684
+ "name": "obligation_id_keys",
685
+ "schema": "router_v1.14",
686
+ "columns": {
687
+ "obligation_id": {
688
+ "name": "obligation_id",
689
+ "type": "varchar(66)",
690
+ "primaryKey": true,
691
+ "notNull": true
692
+ },
693
+ "obligation_key": {
694
+ "name": "obligation_key",
695
+ "type": "varchar(66)",
696
+ "primaryKey": false,
697
+ "notNull": true
698
+ },
699
+ "chain_id": {
700
+ "name": "chain_id",
701
+ "type": "bigint",
702
+ "primaryKey": false,
703
+ "notNull": true
704
+ },
705
+ "morpho_v2": {
706
+ "name": "morpho_v2",
707
+ "type": "varchar(42)",
708
+ "primaryKey": false,
709
+ "notNull": true
710
+ }
711
+ },
712
+ "indexes": {
713
+ "obligation_id_keys_obligation_key_idx": {
714
+ "name": "obligation_id_keys_obligation_key_idx",
715
+ "columns": [
716
+ {
717
+ "expression": "obligation_key",
718
+ "isExpression": false,
719
+ "asc": true,
720
+ "nulls": "last"
721
+ }
722
+ ],
723
+ "isUnique": false,
724
+ "concurrently": false,
725
+ "method": "btree",
726
+ "with": {}
727
+ },
728
+ "obligation_id_keys_chain_id_idx": {
729
+ "name": "obligation_id_keys_chain_id_idx",
730
+ "columns": [
731
+ {
732
+ "expression": "chain_id",
733
+ "isExpression": false,
734
+ "asc": true,
735
+ "nulls": "last"
736
+ }
737
+ ],
738
+ "isUnique": false,
739
+ "concurrently": false,
740
+ "method": "btree",
741
+ "with": {}
742
+ }
743
+ },
744
+ "foreignKeys": {
745
+ "obligation_id_keys_obligation_key_obligations_obligation_key_fk": {
746
+ "name": "obligation_id_keys_obligation_key_obligations_obligation_key_fk",
747
+ "tableFrom": "obligation_id_keys",
748
+ "tableTo": "obligations",
749
+ "schemaTo": "router_v1.14",
750
+ "columnsFrom": ["obligation_key"],
751
+ "columnsTo": ["obligation_key"],
752
+ "onDelete": "cascade",
753
+ "onUpdate": "no action"
754
+ }
755
+ },
756
+ "compositePrimaryKeys": {},
757
+ "uniqueConstraints": {},
758
+ "policies": {},
759
+ "checkConstraints": {},
760
+ "isRLSEnabled": false
761
+ },
762
+ "router_v1.14.obligations": {
763
+ "name": "obligations",
764
+ "schema": "router_v1.14",
765
+ "columns": {
766
+ "obligation_key": {
767
+ "name": "obligation_key",
768
+ "type": "varchar(66)",
769
+ "primaryKey": true,
770
+ "notNull": true
771
+ },
772
+ "loan_token": {
773
+ "name": "loan_token",
774
+ "type": "varchar(42)",
775
+ "primaryKey": false,
776
+ "notNull": true
777
+ },
778
+ "maturity": {
779
+ "name": "maturity",
780
+ "type": "integer",
781
+ "primaryKey": false,
782
+ "notNull": true
783
+ },
784
+ "rcf_threshold": {
785
+ "name": "rcf_threshold",
786
+ "type": "numeric(78, 0)",
787
+ "primaryKey": false,
788
+ "notNull": true
789
+ }
790
+ },
791
+ "indexes": {},
792
+ "foreignKeys": {},
793
+ "compositePrimaryKeys": {},
794
+ "uniqueConstraints": {},
795
+ "policies": {},
796
+ "checkConstraints": {},
797
+ "isRLSEnabled": false
798
+ },
799
+ "router_v1.14.offers": {
800
+ "name": "offers",
801
+ "schema": "router_v1.14",
802
+ "columns": {
803
+ "hash": {
804
+ "name": "hash",
805
+ "type": "varchar(66)",
806
+ "primaryKey": false,
807
+ "notNull": true
808
+ },
809
+ "obligation_id": {
810
+ "name": "obligation_id",
811
+ "type": "varchar(66)",
812
+ "primaryKey": false,
813
+ "notNull": true
814
+ },
815
+ "obligation_units": {
816
+ "name": "obligation_units",
817
+ "type": "numeric(78, 0)",
818
+ "primaryKey": false,
819
+ "notNull": true,
820
+ "default": "'0'"
821
+ },
822
+ "obligation_shares": {
823
+ "name": "obligation_shares",
824
+ "type": "numeric(78, 0)",
825
+ "primaryKey": false,
826
+ "notNull": true,
827
+ "default": "'0'"
828
+ },
829
+ "tick": {
830
+ "name": "tick",
831
+ "type": "integer",
832
+ "primaryKey": false,
833
+ "notNull": true
834
+ },
835
+ "maturity": {
836
+ "name": "maturity",
837
+ "type": "integer",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "expiry": {
842
+ "name": "expiry",
843
+ "type": "integer",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "start": {
848
+ "name": "start",
849
+ "type": "integer",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "group_chain_id": {
854
+ "name": "group_chain_id",
855
+ "type": "bigint",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ },
859
+ "group_maker": {
860
+ "name": "group_maker",
861
+ "type": "varchar(42)",
862
+ "primaryKey": false,
863
+ "notNull": true
864
+ },
865
+ "group_group": {
866
+ "name": "group_group",
867
+ "type": "varchar(66)",
868
+ "primaryKey": false,
869
+ "notNull": true
870
+ },
871
+ "session": {
872
+ "name": "session",
873
+ "type": "varchar(66)",
874
+ "primaryKey": false,
875
+ "notNull": true
876
+ },
877
+ "buy": {
878
+ "name": "buy",
879
+ "type": "boolean",
880
+ "primaryKey": false,
881
+ "notNull": true
882
+ },
883
+ "callback_address": {
884
+ "name": "callback_address",
885
+ "type": "varchar(42)",
886
+ "primaryKey": false,
887
+ "notNull": true
888
+ },
889
+ "callback_data": {
890
+ "name": "callback_data",
891
+ "type": "text",
892
+ "primaryKey": false,
893
+ "notNull": true
894
+ },
895
+ "receiver_if_maker_is_seller": {
896
+ "name": "receiver_if_maker_is_seller",
897
+ "type": "varchar(42)",
898
+ "primaryKey": false,
899
+ "notNull": false
900
+ },
901
+ "block_number": {
902
+ "name": "block_number",
903
+ "type": "bigint",
904
+ "primaryKey": false,
905
+ "notNull": true
906
+ },
907
+ "updated_at": {
908
+ "name": "updated_at",
909
+ "type": "timestamp",
910
+ "primaryKey": false,
911
+ "notNull": true,
912
+ "default": "now()"
913
+ }
914
+ },
915
+ "indexes": {
916
+ "offers_group_and_hash_idx": {
917
+ "name": "offers_group_and_hash_idx",
918
+ "columns": [
919
+ {
920
+ "expression": "group_chain_id",
921
+ "isExpression": false,
922
+ "asc": true,
923
+ "nulls": "last"
924
+ },
925
+ {
926
+ "expression": "group_maker",
927
+ "isExpression": false,
928
+ "asc": true,
929
+ "nulls": "last"
930
+ },
931
+ {
932
+ "expression": "group_group",
933
+ "isExpression": false,
934
+ "asc": true,
935
+ "nulls": "last"
936
+ },
937
+ {
938
+ "expression": "hash",
939
+ "isExpression": false,
940
+ "asc": true,
941
+ "nulls": "last"
942
+ }
943
+ ],
944
+ "isUnique": false,
945
+ "concurrently": false,
946
+ "method": "btree",
947
+ "with": {}
948
+ },
949
+ "offers_obligation_side_tick_idx": {
950
+ "name": "offers_obligation_side_tick_idx",
951
+ "columns": [
952
+ {
953
+ "expression": "obligation_id",
954
+ "isExpression": false,
955
+ "asc": true,
956
+ "nulls": "last"
957
+ },
958
+ {
959
+ "expression": "buy",
960
+ "isExpression": false,
961
+ "asc": true,
962
+ "nulls": "last"
963
+ },
964
+ {
965
+ "expression": "tick",
966
+ "isExpression": false,
967
+ "asc": true,
968
+ "nulls": "last"
969
+ }
970
+ ],
971
+ "isUnique": false,
972
+ "concurrently": false,
973
+ "method": "btree",
974
+ "with": {}
975
+ },
976
+ "offers_group_maker_idx": {
977
+ "name": "offers_group_maker_idx",
978
+ "columns": [
979
+ {
980
+ "expression": "group_maker",
981
+ "isExpression": false,
982
+ "asc": true,
983
+ "nulls": "last"
984
+ },
985
+ {
986
+ "expression": "hash",
987
+ "isExpression": false,
988
+ "asc": true,
989
+ "nulls": "last"
990
+ },
991
+ {
992
+ "expression": "obligation_id",
993
+ "isExpression": false,
994
+ "asc": true,
995
+ "nulls": "last"
996
+ }
997
+ ],
998
+ "isUnique": false,
999
+ "concurrently": false,
1000
+ "method": "btree",
1001
+ "with": {}
1002
+ },
1003
+ "offers_group_winner_expr_idx": {
1004
+ "name": "offers_group_winner_expr_idx",
1005
+ "columns": [
1006
+ {
1007
+ "expression": "group_chain_id",
1008
+ "isExpression": false,
1009
+ "asc": true,
1010
+ "nulls": "last"
1011
+ },
1012
+ {
1013
+ "expression": "group_maker",
1014
+ "isExpression": false,
1015
+ "asc": true,
1016
+ "nulls": "last"
1017
+ },
1018
+ {
1019
+ "expression": "group_group",
1020
+ "isExpression": false,
1021
+ "asc": true,
1022
+ "nulls": "last"
1023
+ },
1024
+ {
1025
+ "expression": "obligation_id",
1026
+ "isExpression": false,
1027
+ "asc": true,
1028
+ "nulls": "last"
1029
+ },
1030
+ {
1031
+ "expression": "buy",
1032
+ "isExpression": false,
1033
+ "asc": true,
1034
+ "nulls": "last"
1035
+ },
1036
+ {
1037
+ "expression": "(CASE WHEN \"buy\" THEN -\"tick\" ELSE \"tick\" END)",
1038
+ "asc": true,
1039
+ "isExpression": true,
1040
+ "nulls": "last"
1041
+ },
1042
+ {
1043
+ "expression": "block_number",
1044
+ "isExpression": false,
1045
+ "asc": true,
1046
+ "nulls": "last"
1047
+ },
1048
+ {
1049
+ "expression": "hash",
1050
+ "isExpression": false,
1051
+ "asc": true,
1052
+ "nulls": "last"
1053
+ }
1054
+ ],
1055
+ "isUnique": false,
1056
+ "concurrently": false,
1057
+ "method": "btree",
1058
+ "with": {}
1059
+ }
1060
+ },
1061
+ "foreignKeys": {
1062
+ "offers_obligation_id_obligation_id_keys_obligation_id_fk": {
1063
+ "name": "offers_obligation_id_obligation_id_keys_obligation_id_fk",
1064
+ "tableFrom": "offers",
1065
+ "tableTo": "obligation_id_keys",
1066
+ "schemaTo": "router_v1.14",
1067
+ "columnsFrom": ["obligation_id"],
1068
+ "columnsTo": ["obligation_id"],
1069
+ "onDelete": "cascade",
1070
+ "onUpdate": "no action"
1071
+ },
1072
+ "offers_groups_fk": {
1073
+ "name": "offers_groups_fk",
1074
+ "tableFrom": "offers",
1075
+ "tableTo": "groups",
1076
+ "schemaTo": "router_v1.14",
1077
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1078
+ "columnsTo": ["chain_id", "maker", "group"],
1079
+ "onDelete": "cascade",
1080
+ "onUpdate": "no action"
1081
+ }
1082
+ },
1083
+ "compositePrimaryKeys": {
1084
+ "offers_pk": {
1085
+ "name": "offers_pk",
1086
+ "columns": ["hash", "obligation_id"]
1087
+ }
1088
+ },
1089
+ "uniqueConstraints": {},
1090
+ "policies": {},
1091
+ "checkConstraints": {},
1092
+ "isRLSEnabled": false
1093
+ },
1094
+ "router_v1.14.offers_callbacks": {
1095
+ "name": "offers_callbacks",
1096
+ "schema": "router_v1.14",
1097
+ "columns": {
1098
+ "offer_hash": {
1099
+ "name": "offer_hash",
1100
+ "type": "varchar(66)",
1101
+ "primaryKey": false,
1102
+ "notNull": true
1103
+ },
1104
+ "obligation_id": {
1105
+ "name": "obligation_id",
1106
+ "type": "varchar(66)",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ },
1110
+ "callback_id": {
1111
+ "name": "callback_id",
1112
+ "type": "varchar(66)",
1113
+ "primaryKey": false,
1114
+ "notNull": false
1115
+ }
1116
+ },
1117
+ "indexes": {},
1118
+ "foreignKeys": {
1119
+ "offers_callbacks_offer_fk": {
1120
+ "name": "offers_callbacks_offer_fk",
1121
+ "tableFrom": "offers_callbacks",
1122
+ "tableTo": "offers",
1123
+ "schemaTo": "router_v1.14",
1124
+ "columnsFrom": ["offer_hash", "obligation_id"],
1125
+ "columnsTo": ["hash", "obligation_id"],
1126
+ "onDelete": "cascade",
1127
+ "onUpdate": "no action"
1128
+ }
1129
+ },
1130
+ "compositePrimaryKeys": {
1131
+ "offers_callbacks_pk": {
1132
+ "name": "offers_callbacks_pk",
1133
+ "columns": ["offer_hash", "obligation_id", "callback_id"]
1134
+ }
1135
+ },
1136
+ "uniqueConstraints": {},
1137
+ "policies": {},
1138
+ "checkConstraints": {},
1139
+ "isRLSEnabled": false
1140
+ },
1141
+ "router_v1.14.offsets": {
1142
+ "name": "offsets",
1143
+ "schema": "router_v1.14",
1144
+ "columns": {
1145
+ "chain_id": {
1146
+ "name": "chain_id",
1147
+ "type": "bigint",
1148
+ "primaryKey": false,
1149
+ "notNull": true
1150
+ },
1151
+ "user": {
1152
+ "name": "user",
1153
+ "type": "varchar(42)",
1154
+ "primaryKey": false,
1155
+ "notNull": true
1156
+ },
1157
+ "contract": {
1158
+ "name": "contract",
1159
+ "type": "varchar(66)",
1160
+ "primaryKey": false,
1161
+ "notNull": true
1162
+ },
1163
+ "group": {
1164
+ "name": "group",
1165
+ "type": "varchar(66)",
1166
+ "primaryKey": false,
1167
+ "notNull": true
1168
+ },
1169
+ "obligation_id": {
1170
+ "name": "obligation_id",
1171
+ "type": "varchar(66)",
1172
+ "primaryKey": false,
1173
+ "notNull": true
1174
+ },
1175
+ "value": {
1176
+ "name": "value",
1177
+ "type": "numeric(78, 0)",
1178
+ "primaryKey": false,
1179
+ "notNull": true
1180
+ }
1181
+ },
1182
+ "indexes": {},
1183
+ "foreignKeys": {
1184
+ "offsets_lots_positions_fk": {
1185
+ "name": "offsets_lots_positions_fk",
1186
+ "tableFrom": "offsets",
1187
+ "tableTo": "lots_positions",
1188
+ "schemaTo": "router_v1.14",
1189
+ "columnsFrom": ["chain_id", "contract", "user"],
1190
+ "columnsTo": ["chain_id", "contract", "user"],
1191
+ "onDelete": "cascade",
1192
+ "onUpdate": "no action"
1193
+ }
1194
+ },
1195
+ "compositePrimaryKeys": {
1196
+ "offsets_pk": {
1197
+ "name": "offsets_pk",
1198
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
1199
+ }
1200
+ },
1201
+ "uniqueConstraints": {},
1202
+ "policies": {},
1203
+ "checkConstraints": {},
1204
+ "isRLSEnabled": false
1205
+ },
1206
+ "router_v1.14.oracles": {
1207
+ "name": "oracles",
1208
+ "schema": "router_v1.14",
1209
+ "columns": {
1210
+ "chain_id": {
1211
+ "name": "chain_id",
1212
+ "type": "bigint",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "address": {
1217
+ "name": "address",
1218
+ "type": "varchar(42)",
1219
+ "primaryKey": false,
1220
+ "notNull": true
1221
+ },
1222
+ "price": {
1223
+ "name": "price",
1224
+ "type": "numeric(78, 0)",
1225
+ "primaryKey": false,
1226
+ "notNull": false
1227
+ },
1228
+ "block_number": {
1229
+ "name": "block_number",
1230
+ "type": "bigint",
1231
+ "primaryKey": false,
1232
+ "notNull": true
1233
+ },
1234
+ "updated_at": {
1235
+ "name": "updated_at",
1236
+ "type": "timestamp",
1237
+ "primaryKey": false,
1238
+ "notNull": true,
1239
+ "default": "now()"
1240
+ }
1241
+ },
1242
+ "indexes": {},
1243
+ "foreignKeys": {},
1244
+ "compositePrimaryKeys": {
1245
+ "oracles_pk": {
1246
+ "name": "oracles_pk",
1247
+ "columns": ["chain_id", "address"]
1248
+ }
1249
+ },
1250
+ "uniqueConstraints": {},
1251
+ "policies": {},
1252
+ "checkConstraints": {},
1253
+ "isRLSEnabled": false
1254
+ },
1255
+ "router_v1.14.pending_links": {
1256
+ "name": "pending_links",
1257
+ "schema": "router_v1.14",
1258
+ "columns": {
1259
+ "key": {
1260
+ "name": "key",
1261
+ "type": "varchar(191)",
1262
+ "primaryKey": true,
1263
+ "notNull": true
1264
+ },
1265
+ "type": {
1266
+ "name": "type",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": true
1270
+ },
1271
+ "status": {
1272
+ "name": "status",
1273
+ "type": "text",
1274
+ "primaryKey": false,
1275
+ "notNull": true
1276
+ },
1277
+ "chain_id": {
1278
+ "name": "chain_id",
1279
+ "type": "bigint",
1280
+ "primaryKey": false,
1281
+ "notNull": true
1282
+ },
1283
+ "event_id": {
1284
+ "name": "event_id",
1285
+ "type": "varchar(128)",
1286
+ "primaryKey": false,
1287
+ "notNull": true
1288
+ },
1289
+ "obligation_id": {
1290
+ "name": "obligation_id",
1291
+ "type": "varchar(66)",
1292
+ "primaryKey": false,
1293
+ "notNull": true
1294
+ },
1295
+ "collateral_index": {
1296
+ "name": "collateral_index",
1297
+ "type": "integer",
1298
+ "primaryKey": false,
1299
+ "notNull": true
1300
+ },
1301
+ "user": {
1302
+ "name": "user",
1303
+ "type": "varchar(42)",
1304
+ "primaryKey": false,
1305
+ "notNull": true
1306
+ },
1307
+ "amount": {
1308
+ "name": "amount",
1309
+ "type": "numeric(78, 0)",
1310
+ "primaryKey": false,
1311
+ "notNull": true
1312
+ },
1313
+ "block_number": {
1314
+ "name": "block_number",
1315
+ "type": "bigint",
1316
+ "primaryKey": false,
1317
+ "notNull": true
1318
+ },
1319
+ "first_seen_block": {
1320
+ "name": "first_seen_block",
1321
+ "type": "bigint",
1322
+ "primaryKey": false,
1323
+ "notNull": true
1324
+ },
1325
+ "last_tried_block": {
1326
+ "name": "last_tried_block",
1327
+ "type": "bigint",
1328
+ "primaryKey": false,
1329
+ "notNull": false
1330
+ },
1331
+ "attempts": {
1332
+ "name": "attempts",
1333
+ "type": "integer",
1334
+ "primaryKey": false,
1335
+ "notNull": true,
1336
+ "default": 0
1337
+ },
1338
+ "ignored_reason": {
1339
+ "name": "ignored_reason",
1340
+ "type": "text",
1341
+ "primaryKey": false,
1342
+ "notNull": false
1343
+ },
1344
+ "resolved_at": {
1345
+ "name": "resolved_at",
1346
+ "type": "timestamp",
1347
+ "primaryKey": false,
1348
+ "notNull": false
1349
+ },
1350
+ "updated_at": {
1351
+ "name": "updated_at",
1352
+ "type": "timestamp",
1353
+ "primaryKey": false,
1354
+ "notNull": true,
1355
+ "default": "now()"
1356
+ }
1357
+ },
1358
+ "indexes": {
1359
+ "pending_links_pending_scan_idx": {
1360
+ "name": "pending_links_pending_scan_idx",
1361
+ "columns": [
1362
+ {
1363
+ "expression": "chain_id",
1364
+ "isExpression": false,
1365
+ "asc": true,
1366
+ "nulls": "last"
1367
+ },
1368
+ {
1369
+ "expression": "type",
1370
+ "isExpression": false,
1371
+ "asc": true,
1372
+ "nulls": "last"
1373
+ },
1374
+ {
1375
+ "expression": "status",
1376
+ "isExpression": false,
1377
+ "asc": true,
1378
+ "nulls": "last"
1379
+ },
1380
+ {
1381
+ "expression": "first_seen_block",
1382
+ "isExpression": false,
1383
+ "asc": true,
1384
+ "nulls": "last"
1385
+ }
1386
+ ],
1387
+ "isUnique": false,
1388
+ "concurrently": false,
1389
+ "method": "btree",
1390
+ "with": {}
1391
+ },
1392
+ "pending_links_event_id_idx": {
1393
+ "name": "pending_links_event_id_idx",
1394
+ "columns": [
1395
+ {
1396
+ "expression": "chain_id",
1397
+ "isExpression": false,
1398
+ "asc": true,
1399
+ "nulls": "last"
1400
+ },
1401
+ {
1402
+ "expression": "event_id",
1403
+ "isExpression": false,
1404
+ "asc": true,
1405
+ "nulls": "last"
1406
+ }
1407
+ ],
1408
+ "isUnique": false,
1409
+ "concurrently": false,
1410
+ "method": "btree",
1411
+ "with": {}
1412
+ }
1413
+ },
1414
+ "foreignKeys": {},
1415
+ "compositePrimaryKeys": {},
1416
+ "uniqueConstraints": {},
1417
+ "policies": {},
1418
+ "checkConstraints": {},
1419
+ "isRLSEnabled": false
1420
+ },
1421
+ "router_v1.14.position_types": {
1422
+ "name": "position_types",
1423
+ "schema": "router_v1.14",
1424
+ "columns": {
1425
+ "id": {
1426
+ "name": "id",
1427
+ "type": "serial",
1428
+ "primaryKey": true,
1429
+ "notNull": true
1430
+ },
1431
+ "type": {
1432
+ "name": "type",
1433
+ "type": "position_type",
1434
+ "typeSchema": "router_v1.14",
1435
+ "primaryKey": false,
1436
+ "notNull": true
1437
+ }
1438
+ },
1439
+ "indexes": {},
1440
+ "foreignKeys": {},
1441
+ "compositePrimaryKeys": {},
1442
+ "uniqueConstraints": {},
1443
+ "policies": {},
1444
+ "checkConstraints": {},
1445
+ "isRLSEnabled": false
1446
+ },
1447
+ "router_v1.14.positions": {
1448
+ "name": "positions",
1449
+ "schema": "router_v1.14",
1450
+ "columns": {
1451
+ "chain_id": {
1452
+ "name": "chain_id",
1453
+ "type": "bigint",
1454
+ "primaryKey": false,
1455
+ "notNull": true
1456
+ },
1457
+ "contract": {
1458
+ "name": "contract",
1459
+ "type": "varchar(66)",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "user": {
1464
+ "name": "user",
1465
+ "type": "varchar(42)",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "position_type_id": {
1470
+ "name": "position_type_id",
1471
+ "type": "integer",
1472
+ "primaryKey": false,
1473
+ "notNull": true
1474
+ },
1475
+ "balance": {
1476
+ "name": "balance",
1477
+ "type": "numeric(78, 0)",
1478
+ "primaryKey": false,
1479
+ "notNull": false
1480
+ },
1481
+ "asset": {
1482
+ "name": "asset",
1483
+ "type": "varchar(42)",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "block_number": {
1488
+ "name": "block_number",
1489
+ "type": "bigint",
1490
+ "primaryKey": false,
1491
+ "notNull": true
1492
+ },
1493
+ "updated_at": {
1494
+ "name": "updated_at",
1495
+ "type": "timestamp",
1496
+ "primaryKey": false,
1497
+ "notNull": true,
1498
+ "default": "now()"
1499
+ }
1500
+ },
1501
+ "indexes": {},
1502
+ "foreignKeys": {
1503
+ "positions_position_type_id_position_types_id_fk": {
1504
+ "name": "positions_position_type_id_position_types_id_fk",
1505
+ "tableFrom": "positions",
1506
+ "tableTo": "position_types",
1507
+ "schemaTo": "router_v1.14",
1508
+ "columnsFrom": ["position_type_id"],
1509
+ "columnsTo": ["id"],
1510
+ "onDelete": "no action",
1511
+ "onUpdate": "no action"
1512
+ }
1513
+ },
1514
+ "compositePrimaryKeys": {
1515
+ "positions_pk": {
1516
+ "name": "positions_pk",
1517
+ "columns": ["chain_id", "contract", "user", "position_type_id", "asset"]
1518
+ }
1519
+ },
1520
+ "uniqueConstraints": {},
1521
+ "policies": {},
1522
+ "checkConstraints": {},
1523
+ "isRLSEnabled": false
1524
+ },
1525
+ "router_v1.14.status": {
1526
+ "name": "status",
1527
+ "schema": "router_v1.14",
1528
+ "columns": {
1529
+ "id": {
1530
+ "name": "id",
1531
+ "type": "serial",
1532
+ "primaryKey": true,
1533
+ "notNull": true
1534
+ },
1535
+ "code": {
1536
+ "name": "code",
1537
+ "type": "status_code",
1538
+ "typeSchema": "router_v1.14",
1539
+ "primaryKey": false,
1540
+ "notNull": false
1541
+ }
1542
+ },
1543
+ "indexes": {},
1544
+ "foreignKeys": {},
1545
+ "compositePrimaryKeys": {},
1546
+ "uniqueConstraints": {
1547
+ "status_code_unique": {
1548
+ "name": "status_code_unique",
1549
+ "nullsNotDistinct": false,
1550
+ "columns": ["code"]
1551
+ }
1552
+ },
1553
+ "policies": {},
1554
+ "checkConstraints": {},
1555
+ "isRLSEnabled": false
1556
+ },
1557
+ "router_v1.14.transfers": {
1558
+ "name": "transfers",
1559
+ "schema": "router_v1.14",
1560
+ "columns": {
1561
+ "event_id": {
1562
+ "name": "event_id",
1563
+ "type": "varchar(128)",
1564
+ "primaryKey": true,
1565
+ "notNull": true
1566
+ },
1567
+ "chain_id": {
1568
+ "name": "chain_id",
1569
+ "type": "bigint",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "contract": {
1574
+ "name": "contract",
1575
+ "type": "varchar(66)",
1576
+ "primaryKey": false,
1577
+ "notNull": true
1578
+ },
1579
+ "from": {
1580
+ "name": "from",
1581
+ "type": "varchar(42)",
1582
+ "primaryKey": false,
1583
+ "notNull": true
1584
+ },
1585
+ "to": {
1586
+ "name": "to",
1587
+ "type": "varchar(42)",
1588
+ "primaryKey": false,
1589
+ "notNull": true
1590
+ },
1591
+ "value": {
1592
+ "name": "value",
1593
+ "type": "numeric(78, 0)",
1594
+ "primaryKey": false,
1595
+ "notNull": true
1596
+ },
1597
+ "position_type_id": {
1598
+ "name": "position_type_id",
1599
+ "type": "integer",
1600
+ "primaryKey": false,
1601
+ "notNull": true
1602
+ },
1603
+ "asset": {
1604
+ "name": "asset",
1605
+ "type": "varchar(42)",
1606
+ "primaryKey": false,
1607
+ "notNull": true
1608
+ },
1609
+ "block_number": {
1610
+ "name": "block_number",
1611
+ "type": "bigint",
1612
+ "primaryKey": false,
1613
+ "notNull": true
1614
+ },
1615
+ "created_at": {
1616
+ "name": "created_at",
1617
+ "type": "timestamp",
1618
+ "primaryKey": false,
1619
+ "notNull": true,
1620
+ "default": "now()"
1621
+ }
1622
+ },
1623
+ "indexes": {
1624
+ "transfers_chain_contract_user_idx": {
1625
+ "name": "transfers_chain_contract_user_idx",
1626
+ "columns": [
1627
+ {
1628
+ "expression": "chain_id",
1629
+ "isExpression": false,
1630
+ "asc": true,
1631
+ "nulls": "last"
1632
+ },
1633
+ {
1634
+ "expression": "contract",
1635
+ "isExpression": false,
1636
+ "asc": true,
1637
+ "nulls": "last"
1638
+ },
1639
+ {
1640
+ "expression": "from",
1641
+ "isExpression": false,
1642
+ "asc": true,
1643
+ "nulls": "last"
1644
+ },
1645
+ {
1646
+ "expression": "to",
1647
+ "isExpression": false,
1648
+ "asc": true,
1649
+ "nulls": "last"
1650
+ },
1651
+ {
1652
+ "expression": "block_number",
1653
+ "isExpression": false,
1654
+ "asc": true,
1655
+ "nulls": "last"
1656
+ }
1657
+ ],
1658
+ "isUnique": false,
1659
+ "concurrently": false,
1660
+ "method": "btree",
1661
+ "with": {}
1662
+ },
1663
+ "transfers_chain_type_block_idx": {
1664
+ "name": "transfers_chain_type_block_idx",
1665
+ "columns": [
1666
+ {
1667
+ "expression": "chain_id",
1668
+ "isExpression": false,
1669
+ "asc": true,
1670
+ "nulls": "last"
1671
+ },
1672
+ {
1673
+ "expression": "position_type_id",
1674
+ "isExpression": false,
1675
+ "asc": true,
1676
+ "nulls": "last"
1677
+ },
1678
+ {
1679
+ "expression": "block_number",
1680
+ "isExpression": false,
1681
+ "asc": true,
1682
+ "nulls": "last"
1683
+ }
1684
+ ],
1685
+ "isUnique": false,
1686
+ "concurrently": false,
1687
+ "method": "btree",
1688
+ "with": {}
1689
+ }
1690
+ },
1691
+ "foreignKeys": {
1692
+ "transfers_position_type_id_position_types_id_fk": {
1693
+ "name": "transfers_position_type_id_position_types_id_fk",
1694
+ "tableFrom": "transfers",
1695
+ "tableTo": "position_types",
1696
+ "schemaTo": "router_v1.14",
1697
+ "columnsFrom": ["position_type_id"],
1698
+ "columnsTo": ["id"],
1699
+ "onDelete": "no action",
1700
+ "onUpdate": "no action"
1701
+ },
1702
+ "transfers_positions_from_fk": {
1703
+ "name": "transfers_positions_from_fk",
1704
+ "tableFrom": "transfers",
1705
+ "tableTo": "positions",
1706
+ "schemaTo": "router_v1.14",
1707
+ "columnsFrom": ["chain_id", "contract", "from", "position_type_id", "asset"],
1708
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1709
+ "onDelete": "cascade",
1710
+ "onUpdate": "no action"
1711
+ },
1712
+ "transfers_positions_to_fk": {
1713
+ "name": "transfers_positions_to_fk",
1714
+ "tableFrom": "transfers",
1715
+ "tableTo": "positions",
1716
+ "schemaTo": "router_v1.14",
1717
+ "columnsFrom": ["chain_id", "contract", "to", "position_type_id", "asset"],
1718
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1719
+ "onDelete": "cascade",
1720
+ "onUpdate": "no action"
1721
+ }
1722
+ },
1723
+ "compositePrimaryKeys": {},
1724
+ "uniqueConstraints": {},
1725
+ "policies": {},
1726
+ "checkConstraints": {},
1727
+ "isRLSEnabled": false
1728
+ },
1729
+ "router_v1.14.trees": {
1730
+ "name": "trees",
1731
+ "schema": "router_v1.14",
1732
+ "columns": {
1733
+ "root": {
1734
+ "name": "root",
1735
+ "type": "varchar(66)",
1736
+ "primaryKey": true,
1737
+ "notNull": true
1738
+ },
1739
+ "root_signature": {
1740
+ "name": "root_signature",
1741
+ "type": "varchar(132)",
1742
+ "primaryKey": false,
1743
+ "notNull": true
1744
+ },
1745
+ "created_at": {
1746
+ "name": "created_at",
1747
+ "type": "timestamp",
1748
+ "primaryKey": false,
1749
+ "notNull": true,
1750
+ "default": "now()"
1751
+ }
1752
+ },
1753
+ "indexes": {},
1754
+ "foreignKeys": {},
1755
+ "compositePrimaryKeys": {},
1756
+ "uniqueConstraints": {},
1757
+ "policies": {},
1758
+ "checkConstraints": {},
1759
+ "isRLSEnabled": false
1760
+ },
1761
+ "router_v1.14.validations": {
1762
+ "name": "validations",
1763
+ "schema": "router_v1.14",
1764
+ "columns": {
1765
+ "offer_hash": {
1766
+ "name": "offer_hash",
1767
+ "type": "varchar(66)",
1768
+ "primaryKey": false,
1769
+ "notNull": true
1770
+ },
1771
+ "obligation_id": {
1772
+ "name": "obligation_id",
1773
+ "type": "varchar(66)",
1774
+ "primaryKey": false,
1775
+ "notNull": true
1776
+ },
1777
+ "status_id": {
1778
+ "name": "status_id",
1779
+ "type": "integer",
1780
+ "primaryKey": false,
1781
+ "notNull": true
1782
+ },
1783
+ "updated_at": {
1784
+ "name": "updated_at",
1785
+ "type": "timestamp",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "default": "now()"
1789
+ }
1790
+ },
1791
+ "indexes": {},
1792
+ "foreignKeys": {
1793
+ "validations_status_id_status_id_fk": {
1794
+ "name": "validations_status_id_status_id_fk",
1795
+ "tableFrom": "validations",
1796
+ "tableTo": "status",
1797
+ "schemaTo": "router_v1.14",
1798
+ "columnsFrom": ["status_id"],
1799
+ "columnsTo": ["id"],
1800
+ "onDelete": "no action",
1801
+ "onUpdate": "no action"
1802
+ },
1803
+ "validations_offer_fk": {
1804
+ "name": "validations_offer_fk",
1805
+ "tableFrom": "validations",
1806
+ "tableTo": "offers",
1807
+ "schemaTo": "router_v1.14",
1808
+ "columnsFrom": ["offer_hash", "obligation_id"],
1809
+ "columnsTo": ["hash", "obligation_id"],
1810
+ "onDelete": "cascade",
1811
+ "onUpdate": "no action"
1812
+ }
1813
+ },
1814
+ "compositePrimaryKeys": {
1815
+ "validations_pk": {
1816
+ "name": "validations_pk",
1817
+ "columns": ["offer_hash", "obligation_id"]
1818
+ }
1819
+ },
1820
+ "uniqueConstraints": {},
1821
+ "policies": {},
1822
+ "checkConstraints": {},
1823
+ "isRLSEnabled": false
1824
+ }
1825
+ },
1826
+ "enums": {
1827
+ "router_v1.14.callback_type": {
1828
+ "name": "callback_type",
1829
+ "schema": "router_v1.14",
1830
+ "values": ["empty"]
1831
+ },
1832
+ "router_v1.14.position_type": {
1833
+ "name": "position_type",
1834
+ "schema": "router_v1.14",
1835
+ "values": ["erc20", "vault_v1", "debtOf", "collateralOf"]
1836
+ },
1837
+ "router_v1.14.status_code": {
1838
+ "name": "status_code",
1839
+ "schema": "router_v1.14",
1840
+ "values": ["VALID", "SIMULATION_ERROR"]
1841
+ }
1842
+ },
1843
+ "schemas": {},
1844
+ "sequences": {},
1845
+ "roles": {},
1846
+ "policies": {},
1847
+ "views": {},
1848
+ "_meta": {
1849
+ "columns": {},
1850
+ "schemas": {},
1851
+ "tables": {}
1852
+ }
1853
+ }