@morpho-dev/router 0.2.0 → 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 (65) hide show
  1. package/README.md +3 -3
  2. package/dist/chunk-jass6xSI.mjs +13 -0
  3. package/dist/cli.js +6566 -7032
  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/{router_v1.5/meta/0008_snapshot.json → migrations/meta/0000_snapshot.json} +50 -50
  19. package/dist/drizzle/{router_v1.5/meta/0006_snapshot.json → migrations/meta/0001_snapshot.json} +150 -62
  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.5/meta/0007_snapshot.json → migrations/meta/0004_snapshot.json} +57 -67
  23. package/dist/drizzle/{router_v1.5 → migrations}/meta/0005_snapshot.json +181 -70
  24. package/dist/drizzle/{router_v1.5/meta/0004_snapshot.json → migrations/meta/0006_snapshot.json} +466 -62
  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/{router_v1.5/meta/0001_snapshot.json → migrations/meta/0013_snapshot.json} +492 -606
  29. package/dist/drizzle/{router_v1.5/meta/0002_snapshot.json → migrations/meta/0014_snapshot.json} +538 -711
  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 +2127 -1737
  34. package/dist/index.browser.d.ts.map +1 -0
  35. package/dist/index.browser.js +3789 -2911
  36. package/dist/index.browser.js.map +1 -1
  37. package/dist/index.browser.mjs +3581 -2850
  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 +4279 -4410
  42. package/dist/index.node.d.ts.map +1 -0
  43. package/dist/index.node.js +7742 -7158
  44. package/dist/index.node.js.map +1 -1
  45. package/dist/index.node.mjs +7479 -7106
  46. package/dist/index.node.mjs.map +1 -1
  47. package/package.json +16 -6
  48. package/dist/cli.js.map +0 -1
  49. package/dist/drizzle/VERSION.ts +0 -3
  50. package/dist/drizzle/drizzle.config.ts +0 -18
  51. package/dist/drizzle/index.ts +0 -2
  52. package/dist/drizzle/router_v1.5/0000_add_block_number_to_liquidity_graph_and_offer_liquidity_pools_relation.sql +0 -122
  53. package/dist/drizzle/router_v1.5/0001_create_new_relations_to_prepare_new_liquidity_model.sql +0 -55
  54. package/dist/drizzle/router_v1.5/0002_add_new_offer_status_relation.sql +0 -9
  55. package/dist/drizzle/router_v1.5/0003_insert-status-code.sql +0 -1
  56. package/dist/drizzle/router_v1.5/0004_add_index_for_fast_book_lookup.sql +0 -3
  57. package/dist/drizzle/router_v1.5/0005_add_group_consumed_events_table.sql +0 -12
  58. package/dist/drizzle/router_v1.5/0007_update_index_for_fast_book_lookup.sql +0 -5
  59. package/dist/drizzle/router_v1.5/0008_rename_consumed_events_table.sql +0 -8
  60. package/dist/drizzle/router_v1.5/meta/0000_snapshot.json +0 -1028
  61. package/dist/drizzle/router_v1.5/meta/0003_snapshot.json +0 -1463
  62. package/dist/drizzle/router_v1.5/meta/_journal.json +0 -69
  63. package/dist/drizzle/schema.ts +0 -363
  64. package/dist/index.browser.d.cts +0 -2403
  65. package/dist/index.node.d.cts +0 -5119
@@ -1,12 +1,66 @@
1
1
  {
2
- "id": "b1fce416-5707-4ab1-8125-c465e47cd17b",
3
- "prevId": "ebc5db1e-f7e2-4441-b9c0-4789d0715e09",
2
+ "id": "338470f8-fb65-4e1b-b42f-8e414a3826f3",
3
+ "prevId": "27f7a050-633e-4b6b-9e88-e0baf9889d16",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
6
6
  "tables": {
7
- "router_v1.5.chains": {
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": {
8
62
  "name": "chains",
9
- "schema": "router_v1.5",
63
+ "schema": "router_v1.6",
10
64
  "columns": {
11
65
  "chain_id": {
12
66
  "name": "chain_id",
@@ -65,9 +119,9 @@
65
119
  "checkConstraints": {},
66
120
  "isRLSEnabled": false
67
121
  },
68
- "router_v1.5.collectors": {
122
+ "router_v1.6.collectors": {
69
123
  "name": "collectors",
70
- "schema": "router_v1.5",
124
+ "schema": "router_v1.6",
71
125
  "columns": {
72
126
  "chain_id": {
73
127
  "name": "chain_id",
@@ -138,13 +192,13 @@
138
192
  "checkConstraints": {},
139
193
  "isRLSEnabled": false
140
194
  },
141
- "router_v1.5.consumed_per_user_and_nonce": {
142
- "name": "consumed_per_user_and_nonce",
143
- "schema": "router_v1.5",
195
+ "router_v1.6.consumed_events": {
196
+ "name": "consumed_events",
197
+ "schema": "router_v1.6",
144
198
  "columns": {
145
- "id": {
146
- "name": "id",
147
- "type": "varchar(255)",
199
+ "event_id": {
200
+ "name": "event_id",
201
+ "type": "varchar(128)",
148
202
  "primaryKey": true,
149
203
  "notNull": true
150
204
  },
@@ -154,20 +208,20 @@
154
208
  "primaryKey": false,
155
209
  "notNull": true
156
210
  },
157
- "offering": {
158
- "name": "offering",
211
+ "maker": {
212
+ "name": "maker",
159
213
  "type": "varchar(42)",
160
214
  "primaryKey": false,
161
215
  "notNull": true
162
216
  },
163
- "nonce": {
164
- "name": "nonce",
165
- "type": "bigint",
217
+ "group": {
218
+ "name": "group",
219
+ "type": "varchar(66)",
166
220
  "primaryKey": false,
167
221
  "notNull": true
168
222
  },
169
- "consumed": {
170
- "name": "consumed",
223
+ "amount": {
224
+ "name": "amount",
171
225
  "type": "numeric(78, 0)",
172
226
  "primaryKey": false,
173
227
  "notNull": true
@@ -187,8 +241,8 @@
187
241
  }
188
242
  },
189
243
  "indexes": {
190
- "consumed_per_user_and_nonce_chain_id_offering_nonce_block_number_idx": {
191
- "name": "consumed_per_user_and_nonce_chain_id_offering_nonce_block_number_idx",
244
+ "consumed_events_group_idx": {
245
+ "name": "consumed_events_group_idx",
192
246
  "columns": [
193
247
  {
194
248
  "expression": "chain_id",
@@ -197,21 +251,30 @@
197
251
  "nulls": "last"
198
252
  },
199
253
  {
200
- "expression": "offering",
254
+ "expression": "maker",
201
255
  "isExpression": false,
202
256
  "asc": true,
203
257
  "nulls": "last"
204
258
  },
205
259
  {
206
- "expression": "nonce",
260
+ "expression": "group",
207
261
  "isExpression": false,
208
262
  "asc": true,
209
263
  "nulls": "last"
210
- },
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": [
211
274
  {
212
- "expression": "\"block_number\" desc",
275
+ "expression": "block_number",
276
+ "isExpression": false,
213
277
  "asc": true,
214
- "isExpression": true,
215
278
  "nulls": "last"
216
279
  }
217
280
  ],
@@ -221,16 +284,27 @@
221
284
  "with": {}
222
285
  }
223
286
  },
224
- "foreignKeys": {},
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
+ },
225
299
  "compositePrimaryKeys": {},
226
300
  "uniqueConstraints": {},
227
301
  "policies": {},
228
302
  "checkConstraints": {},
229
303
  "isRLSEnabled": false
230
304
  },
231
- "router_v1.5.groups": {
305
+ "router_v1.6.groups": {
232
306
  "name": "groups",
233
- "schema": "router_v1.5",
307
+ "schema": "router_v1.6",
234
308
  "columns": {
235
309
  "chain_id": {
236
310
  "name": "chain_id",
@@ -270,193 +344,30 @@
270
344
  "default": "now()"
271
345
  }
272
346
  },
273
- "indexes": {},
274
- "foreignKeys": {},
275
- "compositePrimaryKeys": {
276
- "groups_pk": {
277
- "name": "groups_pk",
278
- "columns": ["chain_id", "maker", "group"]
279
- }
280
- },
281
- "uniqueConstraints": {},
282
- "policies": {},
283
- "checkConstraints": {},
284
- "isRLSEnabled": false
285
- },
286
- "router_v1.5.liquidity_links": {
287
- "name": "liquidity_links",
288
- "schema": "router_v1.5",
289
- "columns": {
290
- "parent_pool_id": {
291
- "name": "parent_pool_id",
292
- "type": "varchar(255)",
293
- "primaryKey": false,
294
- "notNull": true
295
- },
296
- "child_pool_id": {
297
- "name": "child_pool_id",
298
- "type": "varchar(255)",
299
- "primaryKey": false,
300
- "notNull": true
301
- },
302
- "priority": {
303
- "name": "priority",
304
- "type": "integer",
305
- "primaryKey": false,
306
- "notNull": true
307
- },
308
- "block_number": {
309
- "name": "block_number",
310
- "type": "bigint",
311
- "primaryKey": false,
312
- "notNull": true
313
- },
314
- "updated_at": {
315
- "name": "updated_at",
316
- "type": "timestamp",
317
- "primaryKey": false,
318
- "notNull": true,
319
- "default": "now()"
320
- }
321
- },
322
347
  "indexes": {
323
- "liquidity_links_parent_pool_id_idx": {
324
- "name": "liquidity_links_parent_pool_id_idx",
348
+ "groups_chain_id_maker_group_consumed_idx": {
349
+ "name": "groups_chain_id_maker_group_consumed_idx",
325
350
  "columns": [
326
351
  {
327
- "expression": "parent_pool_id",
352
+ "expression": "chain_id",
328
353
  "isExpression": false,
329
354
  "asc": true,
330
355
  "nulls": "last"
331
- }
332
- ],
333
- "isUnique": false,
334
- "concurrently": false,
335
- "method": "btree",
336
- "with": {}
337
- },
338
- "liquidity_links_child_pool_id_idx": {
339
- "name": "liquidity_links_child_pool_id_idx",
340
- "columns": [
356
+ },
341
357
  {
342
- "expression": "child_pool_id",
358
+ "expression": "maker",
343
359
  "isExpression": false,
344
360
  "asc": true,
345
361
  "nulls": "last"
346
- }
347
- ],
348
- "isUnique": false,
349
- "concurrently": false,
350
- "method": "btree",
351
- "with": {}
352
- }
353
- },
354
- "foreignKeys": {
355
- "liquidity_links_parent_pool_id_liquidity_pools_id_fk": {
356
- "name": "liquidity_links_parent_pool_id_liquidity_pools_id_fk",
357
- "tableFrom": "liquidity_links",
358
- "tableTo": "liquidity_pools",
359
- "schemaTo": "router_v1.5",
360
- "columnsFrom": ["parent_pool_id"],
361
- "columnsTo": ["id"],
362
- "onDelete": "cascade",
363
- "onUpdate": "no action"
364
- },
365
- "liquidity_links_child_pool_id_liquidity_pools_id_fk": {
366
- "name": "liquidity_links_child_pool_id_liquidity_pools_id_fk",
367
- "tableFrom": "liquidity_links",
368
- "tableTo": "liquidity_pools",
369
- "schemaTo": "router_v1.5",
370
- "columnsFrom": ["child_pool_id"],
371
- "columnsTo": ["id"],
372
- "onDelete": "cascade",
373
- "onUpdate": "no action"
374
- }
375
- },
376
- "compositePrimaryKeys": {
377
- "liquidity_links_pk": {
378
- "name": "liquidity_links_pk",
379
- "columns": ["parent_pool_id", "priority"]
380
- }
381
- },
382
- "uniqueConstraints": {},
383
- "policies": {},
384
- "checkConstraints": {},
385
- "isRLSEnabled": false
386
- },
387
- "router_v1.5.liquidity_pools": {
388
- "name": "liquidity_pools",
389
- "schema": "router_v1.5",
390
- "columns": {
391
- "id": {
392
- "name": "id",
393
- "type": "varchar(255)",
394
- "primaryKey": true,
395
- "notNull": true
396
- },
397
- "amount": {
398
- "name": "amount",
399
- "type": "numeric(78, 0)",
400
- "primaryKey": false,
401
- "notNull": true
402
- },
403
- "block_number": {
404
- "name": "block_number",
405
- "type": "bigint",
406
- "primaryKey": false,
407
- "notNull": true
408
- },
409
- "updated_at": {
410
- "name": "updated_at",
411
- "type": "timestamp",
412
- "primaryKey": false,
413
- "notNull": true,
414
- "default": "now()"
415
- }
416
- },
417
- "indexes": {},
418
- "foreignKeys": {},
419
- "compositePrimaryKeys": {},
420
- "uniqueConstraints": {},
421
- "policies": {},
422
- "checkConstraints": {},
423
- "isRLSEnabled": false
424
- },
425
- "router_v1.5.obligation_collaterals": {
426
- "name": "obligation_collaterals",
427
- "schema": "router_v1.5",
428
- "columns": {
429
- "obligation_id": {
430
- "name": "obligation_id",
431
- "type": "varchar(66)",
432
- "primaryKey": false,
433
- "notNull": true
434
- },
435
- "asset": {
436
- "name": "asset",
437
- "type": "varchar(42)",
438
- "primaryKey": false,
439
- "notNull": true
440
- },
441
- "oracle": {
442
- "name": "oracle",
443
- "type": "varchar(42)",
444
- "primaryKey": false,
445
- "notNull": true
446
- },
447
- "lltv": {
448
- "name": "lltv",
449
- "type": "bigint",
450
- "primaryKey": false,
451
- "notNull": true
452
- }
453
- },
454
- "indexes": {
455
- "obligation_collaterals_obligation_id_idx": {
456
- "name": "obligation_collaterals_obligation_id_idx",
457
- "columns": [
362
+ },
458
363
  {
459
- "expression": "obligation_id",
364
+ "expression": "group",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ },
369
+ {
370
+ "expression": "consumed",
460
371
  "isExpression": false,
461
372
  "asc": true,
462
373
  "nulls": "last"
@@ -468,22 +379,11 @@
468
379
  "with": {}
469
380
  }
470
381
  },
471
- "foreignKeys": {
472
- "obligation_collaterals_obligation_id_obligations_obligation_id_fk": {
473
- "name": "obligation_collaterals_obligation_id_obligations_obligation_id_fk",
474
- "tableFrom": "obligation_collaterals",
475
- "tableTo": "obligations",
476
- "schemaTo": "router_v1.5",
477
- "columnsFrom": ["obligation_id"],
478
- "columnsTo": ["obligation_id"],
479
- "onDelete": "cascade",
480
- "onUpdate": "no action"
481
- }
482
- },
382
+ "foreignKeys": {},
483
383
  "compositePrimaryKeys": {
484
- "obligation_collaterals_pk": {
485
- "name": "obligation_collaterals_pk",
486
- "columns": ["obligation_id", "asset"]
384
+ "groups_pk": {
385
+ "name": "groups_pk",
386
+ "columns": ["chain_id", "maker", "group"]
487
387
  }
488
388
  },
489
389
  "uniqueConstraints": {},
@@ -491,9 +391,9 @@
491
391
  "checkConstraints": {},
492
392
  "isRLSEnabled": false
493
393
  },
494
- "router_v1.5.obligation_collaterals_v2": {
394
+ "router_v1.6.obligation_collaterals_v2": {
495
395
  "name": "obligation_collaterals_v2",
496
- "schema": "router_v1.5",
396
+ "schema": "router_v1.6",
497
397
  "columns": {
498
398
  "obligation_id": {
499
399
  "name": "obligation_id",
@@ -582,7 +482,7 @@
582
482
  "name": "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk",
583
483
  "tableFrom": "obligation_collaterals_v2",
584
484
  "tableTo": "obligations",
585
- "schemaTo": "router_v1.5",
485
+ "schemaTo": "router_v1.6",
586
486
  "columnsFrom": ["obligation_id"],
587
487
  "columnsTo": ["obligation_id"],
588
488
  "onDelete": "cascade",
@@ -592,7 +492,7 @@
592
492
  "name": "obligation_collaterals_v2_oracles_fk",
593
493
  "tableFrom": "obligation_collaterals_v2",
594
494
  "tableTo": "oracles",
595
- "schemaTo": "router_v1.5",
495
+ "schemaTo": "router_v1.6",
596
496
  "columnsFrom": ["oracle_chain_id", "oracle_address"],
597
497
  "columnsTo": ["chain_id", "address"],
598
498
  "onDelete": "no action",
@@ -610,9 +510,9 @@
610
510
  "checkConstraints": {},
611
511
  "isRLSEnabled": false
612
512
  },
613
- "router_v1.5.obligations": {
513
+ "router_v1.6.obligations": {
614
514
  "name": "obligations",
615
- "schema": "router_v1.5",
515
+ "schema": "router_v1.6",
616
516
  "columns": {
617
517
  "obligation_id": {
618
518
  "name": "obligation_id",
@@ -647,9 +547,9 @@
647
547
  "checkConstraints": {},
648
548
  "isRLSEnabled": false
649
549
  },
650
- "router_v1.5.offer_liquidity_pools": {
651
- "name": "offer_liquidity_pools",
652
- "schema": "router_v1.5",
550
+ "router_v1.6.offers_callbacks": {
551
+ "name": "offers_callbacks",
552
+ "schema": "router_v1.6",
653
553
  "columns": {
654
554
  "offer_hash": {
655
555
  "name": "offer_hash",
@@ -657,75 +557,30 @@
657
557
  "primaryKey": false,
658
558
  "notNull": true
659
559
  },
660
- "pool_id": {
661
- "name": "pool_id",
662
- "type": "varchar(255)",
663
- "primaryKey": false,
664
- "notNull": true
665
- },
666
- "amount": {
667
- "name": "amount",
668
- "type": "numeric(78, 0)",
669
- "primaryKey": false,
670
- "notNull": true
671
- },
672
- "block_number": {
673
- "name": "block_number",
674
- "type": "bigint",
675
- "primaryKey": false,
676
- "notNull": true
677
- },
678
- "updated_at": {
679
- "name": "updated_at",
680
- "type": "timestamp",
560
+ "callback_id": {
561
+ "name": "callback_id",
562
+ "type": "varchar(66)",
681
563
  "primaryKey": false,
682
- "notNull": true,
683
- "default": "now()"
684
- }
685
- },
686
- "indexes": {
687
- "offer_liquidity_pools_pool_id_idx": {
688
- "name": "offer_liquidity_pools_pool_id_idx",
689
- "columns": [
690
- {
691
- "expression": "pool_id",
692
- "isExpression": false,
693
- "asc": true,
694
- "nulls": "last"
695
- }
696
- ],
697
- "isUnique": false,
698
- "concurrently": false,
699
- "method": "btree",
700
- "with": {}
564
+ "notNull": false
701
565
  }
702
566
  },
567
+ "indexes": {},
703
568
  "foreignKeys": {
704
- "offer_liquidity_pools_offer_hash_offers_hash_fk": {
705
- "name": "offer_liquidity_pools_offer_hash_offers_hash_fk",
706
- "tableFrom": "offer_liquidity_pools",
707
- "tableTo": "offers",
708
- "schemaTo": "router_v1.5",
569
+ "offers_callbacks_offer_hash_offers_v2_hash_fk": {
570
+ "name": "offers_callbacks_offer_hash_offers_v2_hash_fk",
571
+ "tableFrom": "offers_callbacks",
572
+ "tableTo": "offers_v2",
573
+ "schemaTo": "router_v1.6",
709
574
  "columnsFrom": ["offer_hash"],
710
575
  "columnsTo": ["hash"],
711
576
  "onDelete": "cascade",
712
577
  "onUpdate": "no action"
713
- },
714
- "offer_liquidity_pools_pool_id_liquidity_pools_id_fk": {
715
- "name": "offer_liquidity_pools_pool_id_liquidity_pools_id_fk",
716
- "tableFrom": "offer_liquidity_pools",
717
- "tableTo": "liquidity_pools",
718
- "schemaTo": "router_v1.5",
719
- "columnsFrom": ["pool_id"],
720
- "columnsTo": ["id"],
721
- "onDelete": "cascade",
722
- "onUpdate": "no action"
723
578
  }
724
579
  },
725
580
  "compositePrimaryKeys": {
726
- "offer_liquidity_pools_pk": {
727
- "name": "offer_liquidity_pools_pk",
728
- "columns": ["offer_hash", "pool_id"]
581
+ "offers_callbacks_pk": {
582
+ "name": "offers_callbacks_pk",
583
+ "columns": ["offer_hash", "callback_id"]
729
584
  }
730
585
  },
731
586
  "uniqueConstraints": {},
@@ -733,9 +588,9 @@
733
588
  "checkConstraints": {},
734
589
  "isRLSEnabled": false
735
590
  },
736
- "router_v1.5.offers": {
737
- "name": "offers",
738
- "schema": "router_v1.5",
591
+ "router_v1.6.offers_v2": {
592
+ "name": "offers_v2",
593
+ "schema": "router_v1.6",
739
594
  "columns": {
740
595
  "hash": {
741
596
  "name": "hash",
@@ -749,12 +604,6 @@
749
604
  "primaryKey": false,
750
605
  "notNull": true
751
606
  },
752
- "offering": {
753
- "name": "offering",
754
- "type": "varchar(42)",
755
- "primaryKey": false,
756
- "notNull": true
757
- },
758
607
  "assets": {
759
608
  "name": "assets",
760
609
  "type": "numeric(78, 0)",
@@ -763,7 +612,7 @@
763
612
  },
764
613
  "rate": {
765
614
  "name": "rate",
766
- "type": "bigint",
615
+ "type": "numeric(78, 0)",
767
616
  "primaryKey": false,
768
617
  "notNull": true
769
618
  },
@@ -785,27 +634,33 @@
785
634
  "primaryKey": false,
786
635
  "notNull": true
787
636
  },
788
- "nonce": {
789
- "name": "nonce",
637
+ "group_chain_id": {
638
+ "name": "group_chain_id",
790
639
  "type": "bigint",
791
640
  "primaryKey": false,
792
641
  "notNull": true
793
642
  },
794
- "buy": {
795
- "name": "buy",
796
- "type": "boolean",
643
+ "group_maker": {
644
+ "name": "group_maker",
645
+ "type": "varchar(42)",
797
646
  "primaryKey": false,
798
647
  "notNull": true
799
648
  },
800
- "chain_id": {
801
- "name": "chain_id",
802
- "type": "bigint",
649
+ "group_group": {
650
+ "name": "group_group",
651
+ "type": "varchar(66)",
803
652
  "primaryKey": false,
804
653
  "notNull": true
805
654
  },
806
- "loan_token": {
807
- "name": "loan_token",
808
- "type": "varchar(42)",
655
+ "nonce": {
656
+ "name": "nonce",
657
+ "type": "varchar(66)",
658
+ "primaryKey": false,
659
+ "notNull": true
660
+ },
661
+ "buy": {
662
+ "name": "buy",
663
+ "type": "boolean",
809
664
  "primaryKey": false,
810
665
  "notNull": true
811
666
  },
@@ -821,68 +676,38 @@
821
676
  "primaryKey": false,
822
677
  "notNull": true
823
678
  },
824
- "callback_gas_limit": {
825
- "name": "callback_gas_limit",
679
+ "block_number": {
680
+ "name": "block_number",
826
681
  "type": "bigint",
827
682
  "primaryKey": false,
828
683
  "notNull": true
829
684
  },
830
- "signature": {
831
- "name": "signature",
832
- "type": "varchar(132)",
833
- "primaryKey": false,
834
- "notNull": false
835
- },
836
- "created_at": {
837
- "name": "created_at",
685
+ "updated_at": {
686
+ "name": "updated_at",
838
687
  "type": "timestamp",
839
688
  "primaryKey": false,
840
689
  "notNull": true,
841
690
  "default": "now()"
842
- },
843
- "block_number": {
844
- "name": "block_number",
845
- "type": "bigint",
846
- "primaryKey": false,
847
- "notNull": true
848
691
  }
849
692
  },
850
693
  "indexes": {
851
- "offers_obligation_id_idx": {
852
- "name": "offers_obligation_id_idx",
694
+ "offers_v2_group_fk_idx": {
695
+ "name": "offers_v2_group_fk_idx",
853
696
  "columns": [
854
697
  {
855
- "expression": "obligation_id",
698
+ "expression": "group_chain_id",
856
699
  "isExpression": false,
857
700
  "asc": true,
858
701
  "nulls": "last"
859
- }
860
- ],
861
- "isUnique": false,
862
- "concurrently": false,
863
- "method": "btree",
864
- "with": {}
865
- },
866
- "offers_offering_idx": {
867
- "name": "offers_offering_idx",
868
- "columns": [
702
+ },
869
703
  {
870
- "expression": "offering",
704
+ "expression": "group_maker",
871
705
  "isExpression": false,
872
706
  "asc": true,
873
707
  "nulls": "last"
874
- }
875
- ],
876
- "isUnique": false,
877
- "concurrently": false,
878
- "method": "btree",
879
- "with": {}
880
- },
881
- "offers_buy_idx": {
882
- "name": "offers_buy_idx",
883
- "columns": [
708
+ },
884
709
  {
885
- "expression": "buy",
710
+ "expression": "group_group",
886
711
  "isExpression": false,
887
712
  "asc": true,
888
713
  "nulls": "last"
@@ -893,56 +718,29 @@
893
718
  "method": "btree",
894
719
  "with": {}
895
720
  },
896
- "offers_chain_id_idx": {
897
- "name": "offers_chain_id_idx",
721
+ "offers_v2_group_and_hash_idx": {
722
+ "name": "offers_v2_group_and_hash_idx",
898
723
  "columns": [
899
724
  {
900
- "expression": "chain_id",
725
+ "expression": "group_chain_id",
901
726
  "isExpression": false,
902
727
  "asc": true,
903
728
  "nulls": "last"
904
- }
905
- ],
906
- "isUnique": false,
907
- "concurrently": false,
908
- "method": "btree",
909
- "with": {}
910
- },
911
- "offers_loan_token_idx": {
912
- "name": "offers_loan_token_idx",
913
- "columns": [
729
+ },
914
730
  {
915
- "expression": "loan_token",
731
+ "expression": "group_maker",
916
732
  "isExpression": false,
917
733
  "asc": true,
918
734
  "nulls": "last"
919
- }
920
- ],
921
- "isUnique": false,
922
- "concurrently": false,
923
- "method": "btree",
924
- "with": {}
925
- },
926
- "offers_maturity_idx": {
927
- "name": "offers_maturity_idx",
928
- "columns": [
735
+ },
929
736
  {
930
- "expression": "maturity",
737
+ "expression": "group_group",
931
738
  "isExpression": false,
932
739
  "asc": true,
933
740
  "nulls": "last"
934
- }
935
- ],
936
- "isUnique": false,
937
- "concurrently": false,
938
- "method": "btree",
939
- "with": {}
940
- },
941
- "offers_expiry_idx": {
942
- "name": "offers_expiry_idx",
943
- "columns": [
741
+ },
944
742
  {
945
- "expression": "expiry",
743
+ "expression": "hash",
946
744
  "isExpression": false,
947
745
  "asc": true,
948
746
  "nulls": "last"
@@ -953,79 +751,49 @@
953
751
  "method": "btree",
954
752
  "with": {}
955
753
  },
956
- "offers_rate_idx": {
957
- "name": "offers_rate_idx",
754
+ "offers_v2_group_winner_sell_side_idx": {
755
+ "name": "offers_v2_group_winner_sell_side_idx",
958
756
  "columns": [
959
757
  {
960
- "expression": "rate",
758
+ "expression": "group_chain_id",
961
759
  "isExpression": false,
962
760
  "asc": true,
963
761
  "nulls": "last"
964
- }
965
- ],
966
- "isUnique": false,
967
- "concurrently": false,
968
- "method": "btree",
969
- "with": {}
970
- },
971
- "offers_assets_idx": {
972
- "name": "offers_assets_idx",
973
- "columns": [
762
+ },
974
763
  {
975
- "expression": "assets",
764
+ "expression": "group_maker",
976
765
  "isExpression": false,
977
766
  "asc": true,
978
767
  "nulls": "last"
979
- }
980
- ],
981
- "isUnique": false,
982
- "concurrently": false,
983
- "method": "btree",
984
- "with": {}
985
- },
986
- "offers_created_at_idx": {
987
- "name": "offers_created_at_idx",
988
- "columns": [
768
+ },
989
769
  {
990
- "expression": "created_at",
770
+ "expression": "group_group",
991
771
  "isExpression": false,
992
772
  "asc": true,
993
773
  "nulls": "last"
994
- }
995
- ],
996
- "isUnique": false,
997
- "concurrently": false,
998
- "method": "btree",
999
- "with": {}
1000
- },
1001
- "offers_block_number_idx": {
1002
- "name": "offers_block_number_idx",
1003
- "columns": [
774
+ },
1004
775
  {
1005
- "expression": "block_number",
1006
- "isExpression": false,
776
+ "expression": "\"rate\" desc",
1007
777
  "asc": true,
778
+ "isExpression": true,
1008
779
  "nulls": "last"
1009
- }
1010
- ],
1011
- "isUnique": false,
1012
- "concurrently": false,
1013
- "method": "btree",
1014
- "with": {}
1015
- },
1016
- "offers_rate_hash_idx": {
1017
- "name": "offers_rate_hash_idx",
1018
- "columns": [
780
+ },
1019
781
  {
1020
- "expression": "rate",
1021
- "isExpression": false,
782
+ "expression": "\"block_number\" asc",
1022
783
  "asc": true,
784
+ "isExpression": true,
1023
785
  "nulls": "last"
1024
786
  },
1025
787
  {
1026
- "expression": "hash",
1027
- "isExpression": false,
788
+ "expression": "\"assets\" desc",
789
+ "asc": true,
790
+ "isExpression": true,
791
+ "nulls": "last"
792
+ },
793
+ {
794
+ "expression": "\"hash\" asc",
1028
795
  "asc": true,
796
+ "isExpression": true,
1029
797
  "nulls": "last"
1030
798
  }
1031
799
  ],
@@ -1034,61 +802,49 @@
1034
802
  "method": "btree",
1035
803
  "with": {}
1036
804
  },
1037
- "offers_maturity_hash_idx": {
1038
- "name": "offers_maturity_hash_idx",
805
+ "offers_v2_group_winner_buy_side_idx": {
806
+ "name": "offers_v2_group_winner_buy_side_idx",
1039
807
  "columns": [
1040
808
  {
1041
- "expression": "maturity",
809
+ "expression": "group_chain_id",
1042
810
  "isExpression": false,
1043
811
  "asc": true,
1044
812
  "nulls": "last"
1045
813
  },
1046
814
  {
1047
- "expression": "hash",
815
+ "expression": "group_maker",
1048
816
  "isExpression": false,
1049
817
  "asc": true,
1050
818
  "nulls": "last"
1051
- }
1052
- ],
1053
- "isUnique": false,
1054
- "concurrently": false,
1055
- "method": "btree",
1056
- "with": {}
1057
- },
1058
- "offers_expiry_hash_idx": {
1059
- "name": "offers_expiry_hash_idx",
1060
- "columns": [
819
+ },
1061
820
  {
1062
- "expression": "expiry",
821
+ "expression": "group_group",
1063
822
  "isExpression": false,
1064
823
  "asc": true,
1065
824
  "nulls": "last"
1066
825
  },
1067
826
  {
1068
- "expression": "hash",
1069
- "isExpression": false,
827
+ "expression": "\"rate\" asc",
1070
828
  "asc": true,
829
+ "isExpression": true,
1071
830
  "nulls": "last"
1072
- }
1073
- ],
1074
- "isUnique": false,
1075
- "concurrently": false,
1076
- "method": "btree",
1077
- "with": {}
1078
- },
1079
- "offers_assets_hash_idx": {
1080
- "name": "offers_assets_hash_idx",
1081
- "columns": [
831
+ },
1082
832
  {
1083
- "expression": "assets",
1084
- "isExpression": false,
833
+ "expression": "\"block_number\" asc",
1085
834
  "asc": true,
835
+ "isExpression": true,
1086
836
  "nulls": "last"
1087
837
  },
1088
838
  {
1089
- "expression": "hash",
1090
- "isExpression": false,
839
+ "expression": "\"assets\" desc",
840
+ "asc": true,
841
+ "isExpression": true,
842
+ "nulls": "last"
843
+ },
844
+ {
845
+ "expression": "\"hash\" asc",
1091
846
  "asc": true,
847
+ "isExpression": true,
1092
848
  "nulls": "last"
1093
849
  }
1094
850
  ],
@@ -1097,31 +853,19 @@
1097
853
  "method": "btree",
1098
854
  "with": {}
1099
855
  },
1100
- "offers_rate_created_at_assets_hash_idx": {
1101
- "name": "offers_rate_created_at_assets_hash_idx",
856
+ "offers_v2_obligation_id_side_idx": {
857
+ "name": "offers_v2_obligation_id_side_idx",
1102
858
  "columns": [
1103
859
  {
1104
- "expression": "rate",
860
+ "expression": "obligation_id",
1105
861
  "isExpression": false,
1106
862
  "asc": true,
1107
863
  "nulls": "last"
1108
864
  },
1109
865
  {
1110
- "expression": "\"created_at\" asc",
1111
- "asc": true,
1112
- "isExpression": true,
1113
- "nulls": "last"
1114
- },
1115
- {
1116
- "expression": "\"assets\" desc",
1117
- "asc": true,
1118
- "isExpression": true,
1119
- "nulls": "last"
1120
- },
1121
- {
1122
- "expression": "\"hash\" asc",
866
+ "expression": "buy",
867
+ "isExpression": false,
1123
868
  "asc": true,
1124
- "isExpression": true,
1125
869
  "nulls": "last"
1126
870
  }
1127
871
  ],
@@ -1132,15 +876,25 @@
1132
876
  }
1133
877
  },
1134
878
  "foreignKeys": {
1135
- "offers_obligation_id_obligations_obligation_id_fk": {
1136
- "name": "offers_obligation_id_obligations_obligation_id_fk",
1137
- "tableFrom": "offers",
879
+ "offers_v2_obligation_id_obligations_obligation_id_fk": {
880
+ "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
881
+ "tableFrom": "offers_v2",
1138
882
  "tableTo": "obligations",
1139
- "schemaTo": "router_v1.5",
883
+ "schemaTo": "router_v1.6",
1140
884
  "columnsFrom": ["obligation_id"],
1141
885
  "columnsTo": ["obligation_id"],
1142
886
  "onDelete": "cascade",
1143
887
  "onUpdate": "no action"
888
+ },
889
+ "offers_v2_groups_fk": {
890
+ "name": "offers_v2_groups_fk",
891
+ "tableFrom": "offers_v2",
892
+ "tableTo": "groups",
893
+ "schemaTo": "router_v1.6",
894
+ "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
895
+ "columnsTo": ["chain_id", "maker", "group"],
896
+ "onDelete": "cascade",
897
+ "onUpdate": "no action"
1144
898
  }
1145
899
  },
1146
900
  "compositePrimaryKeys": {},
@@ -1149,91 +903,228 @@
1149
903
  "checkConstraints": {},
1150
904
  "isRLSEnabled": false
1151
905
  },
1152
- "router_v1.5.offers_v2": {
1153
- "name": "offers_v2",
1154
- "schema": "router_v1.5",
906
+ "router_v1.6.oracles": {
907
+ "name": "oracles",
908
+ "schema": "router_v1.6",
1155
909
  "columns": {
1156
- "hash": {
1157
- "name": "hash",
1158
- "type": "varchar(66)",
1159
- "primaryKey": true,
910
+ "chain_id": {
911
+ "name": "chain_id",
912
+ "type": "bigint",
913
+ "primaryKey": false,
1160
914
  "notNull": true
1161
915
  },
1162
- "obligation_id": {
1163
- "name": "obligation_id",
1164
- "type": "varchar(66)",
916
+ "address": {
917
+ "name": "address",
918
+ "type": "varchar(42)",
1165
919
  "primaryKey": false,
1166
920
  "notNull": true
1167
921
  },
1168
- "assets": {
1169
- "name": "assets",
922
+ "price": {
923
+ "name": "price",
1170
924
  "type": "numeric(78, 0)",
1171
925
  "primaryKey": false,
926
+ "notNull": false
927
+ },
928
+ "block_number": {
929
+ "name": "block_number",
930
+ "type": "bigint",
931
+ "primaryKey": false,
1172
932
  "notNull": true
1173
933
  },
1174
- "rate": {
1175
- "name": "rate",
1176
- "type": "numeric(78, 0)",
934
+ "updated_at": {
935
+ "name": "updated_at",
936
+ "type": "timestamp",
1177
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,
1178
963
  "notNull": true
1179
964
  },
1180
- "maturity": {
1181
- "name": "maturity",
1182
- "type": "integer",
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",
1183
988
  "primaryKey": false,
1184
989
  "notNull": true
1185
990
  },
1186
- "expiry": {
1187
- "name": "expiry",
1188
- "type": "integer",
991
+ "contract": {
992
+ "name": "contract",
993
+ "type": "varchar(42)",
1189
994
  "primaryKey": false,
1190
995
  "notNull": true
1191
996
  },
1192
- "start": {
1193
- "name": "start",
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",
1194
1005
  "type": "integer",
1195
1006
  "primaryKey": false,
1196
1007
  "notNull": true
1197
1008
  },
1198
- "group_chain_id": {
1199
- "name": "group_chain_id",
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",
1200
1023
  "type": "bigint",
1201
1024
  "primaryKey": false,
1202
1025
  "notNull": true
1203
1026
  },
1204
- "group_maker": {
1205
- "name": "group_maker",
1206
- "type": "varchar(42)",
1027
+ "updated_at": {
1028
+ "name": "updated_at",
1029
+ "type": "timestamp",
1207
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,
1208
1067
  "notNull": true
1209
1068
  },
1210
- "group_group": {
1211
- "name": "group_group",
1212
- "type": "varchar(66)",
1069
+ "code": {
1070
+ "name": "code",
1071
+ "type": "status_code",
1072
+ "typeSchema": "router_v1.6",
1213
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,
1214
1099
  "notNull": true
1215
1100
  },
1216
- "nonce": {
1217
- "name": "nonce",
1218
- "type": "varchar(66)",
1101
+ "chain_id": {
1102
+ "name": "chain_id",
1103
+ "type": "bigint",
1219
1104
  "primaryKey": false,
1220
1105
  "notNull": true
1221
1106
  },
1222
- "buy": {
1223
- "name": "buy",
1224
- "type": "boolean",
1107
+ "contract": {
1108
+ "name": "contract",
1109
+ "type": "varchar(42)",
1225
1110
  "primaryKey": false,
1226
1111
  "notNull": true
1227
1112
  },
1228
- "callback_address": {
1229
- "name": "callback_address",
1113
+ "from": {
1114
+ "name": "from",
1230
1115
  "type": "varchar(42)",
1231
1116
  "primaryKey": false,
1232
1117
  "notNull": true
1233
1118
  },
1234
- "callback_data": {
1235
- "name": "callback_data",
1236
- "type": "text",
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)",
1237
1128
  "primaryKey": false,
1238
1129
  "notNull": true
1239
1130
  },
@@ -1243,8 +1134,8 @@
1243
1134
  "primaryKey": false,
1244
1135
  "notNull": true
1245
1136
  },
1246
- "updated_at": {
1247
- "name": "updated_at",
1137
+ "created_at": {
1138
+ "name": "created_at",
1248
1139
  "type": "timestamp",
1249
1140
  "primaryKey": false,
1250
1141
  "notNull": true,
@@ -1252,23 +1143,35 @@
1252
1143
  }
1253
1144
  },
1254
1145
  "indexes": {
1255
- "offers_v2_group_fk_idx": {
1256
- "name": "offers_v2_group_fk_idx",
1146
+ "transfers_chain_contract_user_idx": {
1147
+ "name": "transfers_chain_contract_user_idx",
1257
1148
  "columns": [
1258
1149
  {
1259
- "expression": "group_chain_id",
1150
+ "expression": "chain_id",
1260
1151
  "isExpression": false,
1261
1152
  "asc": true,
1262
1153
  "nulls": "last"
1263
1154
  },
1264
1155
  {
1265
- "expression": "group_maker",
1156
+ "expression": "contract",
1266
1157
  "isExpression": false,
1267
1158
  "asc": true,
1268
1159
  "nulls": "last"
1269
1160
  },
1270
1161
  {
1271
- "expression": "group_group",
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",
1272
1175
  "isExpression": false,
1273
1176
  "asc": true,
1274
1177
  "nulls": "last"
@@ -1281,23 +1184,23 @@
1281
1184
  }
1282
1185
  },
1283
1186
  "foreignKeys": {
1284
- "offers_v2_obligation_id_obligations_obligation_id_fk": {
1285
- "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
1286
- "tableFrom": "offers_v2",
1287
- "tableTo": "obligations",
1288
- "schemaTo": "router_v1.5",
1289
- "columnsFrom": ["obligation_id"],
1290
- "columnsTo": ["obligation_id"],
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"],
1291
1194
  "onDelete": "cascade",
1292
1195
  "onUpdate": "no action"
1293
1196
  },
1294
- "offers_v2_groups_fk": {
1295
- "name": "offers_v2_groups_fk",
1296
- "tableFrom": "offers_v2",
1297
- "tableTo": "groups",
1298
- "schemaTo": "router_v1.5",
1299
- "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1300
- "columnsTo": ["chain_id", "maker", "group"],
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"],
1301
1204
  "onDelete": "cascade",
1302
1205
  "onUpdate": "no action"
1303
1206
  }
@@ -1308,25 +1211,19 @@
1308
1211
  "checkConstraints": {},
1309
1212
  "isRLSEnabled": false
1310
1213
  },
1311
- "router_v1.5.oracles": {
1312
- "name": "oracles",
1313
- "schema": "router_v1.5",
1214
+ "router_v1.6.validations": {
1215
+ "name": "validations",
1216
+ "schema": "router_v1.6",
1314
1217
  "columns": {
1315
- "chain_id": {
1316
- "name": "chain_id",
1317
- "type": "bigint",
1318
- "primaryKey": false,
1319
- "notNull": true
1320
- },
1321
- "address": {
1322
- "name": "address",
1323
- "type": "varchar(42)",
1324
- "primaryKey": false,
1218
+ "offer_hash": {
1219
+ "name": "offer_hash",
1220
+ "type": "varchar(66)",
1221
+ "primaryKey": true,
1325
1222
  "notNull": true
1326
1223
  },
1327
- "block_number": {
1328
- "name": "block_number",
1329
- "type": "bigint",
1224
+ "status_id": {
1225
+ "name": "status_id",
1226
+ "type": "integer",
1330
1227
  "primaryKey": false,
1331
1228
  "notNull": true
1332
1229
  },
@@ -1339,56 +1236,45 @@
1339
1236
  }
1340
1237
  },
1341
1238
  "indexes": {},
1342
- "foreignKeys": {},
1343
- "compositePrimaryKeys": {
1344
- "oracles_pk": {
1345
- "name": "oracles_pk",
1346
- "columns": ["chain_id", "address"]
1347
- }
1348
- },
1349
- "uniqueConstraints": {},
1350
- "policies": {},
1351
- "checkConstraints": {},
1352
- "isRLSEnabled": false
1353
- },
1354
- "router_v1.5.status": {
1355
- "name": "status",
1356
- "schema": "router_v1.5",
1357
- "columns": {
1358
- "id": {
1359
- "name": "id",
1360
- "type": "serial",
1361
- "primaryKey": true,
1362
- "notNull": true
1239
+ "foreignKeys": {
1240
+ "validations_offer_hash_offers_v2_hash_fk": {
1241
+ "name": "validations_offer_hash_offers_v2_hash_fk",
1242
+ "tableFrom": "validations",
1243
+ "tableTo": "offers_v2",
1244
+ "schemaTo": "router_v1.6",
1245
+ "columnsFrom": ["offer_hash"],
1246
+ "columnsTo": ["hash"],
1247
+ "onDelete": "cascade",
1248
+ "onUpdate": "no action"
1363
1249
  },
1364
- "code": {
1365
- "name": "code",
1366
- "type": "status_code",
1367
- "typeSchema": "router_v1.5",
1368
- "primaryKey": false,
1369
- "notNull": false
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"
1370
1259
  }
1371
1260
  },
1372
- "indexes": {},
1373
- "foreignKeys": {},
1374
1261
  "compositePrimaryKeys": {},
1375
- "uniqueConstraints": {
1376
- "status_code_unique": {
1377
- "name": "status_code_unique",
1378
- "nullsNotDistinct": false,
1379
- "columns": ["code"]
1380
- }
1381
- },
1262
+ "uniqueConstraints": {},
1382
1263
  "policies": {},
1383
1264
  "checkConstraints": {},
1384
1265
  "isRLSEnabled": false
1385
1266
  }
1386
1267
  },
1387
1268
  "enums": {
1388
- "router_v1.5.status_code": {
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": {
1389
1275
  "name": "status_code",
1390
- "schema": "router_v1.5",
1391
- "values": ["VALID", "NOT_ENOUGH_LIQUIDITY"]
1276
+ "schema": "router_v1.6",
1277
+ "values": ["VALID", "SIMULATION_ERROR"]
1392
1278
  }
1393
1279
  },
1394
1280
  "schemas": {},