@morpho-dev/router 0.1.18 → 0.2.1

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