@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,2084 @@
1
+ {
2
+ "id": "27f7a050-633e-4b6b-9e88-e0baf9889d16",
3
+ "prevId": "7f7fa1b3-3d09-4c57-a062-0774535e71e8",
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.offers": {
935
+ "name": "offers",
936
+ "schema": "router_v1.6",
937
+ "columns": {
938
+ "hash": {
939
+ "name": "hash",
940
+ "type": "varchar(66)",
941
+ "primaryKey": true,
942
+ "notNull": true
943
+ },
944
+ "obligation_id": {
945
+ "name": "obligation_id",
946
+ "type": "varchar(66)",
947
+ "primaryKey": false,
948
+ "notNull": true
949
+ },
950
+ "offering": {
951
+ "name": "offering",
952
+ "type": "varchar(42)",
953
+ "primaryKey": false,
954
+ "notNull": true
955
+ },
956
+ "assets": {
957
+ "name": "assets",
958
+ "type": "numeric(78, 0)",
959
+ "primaryKey": false,
960
+ "notNull": true
961
+ },
962
+ "rate": {
963
+ "name": "rate",
964
+ "type": "bigint",
965
+ "primaryKey": false,
966
+ "notNull": true
967
+ },
968
+ "maturity": {
969
+ "name": "maturity",
970
+ "type": "integer",
971
+ "primaryKey": false,
972
+ "notNull": true
973
+ },
974
+ "expiry": {
975
+ "name": "expiry",
976
+ "type": "integer",
977
+ "primaryKey": false,
978
+ "notNull": true
979
+ },
980
+ "start": {
981
+ "name": "start",
982
+ "type": "integer",
983
+ "primaryKey": false,
984
+ "notNull": true
985
+ },
986
+ "nonce": {
987
+ "name": "nonce",
988
+ "type": "bigint",
989
+ "primaryKey": false,
990
+ "notNull": true
991
+ },
992
+ "buy": {
993
+ "name": "buy",
994
+ "type": "boolean",
995
+ "primaryKey": false,
996
+ "notNull": true
997
+ },
998
+ "chain_id": {
999
+ "name": "chain_id",
1000
+ "type": "bigint",
1001
+ "primaryKey": false,
1002
+ "notNull": true
1003
+ },
1004
+ "loan_token": {
1005
+ "name": "loan_token",
1006
+ "type": "varchar(42)",
1007
+ "primaryKey": false,
1008
+ "notNull": true
1009
+ },
1010
+ "callback_address": {
1011
+ "name": "callback_address",
1012
+ "type": "varchar(42)",
1013
+ "primaryKey": false,
1014
+ "notNull": true
1015
+ },
1016
+ "callback_data": {
1017
+ "name": "callback_data",
1018
+ "type": "text",
1019
+ "primaryKey": false,
1020
+ "notNull": true
1021
+ },
1022
+ "callback_gas_limit": {
1023
+ "name": "callback_gas_limit",
1024
+ "type": "bigint",
1025
+ "primaryKey": false,
1026
+ "notNull": true
1027
+ },
1028
+ "signature": {
1029
+ "name": "signature",
1030
+ "type": "varchar(132)",
1031
+ "primaryKey": false,
1032
+ "notNull": false
1033
+ },
1034
+ "created_at": {
1035
+ "name": "created_at",
1036
+ "type": "timestamp",
1037
+ "primaryKey": false,
1038
+ "notNull": true,
1039
+ "default": "now()"
1040
+ },
1041
+ "block_number": {
1042
+ "name": "block_number",
1043
+ "type": "bigint",
1044
+ "primaryKey": false,
1045
+ "notNull": true
1046
+ }
1047
+ },
1048
+ "indexes": {
1049
+ "offers_obligation_id_idx": {
1050
+ "name": "offers_obligation_id_idx",
1051
+ "columns": [
1052
+ {
1053
+ "expression": "obligation_id",
1054
+ "isExpression": false,
1055
+ "asc": true,
1056
+ "nulls": "last"
1057
+ }
1058
+ ],
1059
+ "isUnique": false,
1060
+ "concurrently": false,
1061
+ "method": "btree",
1062
+ "with": {}
1063
+ },
1064
+ "offers_offering_idx": {
1065
+ "name": "offers_offering_idx",
1066
+ "columns": [
1067
+ {
1068
+ "expression": "offering",
1069
+ "isExpression": false,
1070
+ "asc": true,
1071
+ "nulls": "last"
1072
+ }
1073
+ ],
1074
+ "isUnique": false,
1075
+ "concurrently": false,
1076
+ "method": "btree",
1077
+ "with": {}
1078
+ },
1079
+ "offers_buy_idx": {
1080
+ "name": "offers_buy_idx",
1081
+ "columns": [
1082
+ {
1083
+ "expression": "buy",
1084
+ "isExpression": false,
1085
+ "asc": true,
1086
+ "nulls": "last"
1087
+ }
1088
+ ],
1089
+ "isUnique": false,
1090
+ "concurrently": false,
1091
+ "method": "btree",
1092
+ "with": {}
1093
+ },
1094
+ "offers_chain_id_idx": {
1095
+ "name": "offers_chain_id_idx",
1096
+ "columns": [
1097
+ {
1098
+ "expression": "chain_id",
1099
+ "isExpression": false,
1100
+ "asc": true,
1101
+ "nulls": "last"
1102
+ }
1103
+ ],
1104
+ "isUnique": false,
1105
+ "concurrently": false,
1106
+ "method": "btree",
1107
+ "with": {}
1108
+ },
1109
+ "offers_loan_token_idx": {
1110
+ "name": "offers_loan_token_idx",
1111
+ "columns": [
1112
+ {
1113
+ "expression": "loan_token",
1114
+ "isExpression": false,
1115
+ "asc": true,
1116
+ "nulls": "last"
1117
+ }
1118
+ ],
1119
+ "isUnique": false,
1120
+ "concurrently": false,
1121
+ "method": "btree",
1122
+ "with": {}
1123
+ },
1124
+ "offers_maturity_idx": {
1125
+ "name": "offers_maturity_idx",
1126
+ "columns": [
1127
+ {
1128
+ "expression": "maturity",
1129
+ "isExpression": false,
1130
+ "asc": true,
1131
+ "nulls": "last"
1132
+ }
1133
+ ],
1134
+ "isUnique": false,
1135
+ "concurrently": false,
1136
+ "method": "btree",
1137
+ "with": {}
1138
+ },
1139
+ "offers_expiry_idx": {
1140
+ "name": "offers_expiry_idx",
1141
+ "columns": [
1142
+ {
1143
+ "expression": "expiry",
1144
+ "isExpression": false,
1145
+ "asc": true,
1146
+ "nulls": "last"
1147
+ }
1148
+ ],
1149
+ "isUnique": false,
1150
+ "concurrently": false,
1151
+ "method": "btree",
1152
+ "with": {}
1153
+ },
1154
+ "offers_rate_idx": {
1155
+ "name": "offers_rate_idx",
1156
+ "columns": [
1157
+ {
1158
+ "expression": "rate",
1159
+ "isExpression": false,
1160
+ "asc": true,
1161
+ "nulls": "last"
1162
+ }
1163
+ ],
1164
+ "isUnique": false,
1165
+ "concurrently": false,
1166
+ "method": "btree",
1167
+ "with": {}
1168
+ },
1169
+ "offers_assets_idx": {
1170
+ "name": "offers_assets_idx",
1171
+ "columns": [
1172
+ {
1173
+ "expression": "assets",
1174
+ "isExpression": false,
1175
+ "asc": true,
1176
+ "nulls": "last"
1177
+ }
1178
+ ],
1179
+ "isUnique": false,
1180
+ "concurrently": false,
1181
+ "method": "btree",
1182
+ "with": {}
1183
+ },
1184
+ "offers_created_at_idx": {
1185
+ "name": "offers_created_at_idx",
1186
+ "columns": [
1187
+ {
1188
+ "expression": "created_at",
1189
+ "isExpression": false,
1190
+ "asc": true,
1191
+ "nulls": "last"
1192
+ }
1193
+ ],
1194
+ "isUnique": false,
1195
+ "concurrently": false,
1196
+ "method": "btree",
1197
+ "with": {}
1198
+ },
1199
+ "offers_block_number_idx": {
1200
+ "name": "offers_block_number_idx",
1201
+ "columns": [
1202
+ {
1203
+ "expression": "block_number",
1204
+ "isExpression": false,
1205
+ "asc": true,
1206
+ "nulls": "last"
1207
+ }
1208
+ ],
1209
+ "isUnique": false,
1210
+ "concurrently": false,
1211
+ "method": "btree",
1212
+ "with": {}
1213
+ },
1214
+ "offers_rate_hash_idx": {
1215
+ "name": "offers_rate_hash_idx",
1216
+ "columns": [
1217
+ {
1218
+ "expression": "rate",
1219
+ "isExpression": false,
1220
+ "asc": true,
1221
+ "nulls": "last"
1222
+ },
1223
+ {
1224
+ "expression": "hash",
1225
+ "isExpression": false,
1226
+ "asc": true,
1227
+ "nulls": "last"
1228
+ }
1229
+ ],
1230
+ "isUnique": false,
1231
+ "concurrently": false,
1232
+ "method": "btree",
1233
+ "with": {}
1234
+ },
1235
+ "offers_maturity_hash_idx": {
1236
+ "name": "offers_maturity_hash_idx",
1237
+ "columns": [
1238
+ {
1239
+ "expression": "maturity",
1240
+ "isExpression": false,
1241
+ "asc": true,
1242
+ "nulls": "last"
1243
+ },
1244
+ {
1245
+ "expression": "hash",
1246
+ "isExpression": false,
1247
+ "asc": true,
1248
+ "nulls": "last"
1249
+ }
1250
+ ],
1251
+ "isUnique": false,
1252
+ "concurrently": false,
1253
+ "method": "btree",
1254
+ "with": {}
1255
+ },
1256
+ "offers_expiry_hash_idx": {
1257
+ "name": "offers_expiry_hash_idx",
1258
+ "columns": [
1259
+ {
1260
+ "expression": "expiry",
1261
+ "isExpression": false,
1262
+ "asc": true,
1263
+ "nulls": "last"
1264
+ },
1265
+ {
1266
+ "expression": "hash",
1267
+ "isExpression": false,
1268
+ "asc": true,
1269
+ "nulls": "last"
1270
+ }
1271
+ ],
1272
+ "isUnique": false,
1273
+ "concurrently": false,
1274
+ "method": "btree",
1275
+ "with": {}
1276
+ },
1277
+ "offers_assets_hash_idx": {
1278
+ "name": "offers_assets_hash_idx",
1279
+ "columns": [
1280
+ {
1281
+ "expression": "assets",
1282
+ "isExpression": false,
1283
+ "asc": true,
1284
+ "nulls": "last"
1285
+ },
1286
+ {
1287
+ "expression": "hash",
1288
+ "isExpression": false,
1289
+ "asc": true,
1290
+ "nulls": "last"
1291
+ }
1292
+ ],
1293
+ "isUnique": false,
1294
+ "concurrently": false,
1295
+ "method": "btree",
1296
+ "with": {}
1297
+ },
1298
+ "offers_rate_created_at_assets_hash_idx": {
1299
+ "name": "offers_rate_created_at_assets_hash_idx",
1300
+ "columns": [
1301
+ {
1302
+ "expression": "rate",
1303
+ "isExpression": false,
1304
+ "asc": true,
1305
+ "nulls": "last"
1306
+ },
1307
+ {
1308
+ "expression": "\"created_at\" asc",
1309
+ "asc": true,
1310
+ "isExpression": true,
1311
+ "nulls": "last"
1312
+ },
1313
+ {
1314
+ "expression": "\"assets\" desc",
1315
+ "asc": true,
1316
+ "isExpression": true,
1317
+ "nulls": "last"
1318
+ },
1319
+ {
1320
+ "expression": "\"hash\" asc",
1321
+ "asc": true,
1322
+ "isExpression": true,
1323
+ "nulls": "last"
1324
+ }
1325
+ ],
1326
+ "isUnique": false,
1327
+ "concurrently": false,
1328
+ "method": "btree",
1329
+ "with": {}
1330
+ }
1331
+ },
1332
+ "foreignKeys": {
1333
+ "offers_obligation_id_obligations_obligation_id_fk": {
1334
+ "name": "offers_obligation_id_obligations_obligation_id_fk",
1335
+ "tableFrom": "offers",
1336
+ "tableTo": "obligations",
1337
+ "schemaTo": "router_v1.6",
1338
+ "columnsFrom": ["obligation_id"],
1339
+ "columnsTo": ["obligation_id"],
1340
+ "onDelete": "cascade",
1341
+ "onUpdate": "no action"
1342
+ }
1343
+ },
1344
+ "compositePrimaryKeys": {},
1345
+ "uniqueConstraints": {},
1346
+ "policies": {},
1347
+ "checkConstraints": {},
1348
+ "isRLSEnabled": false
1349
+ },
1350
+ "router_v1.6.offers_callbacks": {
1351
+ "name": "offers_callbacks",
1352
+ "schema": "router_v1.6",
1353
+ "columns": {
1354
+ "offer_hash": {
1355
+ "name": "offer_hash",
1356
+ "type": "varchar(66)",
1357
+ "primaryKey": false,
1358
+ "notNull": true
1359
+ },
1360
+ "callback_id": {
1361
+ "name": "callback_id",
1362
+ "type": "varchar(66)",
1363
+ "primaryKey": false,
1364
+ "notNull": false
1365
+ }
1366
+ },
1367
+ "indexes": {},
1368
+ "foreignKeys": {
1369
+ "offers_callbacks_offer_hash_offers_v2_hash_fk": {
1370
+ "name": "offers_callbacks_offer_hash_offers_v2_hash_fk",
1371
+ "tableFrom": "offers_callbacks",
1372
+ "tableTo": "offers_v2",
1373
+ "schemaTo": "router_v1.6",
1374
+ "columnsFrom": ["offer_hash"],
1375
+ "columnsTo": ["hash"],
1376
+ "onDelete": "cascade",
1377
+ "onUpdate": "no action"
1378
+ }
1379
+ },
1380
+ "compositePrimaryKeys": {
1381
+ "offers_callbacks_pk": {
1382
+ "name": "offers_callbacks_pk",
1383
+ "columns": ["offer_hash", "callback_id"]
1384
+ }
1385
+ },
1386
+ "uniqueConstraints": {},
1387
+ "policies": {},
1388
+ "checkConstraints": {},
1389
+ "isRLSEnabled": false
1390
+ },
1391
+ "router_v1.6.offers_v2": {
1392
+ "name": "offers_v2",
1393
+ "schema": "router_v1.6",
1394
+ "columns": {
1395
+ "hash": {
1396
+ "name": "hash",
1397
+ "type": "varchar(66)",
1398
+ "primaryKey": true,
1399
+ "notNull": true
1400
+ },
1401
+ "obligation_id": {
1402
+ "name": "obligation_id",
1403
+ "type": "varchar(66)",
1404
+ "primaryKey": false,
1405
+ "notNull": true
1406
+ },
1407
+ "assets": {
1408
+ "name": "assets",
1409
+ "type": "numeric(78, 0)",
1410
+ "primaryKey": false,
1411
+ "notNull": true
1412
+ },
1413
+ "rate": {
1414
+ "name": "rate",
1415
+ "type": "numeric(78, 0)",
1416
+ "primaryKey": false,
1417
+ "notNull": true
1418
+ },
1419
+ "maturity": {
1420
+ "name": "maturity",
1421
+ "type": "integer",
1422
+ "primaryKey": false,
1423
+ "notNull": true
1424
+ },
1425
+ "expiry": {
1426
+ "name": "expiry",
1427
+ "type": "integer",
1428
+ "primaryKey": false,
1429
+ "notNull": true
1430
+ },
1431
+ "start": {
1432
+ "name": "start",
1433
+ "type": "integer",
1434
+ "primaryKey": false,
1435
+ "notNull": true
1436
+ },
1437
+ "group_chain_id": {
1438
+ "name": "group_chain_id",
1439
+ "type": "bigint",
1440
+ "primaryKey": false,
1441
+ "notNull": true
1442
+ },
1443
+ "group_maker": {
1444
+ "name": "group_maker",
1445
+ "type": "varchar(42)",
1446
+ "primaryKey": false,
1447
+ "notNull": true
1448
+ },
1449
+ "group_group": {
1450
+ "name": "group_group",
1451
+ "type": "varchar(66)",
1452
+ "primaryKey": false,
1453
+ "notNull": true
1454
+ },
1455
+ "nonce": {
1456
+ "name": "nonce",
1457
+ "type": "varchar(66)",
1458
+ "primaryKey": false,
1459
+ "notNull": true
1460
+ },
1461
+ "buy": {
1462
+ "name": "buy",
1463
+ "type": "boolean",
1464
+ "primaryKey": false,
1465
+ "notNull": true
1466
+ },
1467
+ "callback_address": {
1468
+ "name": "callback_address",
1469
+ "type": "varchar(42)",
1470
+ "primaryKey": false,
1471
+ "notNull": true
1472
+ },
1473
+ "callback_data": {
1474
+ "name": "callback_data",
1475
+ "type": "text",
1476
+ "primaryKey": false,
1477
+ "notNull": true
1478
+ },
1479
+ "block_number": {
1480
+ "name": "block_number",
1481
+ "type": "bigint",
1482
+ "primaryKey": false,
1483
+ "notNull": true
1484
+ },
1485
+ "updated_at": {
1486
+ "name": "updated_at",
1487
+ "type": "timestamp",
1488
+ "primaryKey": false,
1489
+ "notNull": true,
1490
+ "default": "now()"
1491
+ }
1492
+ },
1493
+ "indexes": {
1494
+ "offers_v2_group_fk_idx": {
1495
+ "name": "offers_v2_group_fk_idx",
1496
+ "columns": [
1497
+ {
1498
+ "expression": "group_chain_id",
1499
+ "isExpression": false,
1500
+ "asc": true,
1501
+ "nulls": "last"
1502
+ },
1503
+ {
1504
+ "expression": "group_maker",
1505
+ "isExpression": false,
1506
+ "asc": true,
1507
+ "nulls": "last"
1508
+ },
1509
+ {
1510
+ "expression": "group_group",
1511
+ "isExpression": false,
1512
+ "asc": true,
1513
+ "nulls": "last"
1514
+ }
1515
+ ],
1516
+ "isUnique": false,
1517
+ "concurrently": false,
1518
+ "method": "btree",
1519
+ "with": {}
1520
+ },
1521
+ "offers_v2_group_and_hash_idx": {
1522
+ "name": "offers_v2_group_and_hash_idx",
1523
+ "columns": [
1524
+ {
1525
+ "expression": "group_chain_id",
1526
+ "isExpression": false,
1527
+ "asc": true,
1528
+ "nulls": "last"
1529
+ },
1530
+ {
1531
+ "expression": "group_maker",
1532
+ "isExpression": false,
1533
+ "asc": true,
1534
+ "nulls": "last"
1535
+ },
1536
+ {
1537
+ "expression": "group_group",
1538
+ "isExpression": false,
1539
+ "asc": true,
1540
+ "nulls": "last"
1541
+ },
1542
+ {
1543
+ "expression": "hash",
1544
+ "isExpression": false,
1545
+ "asc": true,
1546
+ "nulls": "last"
1547
+ }
1548
+ ],
1549
+ "isUnique": false,
1550
+ "concurrently": false,
1551
+ "method": "btree",
1552
+ "with": {}
1553
+ },
1554
+ "offers_v2_group_winner_sell_side_idx": {
1555
+ "name": "offers_v2_group_winner_sell_side_idx",
1556
+ "columns": [
1557
+ {
1558
+ "expression": "group_chain_id",
1559
+ "isExpression": false,
1560
+ "asc": true,
1561
+ "nulls": "last"
1562
+ },
1563
+ {
1564
+ "expression": "group_maker",
1565
+ "isExpression": false,
1566
+ "asc": true,
1567
+ "nulls": "last"
1568
+ },
1569
+ {
1570
+ "expression": "group_group",
1571
+ "isExpression": false,
1572
+ "asc": true,
1573
+ "nulls": "last"
1574
+ },
1575
+ {
1576
+ "expression": "\"rate\" desc",
1577
+ "asc": true,
1578
+ "isExpression": true,
1579
+ "nulls": "last"
1580
+ },
1581
+ {
1582
+ "expression": "\"block_number\" asc",
1583
+ "asc": true,
1584
+ "isExpression": true,
1585
+ "nulls": "last"
1586
+ },
1587
+ {
1588
+ "expression": "\"assets\" desc",
1589
+ "asc": true,
1590
+ "isExpression": true,
1591
+ "nulls": "last"
1592
+ },
1593
+ {
1594
+ "expression": "\"hash\" asc",
1595
+ "asc": true,
1596
+ "isExpression": true,
1597
+ "nulls": "last"
1598
+ }
1599
+ ],
1600
+ "isUnique": false,
1601
+ "concurrently": false,
1602
+ "method": "btree",
1603
+ "with": {}
1604
+ },
1605
+ "offers_v2_group_winner_buy_side_idx": {
1606
+ "name": "offers_v2_group_winner_buy_side_idx",
1607
+ "columns": [
1608
+ {
1609
+ "expression": "group_chain_id",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ },
1614
+ {
1615
+ "expression": "group_maker",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ },
1620
+ {
1621
+ "expression": "group_group",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ },
1626
+ {
1627
+ "expression": "\"rate\" asc",
1628
+ "asc": true,
1629
+ "isExpression": true,
1630
+ "nulls": "last"
1631
+ },
1632
+ {
1633
+ "expression": "\"block_number\" asc",
1634
+ "asc": true,
1635
+ "isExpression": true,
1636
+ "nulls": "last"
1637
+ },
1638
+ {
1639
+ "expression": "\"assets\" desc",
1640
+ "asc": true,
1641
+ "isExpression": true,
1642
+ "nulls": "last"
1643
+ },
1644
+ {
1645
+ "expression": "\"hash\" asc",
1646
+ "asc": true,
1647
+ "isExpression": true,
1648
+ "nulls": "last"
1649
+ }
1650
+ ],
1651
+ "isUnique": false,
1652
+ "concurrently": false,
1653
+ "method": "btree",
1654
+ "with": {}
1655
+ },
1656
+ "offers_v2_obligation_id_side_idx": {
1657
+ "name": "offers_v2_obligation_id_side_idx",
1658
+ "columns": [
1659
+ {
1660
+ "expression": "obligation_id",
1661
+ "isExpression": false,
1662
+ "asc": true,
1663
+ "nulls": "last"
1664
+ },
1665
+ {
1666
+ "expression": "buy",
1667
+ "isExpression": false,
1668
+ "asc": true,
1669
+ "nulls": "last"
1670
+ }
1671
+ ],
1672
+ "isUnique": false,
1673
+ "concurrently": false,
1674
+ "method": "btree",
1675
+ "with": {}
1676
+ }
1677
+ },
1678
+ "foreignKeys": {
1679
+ "offers_v2_obligation_id_obligations_obligation_id_fk": {
1680
+ "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
1681
+ "tableFrom": "offers_v2",
1682
+ "tableTo": "obligations",
1683
+ "schemaTo": "router_v1.6",
1684
+ "columnsFrom": ["obligation_id"],
1685
+ "columnsTo": ["obligation_id"],
1686
+ "onDelete": "cascade",
1687
+ "onUpdate": "no action"
1688
+ },
1689
+ "offers_v2_groups_fk": {
1690
+ "name": "offers_v2_groups_fk",
1691
+ "tableFrom": "offers_v2",
1692
+ "tableTo": "groups",
1693
+ "schemaTo": "router_v1.6",
1694
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1695
+ "columnsTo": ["chain_id", "maker", "group"],
1696
+ "onDelete": "cascade",
1697
+ "onUpdate": "no action"
1698
+ }
1699
+ },
1700
+ "compositePrimaryKeys": {},
1701
+ "uniqueConstraints": {},
1702
+ "policies": {},
1703
+ "checkConstraints": {},
1704
+ "isRLSEnabled": false
1705
+ },
1706
+ "router_v1.6.oracles": {
1707
+ "name": "oracles",
1708
+ "schema": "router_v1.6",
1709
+ "columns": {
1710
+ "chain_id": {
1711
+ "name": "chain_id",
1712
+ "type": "bigint",
1713
+ "primaryKey": false,
1714
+ "notNull": true
1715
+ },
1716
+ "address": {
1717
+ "name": "address",
1718
+ "type": "varchar(42)",
1719
+ "primaryKey": false,
1720
+ "notNull": true
1721
+ },
1722
+ "price": {
1723
+ "name": "price",
1724
+ "type": "numeric(78, 0)",
1725
+ "primaryKey": false,
1726
+ "notNull": false
1727
+ },
1728
+ "block_number": {
1729
+ "name": "block_number",
1730
+ "type": "bigint",
1731
+ "primaryKey": false,
1732
+ "notNull": true
1733
+ },
1734
+ "updated_at": {
1735
+ "name": "updated_at",
1736
+ "type": "timestamp",
1737
+ "primaryKey": false,
1738
+ "notNull": true,
1739
+ "default": "now()"
1740
+ }
1741
+ },
1742
+ "indexes": {},
1743
+ "foreignKeys": {},
1744
+ "compositePrimaryKeys": {
1745
+ "oracles_pk": {
1746
+ "name": "oracles_pk",
1747
+ "columns": ["chain_id", "address"]
1748
+ }
1749
+ },
1750
+ "uniqueConstraints": {},
1751
+ "policies": {},
1752
+ "checkConstraints": {},
1753
+ "isRLSEnabled": false
1754
+ },
1755
+ "router_v1.6.position_types": {
1756
+ "name": "position_types",
1757
+ "schema": "router_v1.6",
1758
+ "columns": {
1759
+ "id": {
1760
+ "name": "id",
1761
+ "type": "serial",
1762
+ "primaryKey": true,
1763
+ "notNull": true
1764
+ },
1765
+ "type": {
1766
+ "name": "type",
1767
+ "type": "position_type",
1768
+ "typeSchema": "router_v1.6",
1769
+ "primaryKey": false,
1770
+ "notNull": true
1771
+ }
1772
+ },
1773
+ "indexes": {},
1774
+ "foreignKeys": {},
1775
+ "compositePrimaryKeys": {},
1776
+ "uniqueConstraints": {},
1777
+ "policies": {},
1778
+ "checkConstraints": {},
1779
+ "isRLSEnabled": false
1780
+ },
1781
+ "router_v1.6.positions": {
1782
+ "name": "positions",
1783
+ "schema": "router_v1.6",
1784
+ "columns": {
1785
+ "chain_id": {
1786
+ "name": "chain_id",
1787
+ "type": "bigint",
1788
+ "primaryKey": false,
1789
+ "notNull": true
1790
+ },
1791
+ "contract": {
1792
+ "name": "contract",
1793
+ "type": "varchar(42)",
1794
+ "primaryKey": false,
1795
+ "notNull": true
1796
+ },
1797
+ "user": {
1798
+ "name": "user",
1799
+ "type": "varchar(42)",
1800
+ "primaryKey": false,
1801
+ "notNull": true
1802
+ },
1803
+ "position_type_id": {
1804
+ "name": "position_type_id",
1805
+ "type": "integer",
1806
+ "primaryKey": false,
1807
+ "notNull": true
1808
+ },
1809
+ "balance": {
1810
+ "name": "balance",
1811
+ "type": "numeric(78, 0)",
1812
+ "primaryKey": false,
1813
+ "notNull": false
1814
+ },
1815
+ "block_number": {
1816
+ "name": "block_number",
1817
+ "type": "bigint",
1818
+ "primaryKey": false,
1819
+ "notNull": true
1820
+ },
1821
+ "updated_at": {
1822
+ "name": "updated_at",
1823
+ "type": "timestamp",
1824
+ "primaryKey": false,
1825
+ "notNull": true,
1826
+ "default": "now()"
1827
+ }
1828
+ },
1829
+ "indexes": {},
1830
+ "foreignKeys": {
1831
+ "positions_position_type_id_position_types_id_fk": {
1832
+ "name": "positions_position_type_id_position_types_id_fk",
1833
+ "tableFrom": "positions",
1834
+ "tableTo": "position_types",
1835
+ "schemaTo": "router_v1.6",
1836
+ "columnsFrom": ["position_type_id"],
1837
+ "columnsTo": ["id"],
1838
+ "onDelete": "no action",
1839
+ "onUpdate": "no action"
1840
+ }
1841
+ },
1842
+ "compositePrimaryKeys": {
1843
+ "positions_pk": {
1844
+ "name": "positions_pk",
1845
+ "columns": ["chain_id", "contract", "user"]
1846
+ }
1847
+ },
1848
+ "uniqueConstraints": {},
1849
+ "policies": {},
1850
+ "checkConstraints": {},
1851
+ "isRLSEnabled": false
1852
+ },
1853
+ "router_v1.6.status": {
1854
+ "name": "status",
1855
+ "schema": "router_v1.6",
1856
+ "columns": {
1857
+ "id": {
1858
+ "name": "id",
1859
+ "type": "serial",
1860
+ "primaryKey": true,
1861
+ "notNull": true
1862
+ },
1863
+ "code": {
1864
+ "name": "code",
1865
+ "type": "status_code",
1866
+ "typeSchema": "router_v1.6",
1867
+ "primaryKey": false,
1868
+ "notNull": false
1869
+ }
1870
+ },
1871
+ "indexes": {},
1872
+ "foreignKeys": {},
1873
+ "compositePrimaryKeys": {},
1874
+ "uniqueConstraints": {
1875
+ "status_code_unique": {
1876
+ "name": "status_code_unique",
1877
+ "nullsNotDistinct": false,
1878
+ "columns": ["code"]
1879
+ }
1880
+ },
1881
+ "policies": {},
1882
+ "checkConstraints": {},
1883
+ "isRLSEnabled": false
1884
+ },
1885
+ "router_v1.6.transfers": {
1886
+ "name": "transfers",
1887
+ "schema": "router_v1.6",
1888
+ "columns": {
1889
+ "event_id": {
1890
+ "name": "event_id",
1891
+ "type": "varchar(128)",
1892
+ "primaryKey": true,
1893
+ "notNull": true
1894
+ },
1895
+ "chain_id": {
1896
+ "name": "chain_id",
1897
+ "type": "bigint",
1898
+ "primaryKey": false,
1899
+ "notNull": true
1900
+ },
1901
+ "contract": {
1902
+ "name": "contract",
1903
+ "type": "varchar(42)",
1904
+ "primaryKey": false,
1905
+ "notNull": true
1906
+ },
1907
+ "from": {
1908
+ "name": "from",
1909
+ "type": "varchar(42)",
1910
+ "primaryKey": false,
1911
+ "notNull": true
1912
+ },
1913
+ "to": {
1914
+ "name": "to",
1915
+ "type": "varchar(42)",
1916
+ "primaryKey": false,
1917
+ "notNull": true
1918
+ },
1919
+ "value": {
1920
+ "name": "value",
1921
+ "type": "numeric(78, 0)",
1922
+ "primaryKey": false,
1923
+ "notNull": true
1924
+ },
1925
+ "block_number": {
1926
+ "name": "block_number",
1927
+ "type": "bigint",
1928
+ "primaryKey": false,
1929
+ "notNull": true
1930
+ },
1931
+ "created_at": {
1932
+ "name": "created_at",
1933
+ "type": "timestamp",
1934
+ "primaryKey": false,
1935
+ "notNull": true,
1936
+ "default": "now()"
1937
+ }
1938
+ },
1939
+ "indexes": {
1940
+ "transfers_chain_contract_user_idx": {
1941
+ "name": "transfers_chain_contract_user_idx",
1942
+ "columns": [
1943
+ {
1944
+ "expression": "chain_id",
1945
+ "isExpression": false,
1946
+ "asc": true,
1947
+ "nulls": "last"
1948
+ },
1949
+ {
1950
+ "expression": "contract",
1951
+ "isExpression": false,
1952
+ "asc": true,
1953
+ "nulls": "last"
1954
+ },
1955
+ {
1956
+ "expression": "from",
1957
+ "isExpression": false,
1958
+ "asc": true,
1959
+ "nulls": "last"
1960
+ },
1961
+ {
1962
+ "expression": "to",
1963
+ "isExpression": false,
1964
+ "asc": true,
1965
+ "nulls": "last"
1966
+ },
1967
+ {
1968
+ "expression": "block_number",
1969
+ "isExpression": false,
1970
+ "asc": true,
1971
+ "nulls": "last"
1972
+ }
1973
+ ],
1974
+ "isUnique": false,
1975
+ "concurrently": false,
1976
+ "method": "btree",
1977
+ "with": {}
1978
+ }
1979
+ },
1980
+ "foreignKeys": {
1981
+ "transfers_positions_from_fk": {
1982
+ "name": "transfers_positions_from_fk",
1983
+ "tableFrom": "transfers",
1984
+ "tableTo": "positions",
1985
+ "schemaTo": "router_v1.6",
1986
+ "columnsFrom": ["chain_id", "contract", "from"],
1987
+ "columnsTo": ["chain_id", "contract", "user"],
1988
+ "onDelete": "cascade",
1989
+ "onUpdate": "no action"
1990
+ },
1991
+ "transfers_positions_to_fk": {
1992
+ "name": "transfers_positions_to_fk",
1993
+ "tableFrom": "transfers",
1994
+ "tableTo": "positions",
1995
+ "schemaTo": "router_v1.6",
1996
+ "columnsFrom": ["chain_id", "contract", "to"],
1997
+ "columnsTo": ["chain_id", "contract", "user"],
1998
+ "onDelete": "cascade",
1999
+ "onUpdate": "no action"
2000
+ }
2001
+ },
2002
+ "compositePrimaryKeys": {},
2003
+ "uniqueConstraints": {},
2004
+ "policies": {},
2005
+ "checkConstraints": {},
2006
+ "isRLSEnabled": false
2007
+ },
2008
+ "router_v1.6.validations": {
2009
+ "name": "validations",
2010
+ "schema": "router_v1.6",
2011
+ "columns": {
2012
+ "offer_hash": {
2013
+ "name": "offer_hash",
2014
+ "type": "varchar(66)",
2015
+ "primaryKey": true,
2016
+ "notNull": true
2017
+ },
2018
+ "status_id": {
2019
+ "name": "status_id",
2020
+ "type": "integer",
2021
+ "primaryKey": false,
2022
+ "notNull": true
2023
+ },
2024
+ "updated_at": {
2025
+ "name": "updated_at",
2026
+ "type": "timestamp",
2027
+ "primaryKey": false,
2028
+ "notNull": true,
2029
+ "default": "now()"
2030
+ }
2031
+ },
2032
+ "indexes": {},
2033
+ "foreignKeys": {
2034
+ "validations_offer_hash_offers_v2_hash_fk": {
2035
+ "name": "validations_offer_hash_offers_v2_hash_fk",
2036
+ "tableFrom": "validations",
2037
+ "tableTo": "offers_v2",
2038
+ "schemaTo": "router_v1.6",
2039
+ "columnsFrom": ["offer_hash"],
2040
+ "columnsTo": ["hash"],
2041
+ "onDelete": "cascade",
2042
+ "onUpdate": "no action"
2043
+ },
2044
+ "validations_status_id_status_id_fk": {
2045
+ "name": "validations_status_id_status_id_fk",
2046
+ "tableFrom": "validations",
2047
+ "tableTo": "status",
2048
+ "schemaTo": "router_v1.6",
2049
+ "columnsFrom": ["status_id"],
2050
+ "columnsTo": ["id"],
2051
+ "onDelete": "no action",
2052
+ "onUpdate": "no action"
2053
+ }
2054
+ },
2055
+ "compositePrimaryKeys": {},
2056
+ "uniqueConstraints": {},
2057
+ "policies": {},
2058
+ "checkConstraints": {},
2059
+ "isRLSEnabled": false
2060
+ }
2061
+ },
2062
+ "enums": {
2063
+ "router_v1.6.position_type": {
2064
+ "name": "position_type",
2065
+ "schema": "router_v1.6",
2066
+ "values": ["erc20", "vault_v1"]
2067
+ },
2068
+ "router_v1.6.status_code": {
2069
+ "name": "status_code",
2070
+ "schema": "router_v1.6",
2071
+ "values": ["VALID", "SIMULATION_ERROR"]
2072
+ }
2073
+ },
2074
+ "schemas": {},
2075
+ "sequences": {},
2076
+ "roles": {},
2077
+ "policies": {},
2078
+ "views": {},
2079
+ "_meta": {
2080
+ "columns": {},
2081
+ "schemas": {},
2082
+ "tables": {}
2083
+ }
2084
+ }