@morpho-dev/router 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +3 -3
  2. package/dist/chunk-jass6xSI.mjs +13 -0
  3. package/dist/cli.js +7202 -7027
  4. package/dist/drizzle/migrations/0000_setup_single_migration_folder.sql +204 -0
  5. package/dist/drizzle/{router_v1.5/0006_add-trigger-for-consumed-events.sql → migrations/0001_add-trigger-for-consumed-events.sql} +6 -6
  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/migrations/0015_add-lots-table.sql +12 -0
  19. package/dist/drizzle/migrations/0016_merkle-metadata.sql +26 -0
  20. package/dist/drizzle/{router_v1.5/meta/0008_snapshot.json → migrations/meta/0000_snapshot.json} +50 -50
  21. package/dist/drizzle/{router_v1.5/meta/0006_snapshot.json → migrations/meta/0001_snapshot.json} +150 -62
  22. package/dist/drizzle/migrations/meta/0002_snapshot.json +1752 -0
  23. package/dist/drizzle/migrations/meta/0003_snapshot.json +1752 -0
  24. package/dist/drizzle/{router_v1.5/meta/0007_snapshot.json → migrations/meta/0004_snapshot.json} +57 -67
  25. package/dist/drizzle/{router_v1.5 → migrations}/meta/0005_snapshot.json +181 -70
  26. package/dist/drizzle/{router_v1.5/meta/0004_snapshot.json → migrations/meta/0006_snapshot.json} +466 -62
  27. package/dist/drizzle/migrations/meta/0008_snapshot.json +1955 -0
  28. package/dist/drizzle/migrations/meta/0009_snapshot.json +2078 -0
  29. package/dist/drizzle/migrations/meta/0010_snapshot.json +2084 -0
  30. package/dist/drizzle/{router_v1.5/meta/0003_snapshot.json → migrations/meta/0013_snapshot.json} +535 -708
  31. package/dist/drizzle/migrations/meta/0014_snapshot.json +1290 -0
  32. package/dist/drizzle/{router_v1.5/meta/0001_snapshot.json → migrations/meta/0015_snapshot.json} +580 -619
  33. package/dist/drizzle/{router_v1.5/meta/0002_snapshot.json → migrations/meta/0016_snapshot.json} +714 -646
  34. package/dist/drizzle/migrations/meta/_journal.json +118 -0
  35. package/dist/index.browser.d.mts +3008 -0
  36. package/dist/index.browser.d.mts.map +1 -0
  37. package/dist/index.browser.d.ts +2418 -1818
  38. package/dist/index.browser.d.ts.map +1 -0
  39. package/dist/index.browser.js +4099 -2890
  40. package/dist/index.browser.js.map +1 -1
  41. package/dist/index.browser.mjs +3903 -2841
  42. package/dist/index.browser.mjs.map +1 -1
  43. package/dist/index.node.d.mts +5657 -0
  44. package/dist/index.node.d.mts.map +1 -0
  45. package/dist/index.node.d.ts +4965 -4426
  46. package/dist/index.node.d.ts.map +1 -0
  47. package/dist/index.node.js +8465 -7154
  48. package/dist/index.node.js.map +1 -1
  49. package/dist/index.node.mjs +8205 -7105
  50. package/dist/index.node.mjs.map +1 -1
  51. package/package.json +16 -7
  52. package/dist/cli.js.map +0 -1
  53. package/dist/drizzle/VERSION.ts +0 -3
  54. package/dist/drizzle/drizzle.config.ts +0 -18
  55. package/dist/drizzle/index.ts +0 -2
  56. package/dist/drizzle/router_v1.5/0000_add_block_number_to_liquidity_graph_and_offer_liquidity_pools_relation.sql +0 -122
  57. package/dist/drizzle/router_v1.5/0001_create_new_relations_to_prepare_new_liquidity_model.sql +0 -55
  58. package/dist/drizzle/router_v1.5/0002_add_new_offer_status_relation.sql +0 -9
  59. package/dist/drizzle/router_v1.5/0003_insert-status-code.sql +0 -1
  60. package/dist/drizzle/router_v1.5/0004_add_index_for_fast_book_lookup.sql +0 -3
  61. package/dist/drizzle/router_v1.5/0005_add_group_consumed_events_table.sql +0 -12
  62. package/dist/drizzle/router_v1.5/0007_update_index_for_fast_book_lookup.sql +0 -5
  63. package/dist/drizzle/router_v1.5/0008_rename_consumed_events_table.sql +0 -8
  64. package/dist/drizzle/router_v1.5/meta/0000_snapshot.json +0 -1028
  65. package/dist/drizzle/router_v1.5/meta/_journal.json +0 -69
  66. package/dist/drizzle/schema.ts +0 -363
  67. package/dist/index.browser.d.cts +0 -2403
  68. package/dist/index.node.d.cts +0 -5119
@@ -0,0 +1,1290 @@
1
+ {
2
+ "id": "4808e28b-98ab-4a0b-a0cb-0cb669f14291",
3
+ "prevId": "338470f8-fb65-4e1b-b42f-8e414a3826f3",
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": false
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_events": {
196
+ "name": "consumed_events",
197
+ "schema": "router_v1.6",
198
+ "columns": {
199
+ "event_id": {
200
+ "name": "event_id",
201
+ "type": "varchar(128)",
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
+ "maker": {
212
+ "name": "maker",
213
+ "type": "varchar(42)",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "group": {
218
+ "name": "group",
219
+ "type": "varchar(66)",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "amount": {
224
+ "name": "amount",
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_events_group_idx": {
245
+ "name": "consumed_events_group_idx",
246
+ "columns": [
247
+ {
248
+ "expression": "chain_id",
249
+ "isExpression": false,
250
+ "asc": true,
251
+ "nulls": "last"
252
+ },
253
+ {
254
+ "expression": "maker",
255
+ "isExpression": false,
256
+ "asc": true,
257
+ "nulls": "last"
258
+ },
259
+ {
260
+ "expression": "group",
261
+ "isExpression": false,
262
+ "asc": true,
263
+ "nulls": "last"
264
+ }
265
+ ],
266
+ "isUnique": false,
267
+ "concurrently": false,
268
+ "method": "btree",
269
+ "with": {}
270
+ },
271
+ "consumed_events_block_number_idx": {
272
+ "name": "consumed_events_block_number_idx",
273
+ "columns": [
274
+ {
275
+ "expression": "block_number",
276
+ "isExpression": false,
277
+ "asc": true,
278
+ "nulls": "last"
279
+ }
280
+ ],
281
+ "isUnique": false,
282
+ "concurrently": false,
283
+ "method": "btree",
284
+ "with": {}
285
+ }
286
+ },
287
+ "foreignKeys": {
288
+ "consumed_events_groups_fk": {
289
+ "name": "consumed_events_groups_fk",
290
+ "tableFrom": "consumed_events",
291
+ "tableTo": "groups",
292
+ "schemaTo": "router_v1.6",
293
+ "columnsFrom": ["chain_id", "maker", "group"],
294
+ "columnsTo": ["chain_id", "maker", "group"],
295
+ "onDelete": "cascade",
296
+ "onUpdate": "no action"
297
+ }
298
+ },
299
+ "compositePrimaryKeys": {},
300
+ "uniqueConstraints": {},
301
+ "policies": {},
302
+ "checkConstraints": {},
303
+ "isRLSEnabled": false
304
+ },
305
+ "router_v1.6.groups": {
306
+ "name": "groups",
307
+ "schema": "router_v1.6",
308
+ "columns": {
309
+ "chain_id": {
310
+ "name": "chain_id",
311
+ "type": "bigint",
312
+ "primaryKey": false,
313
+ "notNull": true
314
+ },
315
+ "maker": {
316
+ "name": "maker",
317
+ "type": "varchar(42)",
318
+ "primaryKey": false,
319
+ "notNull": true
320
+ },
321
+ "group": {
322
+ "name": "group",
323
+ "type": "varchar(66)",
324
+ "primaryKey": false,
325
+ "notNull": true
326
+ },
327
+ "consumed": {
328
+ "name": "consumed",
329
+ "type": "numeric(78, 0)",
330
+ "primaryKey": false,
331
+ "notNull": true
332
+ },
333
+ "block_number": {
334
+ "name": "block_number",
335
+ "type": "bigint",
336
+ "primaryKey": false,
337
+ "notNull": true
338
+ },
339
+ "updated_at": {
340
+ "name": "updated_at",
341
+ "type": "timestamp",
342
+ "primaryKey": false,
343
+ "notNull": true,
344
+ "default": "now()"
345
+ }
346
+ },
347
+ "indexes": {
348
+ "groups_chain_id_maker_group_consumed_idx": {
349
+ "name": "groups_chain_id_maker_group_consumed_idx",
350
+ "columns": [
351
+ {
352
+ "expression": "chain_id",
353
+ "isExpression": false,
354
+ "asc": true,
355
+ "nulls": "last"
356
+ },
357
+ {
358
+ "expression": "maker",
359
+ "isExpression": false,
360
+ "asc": true,
361
+ "nulls": "last"
362
+ },
363
+ {
364
+ "expression": "group",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ },
369
+ {
370
+ "expression": "consumed",
371
+ "isExpression": false,
372
+ "asc": true,
373
+ "nulls": "last"
374
+ }
375
+ ],
376
+ "isUnique": false,
377
+ "concurrently": false,
378
+ "method": "btree",
379
+ "with": {}
380
+ }
381
+ },
382
+ "foreignKeys": {},
383
+ "compositePrimaryKeys": {
384
+ "groups_pk": {
385
+ "name": "groups_pk",
386
+ "columns": ["chain_id", "maker", "group"]
387
+ }
388
+ },
389
+ "uniqueConstraints": {},
390
+ "policies": {},
391
+ "checkConstraints": {},
392
+ "isRLSEnabled": false
393
+ },
394
+ "router_v1.6.obligation_collaterals_v2": {
395
+ "name": "obligation_collaterals_v2",
396
+ "schema": "router_v1.6",
397
+ "columns": {
398
+ "obligation_id": {
399
+ "name": "obligation_id",
400
+ "type": "varchar(66)",
401
+ "primaryKey": false,
402
+ "notNull": true
403
+ },
404
+ "asset": {
405
+ "name": "asset",
406
+ "type": "varchar(42)",
407
+ "primaryKey": false,
408
+ "notNull": true
409
+ },
410
+ "oracle_chain_id": {
411
+ "name": "oracle_chain_id",
412
+ "type": "bigint",
413
+ "primaryKey": false,
414
+ "notNull": true
415
+ },
416
+ "oracle_address": {
417
+ "name": "oracle_address",
418
+ "type": "varchar(42)",
419
+ "primaryKey": false,
420
+ "notNull": true
421
+ },
422
+ "lltv": {
423
+ "name": "lltv",
424
+ "type": "bigint",
425
+ "primaryKey": false,
426
+ "notNull": true
427
+ },
428
+ "block_number": {
429
+ "name": "block_number",
430
+ "type": "bigint",
431
+ "primaryKey": false,
432
+ "notNull": true
433
+ },
434
+ "updated_at": {
435
+ "name": "updated_at",
436
+ "type": "timestamp",
437
+ "primaryKey": false,
438
+ "notNull": true,
439
+ "default": "now()"
440
+ }
441
+ },
442
+ "indexes": {
443
+ "obligation_collaterals_v2_obligation_id_idx": {
444
+ "name": "obligation_collaterals_v2_obligation_id_idx",
445
+ "columns": [
446
+ {
447
+ "expression": "obligation_id",
448
+ "isExpression": false,
449
+ "asc": true,
450
+ "nulls": "last"
451
+ }
452
+ ],
453
+ "isUnique": false,
454
+ "concurrently": false,
455
+ "method": "btree",
456
+ "with": {}
457
+ },
458
+ "obligation_collaterals_v2_oracle_fk_idx": {
459
+ "name": "obligation_collaterals_v2_oracle_fk_idx",
460
+ "columns": [
461
+ {
462
+ "expression": "oracle_chain_id",
463
+ "isExpression": false,
464
+ "asc": true,
465
+ "nulls": "last"
466
+ },
467
+ {
468
+ "expression": "oracle_address",
469
+ "isExpression": false,
470
+ "asc": true,
471
+ "nulls": "last"
472
+ }
473
+ ],
474
+ "isUnique": false,
475
+ "concurrently": false,
476
+ "method": "btree",
477
+ "with": {}
478
+ }
479
+ },
480
+ "foreignKeys": {
481
+ "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk": {
482
+ "name": "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk",
483
+ "tableFrom": "obligation_collaterals_v2",
484
+ "tableTo": "obligations",
485
+ "schemaTo": "router_v1.6",
486
+ "columnsFrom": ["obligation_id"],
487
+ "columnsTo": ["obligation_id"],
488
+ "onDelete": "cascade",
489
+ "onUpdate": "no action"
490
+ },
491
+ "obligation_collaterals_v2_oracles_fk": {
492
+ "name": "obligation_collaterals_v2_oracles_fk",
493
+ "tableFrom": "obligation_collaterals_v2",
494
+ "tableTo": "oracles",
495
+ "schemaTo": "router_v1.6",
496
+ "columnsFrom": ["oracle_chain_id", "oracle_address"],
497
+ "columnsTo": ["chain_id", "address"],
498
+ "onDelete": "no action",
499
+ "onUpdate": "no action"
500
+ }
501
+ },
502
+ "compositePrimaryKeys": {
503
+ "obligation_collaterals_v2_pk": {
504
+ "name": "obligation_collaterals_v2_pk",
505
+ "columns": ["obligation_id", "asset"]
506
+ }
507
+ },
508
+ "uniqueConstraints": {},
509
+ "policies": {},
510
+ "checkConstraints": {},
511
+ "isRLSEnabled": false
512
+ },
513
+ "router_v1.6.obligations": {
514
+ "name": "obligations",
515
+ "schema": "router_v1.6",
516
+ "columns": {
517
+ "obligation_id": {
518
+ "name": "obligation_id",
519
+ "type": "varchar(66)",
520
+ "primaryKey": true,
521
+ "notNull": true
522
+ },
523
+ "chain_id": {
524
+ "name": "chain_id",
525
+ "type": "bigint",
526
+ "primaryKey": false,
527
+ "notNull": true
528
+ },
529
+ "loan_token": {
530
+ "name": "loan_token",
531
+ "type": "varchar(42)",
532
+ "primaryKey": false,
533
+ "notNull": true
534
+ },
535
+ "maturity": {
536
+ "name": "maturity",
537
+ "type": "integer",
538
+ "primaryKey": false,
539
+ "notNull": true
540
+ }
541
+ },
542
+ "indexes": {},
543
+ "foreignKeys": {},
544
+ "compositePrimaryKeys": {},
545
+ "uniqueConstraints": {},
546
+ "policies": {},
547
+ "checkConstraints": {},
548
+ "isRLSEnabled": false
549
+ },
550
+ "router_v1.6.offers": {
551
+ "name": "offers",
552
+ "schema": "router_v1.6",
553
+ "columns": {
554
+ "hash": {
555
+ "name": "hash",
556
+ "type": "varchar(66)",
557
+ "primaryKey": true,
558
+ "notNull": true
559
+ },
560
+ "obligation_id": {
561
+ "name": "obligation_id",
562
+ "type": "varchar(66)",
563
+ "primaryKey": false,
564
+ "notNull": true
565
+ },
566
+ "assets": {
567
+ "name": "assets",
568
+ "type": "numeric(78, 0)",
569
+ "primaryKey": false,
570
+ "notNull": true
571
+ },
572
+ "rate": {
573
+ "name": "rate",
574
+ "type": "numeric(78, 0)",
575
+ "primaryKey": false,
576
+ "notNull": true
577
+ },
578
+ "maturity": {
579
+ "name": "maturity",
580
+ "type": "integer",
581
+ "primaryKey": false,
582
+ "notNull": true
583
+ },
584
+ "expiry": {
585
+ "name": "expiry",
586
+ "type": "integer",
587
+ "primaryKey": false,
588
+ "notNull": true
589
+ },
590
+ "start": {
591
+ "name": "start",
592
+ "type": "integer",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "group_chain_id": {
597
+ "name": "group_chain_id",
598
+ "type": "bigint",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "group_maker": {
603
+ "name": "group_maker",
604
+ "type": "varchar(42)",
605
+ "primaryKey": false,
606
+ "notNull": true
607
+ },
608
+ "group_group": {
609
+ "name": "group_group",
610
+ "type": "varchar(66)",
611
+ "primaryKey": false,
612
+ "notNull": true
613
+ },
614
+ "nonce": {
615
+ "name": "nonce",
616
+ "type": "varchar(66)",
617
+ "primaryKey": false,
618
+ "notNull": true
619
+ },
620
+ "buy": {
621
+ "name": "buy",
622
+ "type": "boolean",
623
+ "primaryKey": false,
624
+ "notNull": true
625
+ },
626
+ "callback_address": {
627
+ "name": "callback_address",
628
+ "type": "varchar(42)",
629
+ "primaryKey": false,
630
+ "notNull": true
631
+ },
632
+ "callback_data": {
633
+ "name": "callback_data",
634
+ "type": "text",
635
+ "primaryKey": false,
636
+ "notNull": true
637
+ },
638
+ "block_number": {
639
+ "name": "block_number",
640
+ "type": "bigint",
641
+ "primaryKey": false,
642
+ "notNull": true
643
+ },
644
+ "updated_at": {
645
+ "name": "updated_at",
646
+ "type": "timestamp",
647
+ "primaryKey": false,
648
+ "notNull": true,
649
+ "default": "now()"
650
+ }
651
+ },
652
+ "indexes": {
653
+ "offers_group_fk_idx": {
654
+ "name": "offers_group_fk_idx",
655
+ "columns": [
656
+ {
657
+ "expression": "group_chain_id",
658
+ "isExpression": false,
659
+ "asc": true,
660
+ "nulls": "last"
661
+ },
662
+ {
663
+ "expression": "group_maker",
664
+ "isExpression": false,
665
+ "asc": true,
666
+ "nulls": "last"
667
+ },
668
+ {
669
+ "expression": "group_group",
670
+ "isExpression": false,
671
+ "asc": true,
672
+ "nulls": "last"
673
+ }
674
+ ],
675
+ "isUnique": false,
676
+ "concurrently": false,
677
+ "method": "btree",
678
+ "with": {}
679
+ },
680
+ "offers_group_and_hash_idx": {
681
+ "name": "offers_group_and_hash_idx",
682
+ "columns": [
683
+ {
684
+ "expression": "group_chain_id",
685
+ "isExpression": false,
686
+ "asc": true,
687
+ "nulls": "last"
688
+ },
689
+ {
690
+ "expression": "group_maker",
691
+ "isExpression": false,
692
+ "asc": true,
693
+ "nulls": "last"
694
+ },
695
+ {
696
+ "expression": "group_group",
697
+ "isExpression": false,
698
+ "asc": true,
699
+ "nulls": "last"
700
+ },
701
+ {
702
+ "expression": "hash",
703
+ "isExpression": false,
704
+ "asc": true,
705
+ "nulls": "last"
706
+ }
707
+ ],
708
+ "isUnique": false,
709
+ "concurrently": false,
710
+ "method": "btree",
711
+ "with": {}
712
+ },
713
+ "offers_group_winner_sell_side_idx": {
714
+ "name": "offers_group_winner_sell_side_idx",
715
+ "columns": [
716
+ {
717
+ "expression": "group_chain_id",
718
+ "isExpression": false,
719
+ "asc": true,
720
+ "nulls": "last"
721
+ },
722
+ {
723
+ "expression": "group_maker",
724
+ "isExpression": false,
725
+ "asc": true,
726
+ "nulls": "last"
727
+ },
728
+ {
729
+ "expression": "group_group",
730
+ "isExpression": false,
731
+ "asc": true,
732
+ "nulls": "last"
733
+ },
734
+ {
735
+ "expression": "\"rate\" desc",
736
+ "asc": true,
737
+ "isExpression": true,
738
+ "nulls": "last"
739
+ },
740
+ {
741
+ "expression": "\"block_number\" asc",
742
+ "asc": true,
743
+ "isExpression": true,
744
+ "nulls": "last"
745
+ },
746
+ {
747
+ "expression": "\"assets\" desc",
748
+ "asc": true,
749
+ "isExpression": true,
750
+ "nulls": "last"
751
+ },
752
+ {
753
+ "expression": "\"hash\" asc",
754
+ "asc": true,
755
+ "isExpression": true,
756
+ "nulls": "last"
757
+ }
758
+ ],
759
+ "isUnique": false,
760
+ "concurrently": false,
761
+ "method": "btree",
762
+ "with": {}
763
+ },
764
+ "offers_group_winner_buy_side_idx": {
765
+ "name": "offers_group_winner_buy_side_idx",
766
+ "columns": [
767
+ {
768
+ "expression": "group_chain_id",
769
+ "isExpression": false,
770
+ "asc": true,
771
+ "nulls": "last"
772
+ },
773
+ {
774
+ "expression": "group_maker",
775
+ "isExpression": false,
776
+ "asc": true,
777
+ "nulls": "last"
778
+ },
779
+ {
780
+ "expression": "group_group",
781
+ "isExpression": false,
782
+ "asc": true,
783
+ "nulls": "last"
784
+ },
785
+ {
786
+ "expression": "\"rate\" asc",
787
+ "asc": true,
788
+ "isExpression": true,
789
+ "nulls": "last"
790
+ },
791
+ {
792
+ "expression": "\"block_number\" asc",
793
+ "asc": true,
794
+ "isExpression": true,
795
+ "nulls": "last"
796
+ },
797
+ {
798
+ "expression": "\"assets\" desc",
799
+ "asc": true,
800
+ "isExpression": true,
801
+ "nulls": "last"
802
+ },
803
+ {
804
+ "expression": "\"hash\" asc",
805
+ "asc": true,
806
+ "isExpression": true,
807
+ "nulls": "last"
808
+ }
809
+ ],
810
+ "isUnique": false,
811
+ "concurrently": false,
812
+ "method": "btree",
813
+ "with": {}
814
+ },
815
+ "offers_obligation_id_side_idx": {
816
+ "name": "offers_obligation_id_side_idx",
817
+ "columns": [
818
+ {
819
+ "expression": "obligation_id",
820
+ "isExpression": false,
821
+ "asc": true,
822
+ "nulls": "last"
823
+ },
824
+ {
825
+ "expression": "buy",
826
+ "isExpression": false,
827
+ "asc": true,
828
+ "nulls": "last"
829
+ }
830
+ ],
831
+ "isUnique": false,
832
+ "concurrently": false,
833
+ "method": "btree",
834
+ "with": {}
835
+ }
836
+ },
837
+ "foreignKeys": {
838
+ "offers_obligation_id_obligations_obligation_id_fk": {
839
+ "name": "offers_obligation_id_obligations_obligation_id_fk",
840
+ "tableFrom": "offers",
841
+ "tableTo": "obligations",
842
+ "schemaTo": "router_v1.6",
843
+ "columnsFrom": ["obligation_id"],
844
+ "columnsTo": ["obligation_id"],
845
+ "onDelete": "cascade",
846
+ "onUpdate": "no action"
847
+ },
848
+ "offers_groups_fk": {
849
+ "name": "offers_groups_fk",
850
+ "tableFrom": "offers",
851
+ "tableTo": "groups",
852
+ "schemaTo": "router_v1.6",
853
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
854
+ "columnsTo": ["chain_id", "maker", "group"],
855
+ "onDelete": "cascade",
856
+ "onUpdate": "no action"
857
+ }
858
+ },
859
+ "compositePrimaryKeys": {},
860
+ "uniqueConstraints": {},
861
+ "policies": {},
862
+ "checkConstraints": {},
863
+ "isRLSEnabled": false
864
+ },
865
+ "router_v1.6.offers_callbacks": {
866
+ "name": "offers_callbacks",
867
+ "schema": "router_v1.6",
868
+ "columns": {
869
+ "offer_hash": {
870
+ "name": "offer_hash",
871
+ "type": "varchar(66)",
872
+ "primaryKey": false,
873
+ "notNull": true
874
+ },
875
+ "callback_id": {
876
+ "name": "callback_id",
877
+ "type": "varchar(66)",
878
+ "primaryKey": false,
879
+ "notNull": false
880
+ }
881
+ },
882
+ "indexes": {},
883
+ "foreignKeys": {
884
+ "offers_callbacks_offer_hash_offers_hash_fk": {
885
+ "name": "offers_callbacks_offer_hash_offers_hash_fk",
886
+ "tableFrom": "offers_callbacks",
887
+ "tableTo": "offers",
888
+ "schemaTo": "router_v1.6",
889
+ "columnsFrom": ["offer_hash"],
890
+ "columnsTo": ["hash"],
891
+ "onDelete": "cascade",
892
+ "onUpdate": "no action"
893
+ }
894
+ },
895
+ "compositePrimaryKeys": {
896
+ "offers_callbacks_pk": {
897
+ "name": "offers_callbacks_pk",
898
+ "columns": ["offer_hash", "callback_id"]
899
+ }
900
+ },
901
+ "uniqueConstraints": {},
902
+ "policies": {},
903
+ "checkConstraints": {},
904
+ "isRLSEnabled": false
905
+ },
906
+ "router_v1.6.oracles": {
907
+ "name": "oracles",
908
+ "schema": "router_v1.6",
909
+ "columns": {
910
+ "chain_id": {
911
+ "name": "chain_id",
912
+ "type": "bigint",
913
+ "primaryKey": false,
914
+ "notNull": true
915
+ },
916
+ "address": {
917
+ "name": "address",
918
+ "type": "varchar(42)",
919
+ "primaryKey": false,
920
+ "notNull": true
921
+ },
922
+ "price": {
923
+ "name": "price",
924
+ "type": "numeric(78, 0)",
925
+ "primaryKey": false,
926
+ "notNull": false
927
+ },
928
+ "block_number": {
929
+ "name": "block_number",
930
+ "type": "bigint",
931
+ "primaryKey": false,
932
+ "notNull": true
933
+ },
934
+ "updated_at": {
935
+ "name": "updated_at",
936
+ "type": "timestamp",
937
+ "primaryKey": false,
938
+ "notNull": true,
939
+ "default": "now()"
940
+ }
941
+ },
942
+ "indexes": {},
943
+ "foreignKeys": {},
944
+ "compositePrimaryKeys": {
945
+ "oracles_pk": {
946
+ "name": "oracles_pk",
947
+ "columns": ["chain_id", "address"]
948
+ }
949
+ },
950
+ "uniqueConstraints": {},
951
+ "policies": {},
952
+ "checkConstraints": {},
953
+ "isRLSEnabled": false
954
+ },
955
+ "router_v1.6.position_types": {
956
+ "name": "position_types",
957
+ "schema": "router_v1.6",
958
+ "columns": {
959
+ "id": {
960
+ "name": "id",
961
+ "type": "serial",
962
+ "primaryKey": true,
963
+ "notNull": true
964
+ },
965
+ "type": {
966
+ "name": "type",
967
+ "type": "position_type",
968
+ "typeSchema": "router_v1.6",
969
+ "primaryKey": false,
970
+ "notNull": true
971
+ }
972
+ },
973
+ "indexes": {},
974
+ "foreignKeys": {},
975
+ "compositePrimaryKeys": {},
976
+ "uniqueConstraints": {},
977
+ "policies": {},
978
+ "checkConstraints": {},
979
+ "isRLSEnabled": false
980
+ },
981
+ "router_v1.6.positions": {
982
+ "name": "positions",
983
+ "schema": "router_v1.6",
984
+ "columns": {
985
+ "chain_id": {
986
+ "name": "chain_id",
987
+ "type": "bigint",
988
+ "primaryKey": false,
989
+ "notNull": true
990
+ },
991
+ "contract": {
992
+ "name": "contract",
993
+ "type": "varchar(42)",
994
+ "primaryKey": false,
995
+ "notNull": true
996
+ },
997
+ "user": {
998
+ "name": "user",
999
+ "type": "varchar(42)",
1000
+ "primaryKey": false,
1001
+ "notNull": true
1002
+ },
1003
+ "position_type_id": {
1004
+ "name": "position_type_id",
1005
+ "type": "integer",
1006
+ "primaryKey": false,
1007
+ "notNull": true
1008
+ },
1009
+ "balance": {
1010
+ "name": "balance",
1011
+ "type": "numeric(78, 0)",
1012
+ "primaryKey": false,
1013
+ "notNull": false
1014
+ },
1015
+ "asset": {
1016
+ "name": "asset",
1017
+ "type": "varchar(42)",
1018
+ "primaryKey": false,
1019
+ "notNull": false
1020
+ },
1021
+ "block_number": {
1022
+ "name": "block_number",
1023
+ "type": "bigint",
1024
+ "primaryKey": false,
1025
+ "notNull": true
1026
+ },
1027
+ "updated_at": {
1028
+ "name": "updated_at",
1029
+ "type": "timestamp",
1030
+ "primaryKey": false,
1031
+ "notNull": true,
1032
+ "default": "now()"
1033
+ }
1034
+ },
1035
+ "indexes": {},
1036
+ "foreignKeys": {
1037
+ "positions_position_type_id_position_types_id_fk": {
1038
+ "name": "positions_position_type_id_position_types_id_fk",
1039
+ "tableFrom": "positions",
1040
+ "tableTo": "position_types",
1041
+ "schemaTo": "router_v1.6",
1042
+ "columnsFrom": ["position_type_id"],
1043
+ "columnsTo": ["id"],
1044
+ "onDelete": "no action",
1045
+ "onUpdate": "no action"
1046
+ }
1047
+ },
1048
+ "compositePrimaryKeys": {
1049
+ "positions_pk": {
1050
+ "name": "positions_pk",
1051
+ "columns": ["chain_id", "contract", "user"]
1052
+ }
1053
+ },
1054
+ "uniqueConstraints": {},
1055
+ "policies": {},
1056
+ "checkConstraints": {},
1057
+ "isRLSEnabled": false
1058
+ },
1059
+ "router_v1.6.status": {
1060
+ "name": "status",
1061
+ "schema": "router_v1.6",
1062
+ "columns": {
1063
+ "id": {
1064
+ "name": "id",
1065
+ "type": "serial",
1066
+ "primaryKey": true,
1067
+ "notNull": true
1068
+ },
1069
+ "code": {
1070
+ "name": "code",
1071
+ "type": "status_code",
1072
+ "typeSchema": "router_v1.6",
1073
+ "primaryKey": false,
1074
+ "notNull": false
1075
+ }
1076
+ },
1077
+ "indexes": {},
1078
+ "foreignKeys": {},
1079
+ "compositePrimaryKeys": {},
1080
+ "uniqueConstraints": {
1081
+ "status_code_unique": {
1082
+ "name": "status_code_unique",
1083
+ "nullsNotDistinct": false,
1084
+ "columns": ["code"]
1085
+ }
1086
+ },
1087
+ "policies": {},
1088
+ "checkConstraints": {},
1089
+ "isRLSEnabled": false
1090
+ },
1091
+ "router_v1.6.transfers": {
1092
+ "name": "transfers",
1093
+ "schema": "router_v1.6",
1094
+ "columns": {
1095
+ "event_id": {
1096
+ "name": "event_id",
1097
+ "type": "varchar(128)",
1098
+ "primaryKey": true,
1099
+ "notNull": true
1100
+ },
1101
+ "chain_id": {
1102
+ "name": "chain_id",
1103
+ "type": "bigint",
1104
+ "primaryKey": false,
1105
+ "notNull": true
1106
+ },
1107
+ "contract": {
1108
+ "name": "contract",
1109
+ "type": "varchar(42)",
1110
+ "primaryKey": false,
1111
+ "notNull": true
1112
+ },
1113
+ "from": {
1114
+ "name": "from",
1115
+ "type": "varchar(42)",
1116
+ "primaryKey": false,
1117
+ "notNull": true
1118
+ },
1119
+ "to": {
1120
+ "name": "to",
1121
+ "type": "varchar(42)",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "value": {
1126
+ "name": "value",
1127
+ "type": "numeric(78, 0)",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "block_number": {
1132
+ "name": "block_number",
1133
+ "type": "bigint",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "created_at": {
1138
+ "name": "created_at",
1139
+ "type": "timestamp",
1140
+ "primaryKey": false,
1141
+ "notNull": true,
1142
+ "default": "now()"
1143
+ }
1144
+ },
1145
+ "indexes": {
1146
+ "transfers_chain_contract_user_idx": {
1147
+ "name": "transfers_chain_contract_user_idx",
1148
+ "columns": [
1149
+ {
1150
+ "expression": "chain_id",
1151
+ "isExpression": false,
1152
+ "asc": true,
1153
+ "nulls": "last"
1154
+ },
1155
+ {
1156
+ "expression": "contract",
1157
+ "isExpression": false,
1158
+ "asc": true,
1159
+ "nulls": "last"
1160
+ },
1161
+ {
1162
+ "expression": "from",
1163
+ "isExpression": false,
1164
+ "asc": true,
1165
+ "nulls": "last"
1166
+ },
1167
+ {
1168
+ "expression": "to",
1169
+ "isExpression": false,
1170
+ "asc": true,
1171
+ "nulls": "last"
1172
+ },
1173
+ {
1174
+ "expression": "block_number",
1175
+ "isExpression": false,
1176
+ "asc": true,
1177
+ "nulls": "last"
1178
+ }
1179
+ ],
1180
+ "isUnique": false,
1181
+ "concurrently": false,
1182
+ "method": "btree",
1183
+ "with": {}
1184
+ }
1185
+ },
1186
+ "foreignKeys": {
1187
+ "transfers_positions_from_fk": {
1188
+ "name": "transfers_positions_from_fk",
1189
+ "tableFrom": "transfers",
1190
+ "tableTo": "positions",
1191
+ "schemaTo": "router_v1.6",
1192
+ "columnsFrom": ["chain_id", "contract", "from"],
1193
+ "columnsTo": ["chain_id", "contract", "user"],
1194
+ "onDelete": "cascade",
1195
+ "onUpdate": "no action"
1196
+ },
1197
+ "transfers_positions_to_fk": {
1198
+ "name": "transfers_positions_to_fk",
1199
+ "tableFrom": "transfers",
1200
+ "tableTo": "positions",
1201
+ "schemaTo": "router_v1.6",
1202
+ "columnsFrom": ["chain_id", "contract", "to"],
1203
+ "columnsTo": ["chain_id", "contract", "user"],
1204
+ "onDelete": "cascade",
1205
+ "onUpdate": "no action"
1206
+ }
1207
+ },
1208
+ "compositePrimaryKeys": {},
1209
+ "uniqueConstraints": {},
1210
+ "policies": {},
1211
+ "checkConstraints": {},
1212
+ "isRLSEnabled": false
1213
+ },
1214
+ "router_v1.6.validations": {
1215
+ "name": "validations",
1216
+ "schema": "router_v1.6",
1217
+ "columns": {
1218
+ "offer_hash": {
1219
+ "name": "offer_hash",
1220
+ "type": "varchar(66)",
1221
+ "primaryKey": true,
1222
+ "notNull": true
1223
+ },
1224
+ "status_id": {
1225
+ "name": "status_id",
1226
+ "type": "integer",
1227
+ "primaryKey": false,
1228
+ "notNull": true
1229
+ },
1230
+ "updated_at": {
1231
+ "name": "updated_at",
1232
+ "type": "timestamp",
1233
+ "primaryKey": false,
1234
+ "notNull": true,
1235
+ "default": "now()"
1236
+ }
1237
+ },
1238
+ "indexes": {},
1239
+ "foreignKeys": {
1240
+ "validations_offer_hash_offers_hash_fk": {
1241
+ "name": "validations_offer_hash_offers_hash_fk",
1242
+ "tableFrom": "validations",
1243
+ "tableTo": "offers",
1244
+ "schemaTo": "router_v1.6",
1245
+ "columnsFrom": ["offer_hash"],
1246
+ "columnsTo": ["hash"],
1247
+ "onDelete": "cascade",
1248
+ "onUpdate": "no action"
1249
+ },
1250
+ "validations_status_id_status_id_fk": {
1251
+ "name": "validations_status_id_status_id_fk",
1252
+ "tableFrom": "validations",
1253
+ "tableTo": "status",
1254
+ "schemaTo": "router_v1.6",
1255
+ "columnsFrom": ["status_id"],
1256
+ "columnsTo": ["id"],
1257
+ "onDelete": "no action",
1258
+ "onUpdate": "no action"
1259
+ }
1260
+ },
1261
+ "compositePrimaryKeys": {},
1262
+ "uniqueConstraints": {},
1263
+ "policies": {},
1264
+ "checkConstraints": {},
1265
+ "isRLSEnabled": false
1266
+ }
1267
+ },
1268
+ "enums": {
1269
+ "router_v1.6.position_type": {
1270
+ "name": "position_type",
1271
+ "schema": "router_v1.6",
1272
+ "values": ["erc20", "vault_v1"]
1273
+ },
1274
+ "router_v1.6.status_code": {
1275
+ "name": "status_code",
1276
+ "schema": "router_v1.6",
1277
+ "values": ["VALID", "SIMULATION_ERROR"]
1278
+ }
1279
+ },
1280
+ "schemas": {},
1281
+ "sequences": {},
1282
+ "roles": {},
1283
+ "policies": {},
1284
+ "views": {},
1285
+ "_meta": {
1286
+ "columns": {},
1287
+ "schemas": {},
1288
+ "tables": {}
1289
+ }
1290
+ }