@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,1658 @@
1
+ {
2
+ "id": "d50276ed-04ea-4914-8a50-7c81216cf9f3",
3
+ "prevId": "415f72a1-908b-47c2-93a1-2e8eda8d65c4",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "router_v1.13.callbacks": {
8
+ "name": "callbacks",
9
+ "schema": "router_v1.13",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "varchar(66)",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "position_chain_id": {
18
+ "name": "position_chain_id",
19
+ "type": "bigint",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "position_contract": {
24
+ "name": "position_contract",
25
+ "type": "varchar(66)",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "position_user": {
30
+ "name": "position_user",
31
+ "type": "varchar(42)",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "position_type_id": {
36
+ "name": "position_type_id",
37
+ "type": "integer",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "type": {
42
+ "name": "type",
43
+ "type": "callback_type",
44
+ "typeSchema": "router_v1.13",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ }
48
+ },
49
+ "indexes": {},
50
+ "foreignKeys": {
51
+ "callbacks_position_type_id_position_types_id_fk": {
52
+ "name": "callbacks_position_type_id_position_types_id_fk",
53
+ "tableFrom": "callbacks",
54
+ "tableTo": "position_types",
55
+ "schemaTo": "router_v1.13",
56
+ "columnsFrom": ["position_type_id"],
57
+ "columnsTo": ["id"],
58
+ "onDelete": "no action",
59
+ "onUpdate": "no action"
60
+ }
61
+ },
62
+ "compositePrimaryKeys": {},
63
+ "uniqueConstraints": {},
64
+ "policies": {},
65
+ "checkConstraints": {},
66
+ "isRLSEnabled": false
67
+ },
68
+ "router_v1.13.chains": {
69
+ "name": "chains",
70
+ "schema": "router_v1.13",
71
+ "columns": {
72
+ "chain_id": {
73
+ "name": "chain_id",
74
+ "type": "bigint",
75
+ "primaryKey": false,
76
+ "notNull": true
77
+ },
78
+ "block_number": {
79
+ "name": "block_number",
80
+ "type": "bigint",
81
+ "primaryKey": false,
82
+ "notNull": true
83
+ },
84
+ "epoch": {
85
+ "name": "epoch",
86
+ "type": "numeric(78, 0)",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "'0'"
90
+ },
91
+ "updated_at": {
92
+ "name": "updated_at",
93
+ "type": "timestamp",
94
+ "primaryKey": false,
95
+ "notNull": true,
96
+ "default": "now()"
97
+ }
98
+ },
99
+ "indexes": {
100
+ "chains_chain_id_idx": {
101
+ "name": "chains_chain_id_idx",
102
+ "columns": [
103
+ {
104
+ "expression": "chain_id",
105
+ "isExpression": false,
106
+ "asc": true,
107
+ "nulls": "last"
108
+ }
109
+ ],
110
+ "isUnique": true,
111
+ "concurrently": false,
112
+ "method": "btree",
113
+ "with": {}
114
+ }
115
+ },
116
+ "foreignKeys": {},
117
+ "compositePrimaryKeys": {},
118
+ "uniqueConstraints": {},
119
+ "policies": {},
120
+ "checkConstraints": {},
121
+ "isRLSEnabled": false
122
+ },
123
+ "router_v1.13.collectors": {
124
+ "name": "collectors",
125
+ "schema": "router_v1.13",
126
+ "columns": {
127
+ "chain_id": {
128
+ "name": "chain_id",
129
+ "type": "bigint",
130
+ "primaryKey": false,
131
+ "notNull": true
132
+ },
133
+ "name": {
134
+ "name": "name",
135
+ "type": "text",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
139
+ "block_number": {
140
+ "name": "block_number",
141
+ "type": "bigint",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "epoch": {
146
+ "name": "epoch",
147
+ "type": "numeric(78, 0)",
148
+ "primaryKey": false,
149
+ "notNull": true,
150
+ "default": "'0'"
151
+ },
152
+ "updated_at": {
153
+ "name": "updated_at",
154
+ "type": "timestamp",
155
+ "primaryKey": false,
156
+ "notNull": true,
157
+ "default": "now()"
158
+ }
159
+ },
160
+ "indexes": {
161
+ "collectors_chain_name_idx": {
162
+ "name": "collectors_chain_name_idx",
163
+ "columns": [
164
+ {
165
+ "expression": "chain_id",
166
+ "isExpression": false,
167
+ "asc": true,
168
+ "nulls": "last"
169
+ },
170
+ {
171
+ "expression": "name",
172
+ "isExpression": false,
173
+ "asc": true,
174
+ "nulls": "last"
175
+ }
176
+ ],
177
+ "isUnique": true,
178
+ "concurrently": false,
179
+ "method": "btree",
180
+ "with": {}
181
+ }
182
+ },
183
+ "foreignKeys": {
184
+ "collectors_chain_id_chains_chain_id_fk": {
185
+ "name": "collectors_chain_id_chains_chain_id_fk",
186
+ "tableFrom": "collectors",
187
+ "tableTo": "chains",
188
+ "schemaTo": "router_v1.13",
189
+ "columnsFrom": ["chain_id"],
190
+ "columnsTo": ["chain_id"],
191
+ "onDelete": "no action",
192
+ "onUpdate": "no action"
193
+ }
194
+ },
195
+ "compositePrimaryKeys": {},
196
+ "uniqueConstraints": {},
197
+ "policies": {},
198
+ "checkConstraints": {},
199
+ "isRLSEnabled": false
200
+ },
201
+ "router_v1.13.consumed_events": {
202
+ "name": "consumed_events",
203
+ "schema": "router_v1.13",
204
+ "columns": {
205
+ "event_id": {
206
+ "name": "event_id",
207
+ "type": "varchar(128)",
208
+ "primaryKey": true,
209
+ "notNull": true
210
+ },
211
+ "chain_id": {
212
+ "name": "chain_id",
213
+ "type": "bigint",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "maker": {
218
+ "name": "maker",
219
+ "type": "varchar(42)",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "group": {
224
+ "name": "group",
225
+ "type": "varchar(66)",
226
+ "primaryKey": false,
227
+ "notNull": true
228
+ },
229
+ "amount": {
230
+ "name": "amount",
231
+ "type": "numeric(78, 0)",
232
+ "primaryKey": false,
233
+ "notNull": true
234
+ },
235
+ "block_number": {
236
+ "name": "block_number",
237
+ "type": "bigint",
238
+ "primaryKey": false,
239
+ "notNull": true
240
+ },
241
+ "created_at": {
242
+ "name": "created_at",
243
+ "type": "timestamp",
244
+ "primaryKey": false,
245
+ "notNull": true,
246
+ "default": "now()"
247
+ }
248
+ },
249
+ "indexes": {
250
+ "consumed_events_group_idx": {
251
+ "name": "consumed_events_group_idx",
252
+ "columns": [
253
+ {
254
+ "expression": "chain_id",
255
+ "isExpression": false,
256
+ "asc": true,
257
+ "nulls": "last"
258
+ },
259
+ {
260
+ "expression": "maker",
261
+ "isExpression": false,
262
+ "asc": true,
263
+ "nulls": "last"
264
+ },
265
+ {
266
+ "expression": "group",
267
+ "isExpression": false,
268
+ "asc": true,
269
+ "nulls": "last"
270
+ }
271
+ ],
272
+ "isUnique": false,
273
+ "concurrently": false,
274
+ "method": "btree",
275
+ "with": {}
276
+ },
277
+ "consumed_events_block_number_idx": {
278
+ "name": "consumed_events_block_number_idx",
279
+ "columns": [
280
+ {
281
+ "expression": "block_number",
282
+ "isExpression": false,
283
+ "asc": true,
284
+ "nulls": "last"
285
+ }
286
+ ],
287
+ "isUnique": false,
288
+ "concurrently": false,
289
+ "method": "btree",
290
+ "with": {}
291
+ }
292
+ },
293
+ "foreignKeys": {
294
+ "consumed_events_groups_fk": {
295
+ "name": "consumed_events_groups_fk",
296
+ "tableFrom": "consumed_events",
297
+ "tableTo": "groups",
298
+ "schemaTo": "router_v1.13",
299
+ "columnsFrom": ["chain_id", "maker", "group"],
300
+ "columnsTo": ["chain_id", "maker", "group"],
301
+ "onDelete": "cascade",
302
+ "onUpdate": "no action"
303
+ }
304
+ },
305
+ "compositePrimaryKeys": {},
306
+ "uniqueConstraints": {},
307
+ "policies": {},
308
+ "checkConstraints": {},
309
+ "isRLSEnabled": false
310
+ },
311
+ "router_v1.13.groups": {
312
+ "name": "groups",
313
+ "schema": "router_v1.13",
314
+ "columns": {
315
+ "chain_id": {
316
+ "name": "chain_id",
317
+ "type": "bigint",
318
+ "primaryKey": false,
319
+ "notNull": true
320
+ },
321
+ "maker": {
322
+ "name": "maker",
323
+ "type": "varchar(42)",
324
+ "primaryKey": false,
325
+ "notNull": true
326
+ },
327
+ "group": {
328
+ "name": "group",
329
+ "type": "varchar(66)",
330
+ "primaryKey": false,
331
+ "notNull": true
332
+ },
333
+ "consumed": {
334
+ "name": "consumed",
335
+ "type": "numeric(78, 0)",
336
+ "primaryKey": false,
337
+ "notNull": true
338
+ },
339
+ "block_number": {
340
+ "name": "block_number",
341
+ "type": "bigint",
342
+ "primaryKey": false,
343
+ "notNull": true
344
+ },
345
+ "updated_at": {
346
+ "name": "updated_at",
347
+ "type": "timestamp",
348
+ "primaryKey": false,
349
+ "notNull": true,
350
+ "default": "now()"
351
+ }
352
+ },
353
+ "indexes": {
354
+ "groups_chain_id_maker_group_consumed_idx": {
355
+ "name": "groups_chain_id_maker_group_consumed_idx",
356
+ "columns": [
357
+ {
358
+ "expression": "chain_id",
359
+ "isExpression": false,
360
+ "asc": true,
361
+ "nulls": "last"
362
+ },
363
+ {
364
+ "expression": "maker",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ },
369
+ {
370
+ "expression": "group",
371
+ "isExpression": false,
372
+ "asc": true,
373
+ "nulls": "last"
374
+ },
375
+ {
376
+ "expression": "consumed",
377
+ "isExpression": false,
378
+ "asc": true,
379
+ "nulls": "last"
380
+ }
381
+ ],
382
+ "isUnique": false,
383
+ "concurrently": false,
384
+ "method": "btree",
385
+ "with": {}
386
+ }
387
+ },
388
+ "foreignKeys": {},
389
+ "compositePrimaryKeys": {
390
+ "groups_pk": {
391
+ "name": "groups_pk",
392
+ "columns": ["chain_id", "maker", "group"]
393
+ }
394
+ },
395
+ "uniqueConstraints": {},
396
+ "policies": {},
397
+ "checkConstraints": {},
398
+ "isRLSEnabled": false
399
+ },
400
+ "router_v1.13.lots": {
401
+ "name": "lots",
402
+ "schema": "router_v1.13",
403
+ "columns": {
404
+ "chain_id": {
405
+ "name": "chain_id",
406
+ "type": "bigint",
407
+ "primaryKey": false,
408
+ "notNull": true
409
+ },
410
+ "user": {
411
+ "name": "user",
412
+ "type": "varchar(42)",
413
+ "primaryKey": false,
414
+ "notNull": true
415
+ },
416
+ "contract": {
417
+ "name": "contract",
418
+ "type": "varchar(66)",
419
+ "primaryKey": false,
420
+ "notNull": true
421
+ },
422
+ "group": {
423
+ "name": "group",
424
+ "type": "varchar(66)",
425
+ "primaryKey": false,
426
+ "notNull": true
427
+ },
428
+ "obligation_id": {
429
+ "name": "obligation_id",
430
+ "type": "varchar(42)",
431
+ "primaryKey": false,
432
+ "notNull": true
433
+ },
434
+ "lower": {
435
+ "name": "lower",
436
+ "type": "numeric(78, 0)",
437
+ "primaryKey": false,
438
+ "notNull": true
439
+ },
440
+ "upper": {
441
+ "name": "upper",
442
+ "type": "numeric(78, 0)",
443
+ "primaryKey": false,
444
+ "notNull": true
445
+ }
446
+ },
447
+ "indexes": {},
448
+ "foreignKeys": {
449
+ "lots_lots_positions_fk": {
450
+ "name": "lots_lots_positions_fk",
451
+ "tableFrom": "lots",
452
+ "tableTo": "lots_positions",
453
+ "schemaTo": "router_v1.13",
454
+ "columnsFrom": ["chain_id", "contract", "user"],
455
+ "columnsTo": ["chain_id", "contract", "user"],
456
+ "onDelete": "cascade",
457
+ "onUpdate": "no action"
458
+ },
459
+ "lots_groups_fk": {
460
+ "name": "lots_groups_fk",
461
+ "tableFrom": "lots",
462
+ "tableTo": "groups",
463
+ "schemaTo": "router_v1.13",
464
+ "columnsFrom": ["chain_id", "user", "group"],
465
+ "columnsTo": ["chain_id", "maker", "group"],
466
+ "onDelete": "cascade",
467
+ "onUpdate": "no action"
468
+ }
469
+ },
470
+ "compositePrimaryKeys": {
471
+ "lots_pk": {
472
+ "name": "lots_pk",
473
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
474
+ }
475
+ },
476
+ "uniqueConstraints": {},
477
+ "policies": {},
478
+ "checkConstraints": {},
479
+ "isRLSEnabled": false
480
+ },
481
+ "router_v1.13.lots_positions": {
482
+ "name": "lots_positions",
483
+ "schema": "router_v1.13",
484
+ "columns": {
485
+ "chain_id": {
486
+ "name": "chain_id",
487
+ "type": "bigint",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "contract": {
492
+ "name": "contract",
493
+ "type": "varchar(66)",
494
+ "primaryKey": false,
495
+ "notNull": true
496
+ },
497
+ "user": {
498
+ "name": "user",
499
+ "type": "varchar(42)",
500
+ "primaryKey": false,
501
+ "notNull": true
502
+ },
503
+ "position_type_id": {
504
+ "name": "position_type_id",
505
+ "type": "integer",
506
+ "primaryKey": false,
507
+ "notNull": true
508
+ }
509
+ },
510
+ "indexes": {},
511
+ "foreignKeys": {
512
+ "lots_positions_position_type_id_position_types_id_fk": {
513
+ "name": "lots_positions_position_type_id_position_types_id_fk",
514
+ "tableFrom": "lots_positions",
515
+ "tableTo": "position_types",
516
+ "schemaTo": "router_v1.13",
517
+ "columnsFrom": ["position_type_id"],
518
+ "columnsTo": ["id"],
519
+ "onDelete": "no action",
520
+ "onUpdate": "no action"
521
+ }
522
+ },
523
+ "compositePrimaryKeys": {
524
+ "lots_positions_pk": {
525
+ "name": "lots_positions_pk",
526
+ "columns": ["chain_id", "contract", "user"]
527
+ }
528
+ },
529
+ "uniqueConstraints": {},
530
+ "policies": {},
531
+ "checkConstraints": {},
532
+ "isRLSEnabled": false
533
+ },
534
+ "router_v1.13.merkle_paths": {
535
+ "name": "merkle_paths",
536
+ "schema": "router_v1.13",
537
+ "columns": {
538
+ "offer_hash": {
539
+ "name": "offer_hash",
540
+ "type": "varchar(66)",
541
+ "primaryKey": false,
542
+ "notNull": true
543
+ },
544
+ "obligation_id": {
545
+ "name": "obligation_id",
546
+ "type": "varchar(42)",
547
+ "primaryKey": false,
548
+ "notNull": true
549
+ },
550
+ "tree_root": {
551
+ "name": "tree_root",
552
+ "type": "varchar(66)",
553
+ "primaryKey": false,
554
+ "notNull": true
555
+ },
556
+ "proof_nodes": {
557
+ "name": "proof_nodes",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": true
561
+ },
562
+ "created_at": {
563
+ "name": "created_at",
564
+ "type": "timestamp",
565
+ "primaryKey": false,
566
+ "notNull": true,
567
+ "default": "now()"
568
+ }
569
+ },
570
+ "indexes": {
571
+ "merkle_paths_tree_root_idx": {
572
+ "name": "merkle_paths_tree_root_idx",
573
+ "columns": [
574
+ {
575
+ "expression": "tree_root",
576
+ "isExpression": false,
577
+ "asc": true,
578
+ "nulls": "last"
579
+ }
580
+ ],
581
+ "isUnique": false,
582
+ "concurrently": false,
583
+ "method": "btree",
584
+ "with": {}
585
+ }
586
+ },
587
+ "foreignKeys": {
588
+ "merkle_paths_tree_root_trees_root_fk": {
589
+ "name": "merkle_paths_tree_root_trees_root_fk",
590
+ "tableFrom": "merkle_paths",
591
+ "tableTo": "trees",
592
+ "schemaTo": "router_v1.13",
593
+ "columnsFrom": ["tree_root"],
594
+ "columnsTo": ["root"],
595
+ "onDelete": "cascade",
596
+ "onUpdate": "no action"
597
+ },
598
+ "merkle_paths_offer_fk": {
599
+ "name": "merkle_paths_offer_fk",
600
+ "tableFrom": "merkle_paths",
601
+ "tableTo": "offers",
602
+ "schemaTo": "router_v1.13",
603
+ "columnsFrom": ["offer_hash", "obligation_id"],
604
+ "columnsTo": ["hash", "obligation_id"],
605
+ "onDelete": "cascade",
606
+ "onUpdate": "no action"
607
+ }
608
+ },
609
+ "compositePrimaryKeys": {
610
+ "merkle_paths_pk": {
611
+ "name": "merkle_paths_pk",
612
+ "columns": ["offer_hash", "obligation_id"]
613
+ }
614
+ },
615
+ "uniqueConstraints": {},
616
+ "policies": {},
617
+ "checkConstraints": {},
618
+ "isRLSEnabled": false
619
+ },
620
+ "router_v1.13.obligation_collaterals_v2": {
621
+ "name": "obligation_collaterals_v2",
622
+ "schema": "router_v1.13",
623
+ "columns": {
624
+ "obligation_key": {
625
+ "name": "obligation_key",
626
+ "type": "varchar(66)",
627
+ "primaryKey": false,
628
+ "notNull": true
629
+ },
630
+ "asset": {
631
+ "name": "asset",
632
+ "type": "varchar(42)",
633
+ "primaryKey": false,
634
+ "notNull": true
635
+ },
636
+ "oracle_address": {
637
+ "name": "oracle_address",
638
+ "type": "varchar(42)",
639
+ "primaryKey": false,
640
+ "notNull": true
641
+ },
642
+ "lltv": {
643
+ "name": "lltv",
644
+ "type": "bigint",
645
+ "primaryKey": false,
646
+ "notNull": true
647
+ },
648
+ "collateral_index": {
649
+ "name": "collateral_index",
650
+ "type": "integer",
651
+ "primaryKey": false,
652
+ "notNull": true
653
+ },
654
+ "updated_at": {
655
+ "name": "updated_at",
656
+ "type": "timestamp",
657
+ "primaryKey": false,
658
+ "notNull": true,
659
+ "default": "now()"
660
+ }
661
+ },
662
+ "indexes": {
663
+ "obligation_collaterals_v2_obligation_key_idx": {
664
+ "name": "obligation_collaterals_v2_obligation_key_idx",
665
+ "columns": [
666
+ {
667
+ "expression": "obligation_key",
668
+ "isExpression": false,
669
+ "asc": true,
670
+ "nulls": "last"
671
+ }
672
+ ],
673
+ "isUnique": false,
674
+ "concurrently": false,
675
+ "method": "btree",
676
+ "with": {}
677
+ },
678
+ "obligation_collaterals_v2_oracle_address_idx": {
679
+ "name": "obligation_collaterals_v2_oracle_address_idx",
680
+ "columns": [
681
+ {
682
+ "expression": "oracle_address",
683
+ "isExpression": false,
684
+ "asc": true,
685
+ "nulls": "last"
686
+ }
687
+ ],
688
+ "isUnique": false,
689
+ "concurrently": false,
690
+ "method": "btree",
691
+ "with": {}
692
+ }
693
+ },
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.13",
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.13.obligation_id_keys": {
718
+ "name": "obligation_id_keys",
719
+ "schema": "router_v1.13",
720
+ "columns": {
721
+ "obligation_id": {
722
+ "name": "obligation_id",
723
+ "type": "varchar(42)",
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.13",
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.13.obligations": {
797
+ "name": "obligations",
798
+ "schema": "router_v1.13",
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
+ },
819
+ "indexes": {},
820
+ "foreignKeys": {},
821
+ "compositePrimaryKeys": {},
822
+ "uniqueConstraints": {},
823
+ "policies": {},
824
+ "checkConstraints": {},
825
+ "isRLSEnabled": false
826
+ },
827
+ "router_v1.13.offers": {
828
+ "name": "offers",
829
+ "schema": "router_v1.13",
830
+ "columns": {
831
+ "hash": {
832
+ "name": "hash",
833
+ "type": "varchar(66)",
834
+ "primaryKey": false,
835
+ "notNull": true
836
+ },
837
+ "obligation_id": {
838
+ "name": "obligation_id",
839
+ "type": "varchar(42)",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "assets": {
844
+ "name": "assets",
845
+ "type": "numeric(78, 0)",
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_fk_idx": {
951
+ "name": "offers_group_fk_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
+ "isUnique": false,
973
+ "concurrently": false,
974
+ "method": "btree",
975
+ "with": {}
976
+ },
977
+ "offers_group_and_hash_idx": {
978
+ "name": "offers_group_and_hash_idx",
979
+ "columns": [
980
+ {
981
+ "expression": "group_chain_id",
982
+ "isExpression": false,
983
+ "asc": true,
984
+ "nulls": "last"
985
+ },
986
+ {
987
+ "expression": "group_maker",
988
+ "isExpression": false,
989
+ "asc": true,
990
+ "nulls": "last"
991
+ },
992
+ {
993
+ "expression": "group_group",
994
+ "isExpression": false,
995
+ "asc": true,
996
+ "nulls": "last"
997
+ },
998
+ {
999
+ "expression": "hash",
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_id_side_idx": {
1011
+ "name": "offers_obligation_id_side_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
+ "isUnique": false,
1027
+ "concurrently": false,
1028
+ "method": "btree",
1029
+ "with": {}
1030
+ }
1031
+ },
1032
+ "foreignKeys": {
1033
+ "offers_obligation_id_obligation_id_keys_obligation_id_fk": {
1034
+ "name": "offers_obligation_id_obligation_id_keys_obligation_id_fk",
1035
+ "tableFrom": "offers",
1036
+ "tableTo": "obligation_id_keys",
1037
+ "schemaTo": "router_v1.13",
1038
+ "columnsFrom": ["obligation_id"],
1039
+ "columnsTo": ["obligation_id"],
1040
+ "onDelete": "cascade",
1041
+ "onUpdate": "no action"
1042
+ },
1043
+ "offers_groups_fk": {
1044
+ "name": "offers_groups_fk",
1045
+ "tableFrom": "offers",
1046
+ "tableTo": "groups",
1047
+ "schemaTo": "router_v1.13",
1048
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1049
+ "columnsTo": ["chain_id", "maker", "group"],
1050
+ "onDelete": "cascade",
1051
+ "onUpdate": "no action"
1052
+ }
1053
+ },
1054
+ "compositePrimaryKeys": {
1055
+ "offers_pk": {
1056
+ "name": "offers_pk",
1057
+ "columns": ["hash", "obligation_id"]
1058
+ }
1059
+ },
1060
+ "uniqueConstraints": {},
1061
+ "policies": {},
1062
+ "checkConstraints": {},
1063
+ "isRLSEnabled": false
1064
+ },
1065
+ "router_v1.13.offers_callbacks": {
1066
+ "name": "offers_callbacks",
1067
+ "schema": "router_v1.13",
1068
+ "columns": {
1069
+ "offer_hash": {
1070
+ "name": "offer_hash",
1071
+ "type": "varchar(66)",
1072
+ "primaryKey": false,
1073
+ "notNull": true
1074
+ },
1075
+ "obligation_id": {
1076
+ "name": "obligation_id",
1077
+ "type": "varchar(42)",
1078
+ "primaryKey": false,
1079
+ "notNull": true
1080
+ },
1081
+ "callback_id": {
1082
+ "name": "callback_id",
1083
+ "type": "varchar(66)",
1084
+ "primaryKey": false,
1085
+ "notNull": false
1086
+ }
1087
+ },
1088
+ "indexes": {},
1089
+ "foreignKeys": {
1090
+ "offers_callbacks_offer_fk": {
1091
+ "name": "offers_callbacks_offer_fk",
1092
+ "tableFrom": "offers_callbacks",
1093
+ "tableTo": "offers",
1094
+ "schemaTo": "router_v1.13",
1095
+ "columnsFrom": ["offer_hash", "obligation_id"],
1096
+ "columnsTo": ["hash", "obligation_id"],
1097
+ "onDelete": "cascade",
1098
+ "onUpdate": "no action"
1099
+ }
1100
+ },
1101
+ "compositePrimaryKeys": {
1102
+ "offers_callbacks_pk": {
1103
+ "name": "offers_callbacks_pk",
1104
+ "columns": ["offer_hash", "obligation_id", "callback_id"]
1105
+ }
1106
+ },
1107
+ "uniqueConstraints": {},
1108
+ "policies": {},
1109
+ "checkConstraints": {},
1110
+ "isRLSEnabled": false
1111
+ },
1112
+ "router_v1.13.offsets": {
1113
+ "name": "offsets",
1114
+ "schema": "router_v1.13",
1115
+ "columns": {
1116
+ "chain_id": {
1117
+ "name": "chain_id",
1118
+ "type": "bigint",
1119
+ "primaryKey": false,
1120
+ "notNull": true
1121
+ },
1122
+ "user": {
1123
+ "name": "user",
1124
+ "type": "varchar(42)",
1125
+ "primaryKey": false,
1126
+ "notNull": true
1127
+ },
1128
+ "contract": {
1129
+ "name": "contract",
1130
+ "type": "varchar(66)",
1131
+ "primaryKey": false,
1132
+ "notNull": true
1133
+ },
1134
+ "group": {
1135
+ "name": "group",
1136
+ "type": "varchar(66)",
1137
+ "primaryKey": false,
1138
+ "notNull": true
1139
+ },
1140
+ "obligation_id": {
1141
+ "name": "obligation_id",
1142
+ "type": "varchar(42)",
1143
+ "primaryKey": false,
1144
+ "notNull": true
1145
+ },
1146
+ "value": {
1147
+ "name": "value",
1148
+ "type": "numeric(78, 0)",
1149
+ "primaryKey": false,
1150
+ "notNull": true
1151
+ }
1152
+ },
1153
+ "indexes": {},
1154
+ "foreignKeys": {
1155
+ "offsets_lots_positions_fk": {
1156
+ "name": "offsets_lots_positions_fk",
1157
+ "tableFrom": "offsets",
1158
+ "tableTo": "lots_positions",
1159
+ "schemaTo": "router_v1.13",
1160
+ "columnsFrom": ["chain_id", "contract", "user"],
1161
+ "columnsTo": ["chain_id", "contract", "user"],
1162
+ "onDelete": "cascade",
1163
+ "onUpdate": "no action"
1164
+ }
1165
+ },
1166
+ "compositePrimaryKeys": {
1167
+ "offsets_pk": {
1168
+ "name": "offsets_pk",
1169
+ "columns": ["chain_id", "user", "contract", "group", "obligation_id"]
1170
+ }
1171
+ },
1172
+ "uniqueConstraints": {},
1173
+ "policies": {},
1174
+ "checkConstraints": {},
1175
+ "isRLSEnabled": false
1176
+ },
1177
+ "router_v1.13.oracles": {
1178
+ "name": "oracles",
1179
+ "schema": "router_v1.13",
1180
+ "columns": {
1181
+ "chain_id": {
1182
+ "name": "chain_id",
1183
+ "type": "bigint",
1184
+ "primaryKey": false,
1185
+ "notNull": true
1186
+ },
1187
+ "address": {
1188
+ "name": "address",
1189
+ "type": "varchar(42)",
1190
+ "primaryKey": false,
1191
+ "notNull": true
1192
+ },
1193
+ "price": {
1194
+ "name": "price",
1195
+ "type": "numeric(78, 0)",
1196
+ "primaryKey": false,
1197
+ "notNull": false
1198
+ },
1199
+ "block_number": {
1200
+ "name": "block_number",
1201
+ "type": "bigint",
1202
+ "primaryKey": false,
1203
+ "notNull": true
1204
+ },
1205
+ "updated_at": {
1206
+ "name": "updated_at",
1207
+ "type": "timestamp",
1208
+ "primaryKey": false,
1209
+ "notNull": true,
1210
+ "default": "now()"
1211
+ }
1212
+ },
1213
+ "indexes": {},
1214
+ "foreignKeys": {},
1215
+ "compositePrimaryKeys": {
1216
+ "oracles_pk": {
1217
+ "name": "oracles_pk",
1218
+ "columns": ["chain_id", "address"]
1219
+ }
1220
+ },
1221
+ "uniqueConstraints": {},
1222
+ "policies": {},
1223
+ "checkConstraints": {},
1224
+ "isRLSEnabled": false
1225
+ },
1226
+ "router_v1.13.position_types": {
1227
+ "name": "position_types",
1228
+ "schema": "router_v1.13",
1229
+ "columns": {
1230
+ "id": {
1231
+ "name": "id",
1232
+ "type": "serial",
1233
+ "primaryKey": true,
1234
+ "notNull": true
1235
+ },
1236
+ "type": {
1237
+ "name": "type",
1238
+ "type": "position_type",
1239
+ "typeSchema": "router_v1.13",
1240
+ "primaryKey": false,
1241
+ "notNull": true
1242
+ }
1243
+ },
1244
+ "indexes": {},
1245
+ "foreignKeys": {},
1246
+ "compositePrimaryKeys": {},
1247
+ "uniqueConstraints": {},
1248
+ "policies": {},
1249
+ "checkConstraints": {},
1250
+ "isRLSEnabled": false
1251
+ },
1252
+ "router_v1.13.positions": {
1253
+ "name": "positions",
1254
+ "schema": "router_v1.13",
1255
+ "columns": {
1256
+ "chain_id": {
1257
+ "name": "chain_id",
1258
+ "type": "bigint",
1259
+ "primaryKey": false,
1260
+ "notNull": true
1261
+ },
1262
+ "contract": {
1263
+ "name": "contract",
1264
+ "type": "varchar(66)",
1265
+ "primaryKey": false,
1266
+ "notNull": true
1267
+ },
1268
+ "user": {
1269
+ "name": "user",
1270
+ "type": "varchar(42)",
1271
+ "primaryKey": false,
1272
+ "notNull": true
1273
+ },
1274
+ "position_type_id": {
1275
+ "name": "position_type_id",
1276
+ "type": "integer",
1277
+ "primaryKey": false,
1278
+ "notNull": true
1279
+ },
1280
+ "balance": {
1281
+ "name": "balance",
1282
+ "type": "numeric(78, 0)",
1283
+ "primaryKey": false,
1284
+ "notNull": false
1285
+ },
1286
+ "asset": {
1287
+ "name": "asset",
1288
+ "type": "varchar(42)",
1289
+ "primaryKey": false,
1290
+ "notNull": true
1291
+ },
1292
+ "block_number": {
1293
+ "name": "block_number",
1294
+ "type": "bigint",
1295
+ "primaryKey": false,
1296
+ "notNull": true
1297
+ },
1298
+ "updated_at": {
1299
+ "name": "updated_at",
1300
+ "type": "timestamp",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "default": "now()"
1304
+ }
1305
+ },
1306
+ "indexes": {},
1307
+ "foreignKeys": {
1308
+ "positions_position_type_id_position_types_id_fk": {
1309
+ "name": "positions_position_type_id_position_types_id_fk",
1310
+ "tableFrom": "positions",
1311
+ "tableTo": "position_types",
1312
+ "schemaTo": "router_v1.13",
1313
+ "columnsFrom": ["position_type_id"],
1314
+ "columnsTo": ["id"],
1315
+ "onDelete": "no action",
1316
+ "onUpdate": "no action"
1317
+ }
1318
+ },
1319
+ "compositePrimaryKeys": {
1320
+ "positions_pk": {
1321
+ "name": "positions_pk",
1322
+ "columns": ["chain_id", "contract", "user", "position_type_id", "asset"]
1323
+ }
1324
+ },
1325
+ "uniqueConstraints": {},
1326
+ "policies": {},
1327
+ "checkConstraints": {},
1328
+ "isRLSEnabled": false
1329
+ },
1330
+ "router_v1.13.status": {
1331
+ "name": "status",
1332
+ "schema": "router_v1.13",
1333
+ "columns": {
1334
+ "id": {
1335
+ "name": "id",
1336
+ "type": "serial",
1337
+ "primaryKey": true,
1338
+ "notNull": true
1339
+ },
1340
+ "code": {
1341
+ "name": "code",
1342
+ "type": "status_code",
1343
+ "typeSchema": "router_v1.13",
1344
+ "primaryKey": false,
1345
+ "notNull": false
1346
+ }
1347
+ },
1348
+ "indexes": {},
1349
+ "foreignKeys": {},
1350
+ "compositePrimaryKeys": {},
1351
+ "uniqueConstraints": {
1352
+ "status_code_unique": {
1353
+ "name": "status_code_unique",
1354
+ "nullsNotDistinct": false,
1355
+ "columns": ["code"]
1356
+ }
1357
+ },
1358
+ "policies": {},
1359
+ "checkConstraints": {},
1360
+ "isRLSEnabled": false
1361
+ },
1362
+ "router_v1.13.transfers": {
1363
+ "name": "transfers",
1364
+ "schema": "router_v1.13",
1365
+ "columns": {
1366
+ "event_id": {
1367
+ "name": "event_id",
1368
+ "type": "varchar(128)",
1369
+ "primaryKey": true,
1370
+ "notNull": true
1371
+ },
1372
+ "chain_id": {
1373
+ "name": "chain_id",
1374
+ "type": "bigint",
1375
+ "primaryKey": false,
1376
+ "notNull": true
1377
+ },
1378
+ "contract": {
1379
+ "name": "contract",
1380
+ "type": "varchar(66)",
1381
+ "primaryKey": false,
1382
+ "notNull": true
1383
+ },
1384
+ "from": {
1385
+ "name": "from",
1386
+ "type": "varchar(42)",
1387
+ "primaryKey": false,
1388
+ "notNull": true
1389
+ },
1390
+ "to": {
1391
+ "name": "to",
1392
+ "type": "varchar(42)",
1393
+ "primaryKey": false,
1394
+ "notNull": true
1395
+ },
1396
+ "value": {
1397
+ "name": "value",
1398
+ "type": "numeric(78, 0)",
1399
+ "primaryKey": false,
1400
+ "notNull": true
1401
+ },
1402
+ "position_type_id": {
1403
+ "name": "position_type_id",
1404
+ "type": "integer",
1405
+ "primaryKey": false,
1406
+ "notNull": true
1407
+ },
1408
+ "asset": {
1409
+ "name": "asset",
1410
+ "type": "varchar(42)",
1411
+ "primaryKey": false,
1412
+ "notNull": true
1413
+ },
1414
+ "block_number": {
1415
+ "name": "block_number",
1416
+ "type": "bigint",
1417
+ "primaryKey": false,
1418
+ "notNull": true
1419
+ },
1420
+ "created_at": {
1421
+ "name": "created_at",
1422
+ "type": "timestamp",
1423
+ "primaryKey": false,
1424
+ "notNull": true,
1425
+ "default": "now()"
1426
+ }
1427
+ },
1428
+ "indexes": {
1429
+ "transfers_chain_contract_user_idx": {
1430
+ "name": "transfers_chain_contract_user_idx",
1431
+ "columns": [
1432
+ {
1433
+ "expression": "chain_id",
1434
+ "isExpression": false,
1435
+ "asc": true,
1436
+ "nulls": "last"
1437
+ },
1438
+ {
1439
+ "expression": "contract",
1440
+ "isExpression": false,
1441
+ "asc": true,
1442
+ "nulls": "last"
1443
+ },
1444
+ {
1445
+ "expression": "from",
1446
+ "isExpression": false,
1447
+ "asc": true,
1448
+ "nulls": "last"
1449
+ },
1450
+ {
1451
+ "expression": "to",
1452
+ "isExpression": false,
1453
+ "asc": true,
1454
+ "nulls": "last"
1455
+ },
1456
+ {
1457
+ "expression": "block_number",
1458
+ "isExpression": false,
1459
+ "asc": true,
1460
+ "nulls": "last"
1461
+ }
1462
+ ],
1463
+ "isUnique": false,
1464
+ "concurrently": false,
1465
+ "method": "btree",
1466
+ "with": {}
1467
+ },
1468
+ "transfers_chain_type_block_idx": {
1469
+ "name": "transfers_chain_type_block_idx",
1470
+ "columns": [
1471
+ {
1472
+ "expression": "chain_id",
1473
+ "isExpression": false,
1474
+ "asc": true,
1475
+ "nulls": "last"
1476
+ },
1477
+ {
1478
+ "expression": "position_type_id",
1479
+ "isExpression": false,
1480
+ "asc": true,
1481
+ "nulls": "last"
1482
+ },
1483
+ {
1484
+ "expression": "block_number",
1485
+ "isExpression": false,
1486
+ "asc": true,
1487
+ "nulls": "last"
1488
+ }
1489
+ ],
1490
+ "isUnique": false,
1491
+ "concurrently": false,
1492
+ "method": "btree",
1493
+ "with": {}
1494
+ }
1495
+ },
1496
+ "foreignKeys": {
1497
+ "transfers_position_type_id_position_types_id_fk": {
1498
+ "name": "transfers_position_type_id_position_types_id_fk",
1499
+ "tableFrom": "transfers",
1500
+ "tableTo": "position_types",
1501
+ "schemaTo": "router_v1.13",
1502
+ "columnsFrom": ["position_type_id"],
1503
+ "columnsTo": ["id"],
1504
+ "onDelete": "no action",
1505
+ "onUpdate": "no action"
1506
+ },
1507
+ "transfers_positions_from_fk": {
1508
+ "name": "transfers_positions_from_fk",
1509
+ "tableFrom": "transfers",
1510
+ "tableTo": "positions",
1511
+ "schemaTo": "router_v1.13",
1512
+ "columnsFrom": ["chain_id", "contract", "from", "position_type_id", "asset"],
1513
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1514
+ "onDelete": "cascade",
1515
+ "onUpdate": "no action"
1516
+ },
1517
+ "transfers_positions_to_fk": {
1518
+ "name": "transfers_positions_to_fk",
1519
+ "tableFrom": "transfers",
1520
+ "tableTo": "positions",
1521
+ "schemaTo": "router_v1.13",
1522
+ "columnsFrom": ["chain_id", "contract", "to", "position_type_id", "asset"],
1523
+ "columnsTo": ["chain_id", "contract", "user", "position_type_id", "asset"],
1524
+ "onDelete": "cascade",
1525
+ "onUpdate": "no action"
1526
+ }
1527
+ },
1528
+ "compositePrimaryKeys": {},
1529
+ "uniqueConstraints": {},
1530
+ "policies": {},
1531
+ "checkConstraints": {},
1532
+ "isRLSEnabled": false
1533
+ },
1534
+ "router_v1.13.trees": {
1535
+ "name": "trees",
1536
+ "schema": "router_v1.13",
1537
+ "columns": {
1538
+ "root": {
1539
+ "name": "root",
1540
+ "type": "varchar(66)",
1541
+ "primaryKey": true,
1542
+ "notNull": true
1543
+ },
1544
+ "root_signature": {
1545
+ "name": "root_signature",
1546
+ "type": "varchar(132)",
1547
+ "primaryKey": false,
1548
+ "notNull": true
1549
+ },
1550
+ "created_at": {
1551
+ "name": "created_at",
1552
+ "type": "timestamp",
1553
+ "primaryKey": false,
1554
+ "notNull": true,
1555
+ "default": "now()"
1556
+ }
1557
+ },
1558
+ "indexes": {},
1559
+ "foreignKeys": {},
1560
+ "compositePrimaryKeys": {},
1561
+ "uniqueConstraints": {},
1562
+ "policies": {},
1563
+ "checkConstraints": {},
1564
+ "isRLSEnabled": false
1565
+ },
1566
+ "router_v1.13.validations": {
1567
+ "name": "validations",
1568
+ "schema": "router_v1.13",
1569
+ "columns": {
1570
+ "offer_hash": {
1571
+ "name": "offer_hash",
1572
+ "type": "varchar(66)",
1573
+ "primaryKey": false,
1574
+ "notNull": true
1575
+ },
1576
+ "obligation_id": {
1577
+ "name": "obligation_id",
1578
+ "type": "varchar(42)",
1579
+ "primaryKey": false,
1580
+ "notNull": true
1581
+ },
1582
+ "status_id": {
1583
+ "name": "status_id",
1584
+ "type": "integer",
1585
+ "primaryKey": false,
1586
+ "notNull": true
1587
+ },
1588
+ "updated_at": {
1589
+ "name": "updated_at",
1590
+ "type": "timestamp",
1591
+ "primaryKey": false,
1592
+ "notNull": true,
1593
+ "default": "now()"
1594
+ }
1595
+ },
1596
+ "indexes": {},
1597
+ "foreignKeys": {
1598
+ "validations_status_id_status_id_fk": {
1599
+ "name": "validations_status_id_status_id_fk",
1600
+ "tableFrom": "validations",
1601
+ "tableTo": "status",
1602
+ "schemaTo": "router_v1.13",
1603
+ "columnsFrom": ["status_id"],
1604
+ "columnsTo": ["id"],
1605
+ "onDelete": "no action",
1606
+ "onUpdate": "no action"
1607
+ },
1608
+ "validations_offer_fk": {
1609
+ "name": "validations_offer_fk",
1610
+ "tableFrom": "validations",
1611
+ "tableTo": "offers",
1612
+ "schemaTo": "router_v1.13",
1613
+ "columnsFrom": ["offer_hash", "obligation_id"],
1614
+ "columnsTo": ["hash", "obligation_id"],
1615
+ "onDelete": "cascade",
1616
+ "onUpdate": "no action"
1617
+ }
1618
+ },
1619
+ "compositePrimaryKeys": {
1620
+ "validations_pk": {
1621
+ "name": "validations_pk",
1622
+ "columns": ["offer_hash", "obligation_id"]
1623
+ }
1624
+ },
1625
+ "uniqueConstraints": {},
1626
+ "policies": {},
1627
+ "checkConstraints": {},
1628
+ "isRLSEnabled": false
1629
+ }
1630
+ },
1631
+ "enums": {
1632
+ "router_v1.13.callback_type": {
1633
+ "name": "callback_type",
1634
+ "schema": "router_v1.13",
1635
+ "values": ["empty"]
1636
+ },
1637
+ "router_v1.13.position_type": {
1638
+ "name": "position_type",
1639
+ "schema": "router_v1.13",
1640
+ "values": ["erc20", "vault_v1", "debtOf", "collateralOf"]
1641
+ },
1642
+ "router_v1.13.status_code": {
1643
+ "name": "status_code",
1644
+ "schema": "router_v1.13",
1645
+ "values": ["VALID", "SIMULATION_ERROR"]
1646
+ }
1647
+ },
1648
+ "schemas": {},
1649
+ "sequences": {},
1650
+ "roles": {},
1651
+ "policies": {},
1652
+ "views": {},
1653
+ "_meta": {
1654
+ "columns": {},
1655
+ "schemas": {},
1656
+ "tables": {}
1657
+ }
1658
+ }