@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
@@ -1,12 +1,66 @@
1
1
  {
2
- "id": "2711b2a7-fa21-472d-ac88-455b90d74bd1",
3
- "prevId": "e727a4ad-079c-4533-a86c-decd25a74e04",
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",
@@ -53,9 +107,9 @@
53
107
  }
54
108
  ],
55
109
  "isUnique": true,
56
- "with": {},
110
+ "concurrently": false,
57
111
  "method": "btree",
58
- "concurrently": false
112
+ "with": {}
59
113
  }
60
114
  },
61
115
  "foreignKeys": {},
@@ -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",
@@ -126,9 +180,9 @@
126
180
  }
127
181
  ],
128
182
  "isUnique": true,
129
- "with": {},
183
+ "concurrently": false,
130
184
  "method": "btree",
131
- "concurrently": false
185
+ "with": {}
132
186
  }
133
187
  },
134
188
  "foreignKeys": {},
@@ -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,40 +251,60 @@
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",
213
- "isExpression": true,
275
+ "expression": "block_number",
276
+ "isExpression": false,
214
277
  "asc": true,
215
278
  "nulls": "last"
216
279
  }
217
280
  ],
218
281
  "isUnique": false,
219
- "with": {},
282
+ "concurrently": false,
220
283
  "method": "btree",
221
- "concurrently": false
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"
222
297
  }
223
298
  },
224
- "foreignKeys": {},
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,220 +344,46 @@
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
- "with": {},
335
- "method": "btree",
336
- "concurrently": false
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
- "with": {},
350
- "method": "btree",
351
- "concurrently": false
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
- "columnsFrom": ["parent_pool_id"],
359
- "tableTo": "liquidity_pools",
360
- "schemaTo": "router_v1.5",
361
- "columnsTo": ["id"],
362
- "onUpdate": "no action",
363
- "onDelete": "cascade"
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
- "columnsFrom": ["child_pool_id"],
369
- "tableTo": "liquidity_pools",
370
- "schemaTo": "router_v1.5",
371
- "columnsTo": ["id"],
372
- "onUpdate": "no action",
373
- "onDelete": "cascade"
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"
463
374
  }
464
375
  ],
465
376
  "isUnique": false,
466
- "with": {},
377
+ "concurrently": false,
467
378
  "method": "btree",
468
- "concurrently": false
469
- }
470
- },
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
- "columnsFrom": ["obligation_id"],
476
- "tableTo": "obligations",
477
- "schemaTo": "router_v1.5",
478
- "columnsTo": ["obligation_id"],
479
- "onUpdate": "no action",
480
- "onDelete": "cascade"
379
+ "with": {}
481
380
  }
482
381
  },
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",
@@ -551,9 +451,9 @@
551
451
  }
552
452
  ],
553
453
  "isUnique": false,
554
- "with": {},
454
+ "concurrently": false,
555
455
  "method": "btree",
556
- "concurrently": false
456
+ "with": {}
557
457
  },
558
458
  "obligation_collaterals_v2_oracle_fk_idx": {
559
459
  "name": "obligation_collaterals_v2_oracle_fk_idx",
@@ -572,31 +472,31 @@
572
472
  }
573
473
  ],
574
474
  "isUnique": false,
575
- "with": {},
475
+ "concurrently": false,
576
476
  "method": "btree",
577
- "concurrently": false
477
+ "with": {}
578
478
  }
579
479
  },
580
480
  "foreignKeys": {
581
481
  "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk": {
582
482
  "name": "obligation_collaterals_v2_obligation_id_obligations_obligation_id_fk",
583
483
  "tableFrom": "obligation_collaterals_v2",
584
- "columnsFrom": ["obligation_id"],
585
484
  "tableTo": "obligations",
586
- "schemaTo": "router_v1.5",
485
+ "schemaTo": "router_v1.6",
486
+ "columnsFrom": ["obligation_id"],
587
487
  "columnsTo": ["obligation_id"],
588
- "onUpdate": "no action",
589
- "onDelete": "cascade"
488
+ "onDelete": "cascade",
489
+ "onUpdate": "no action"
590
490
  },
591
491
  "obligation_collaterals_v2_oracles_fk": {
592
492
  "name": "obligation_collaterals_v2_oracles_fk",
593
493
  "tableFrom": "obligation_collaterals_v2",
594
- "columnsFrom": ["oracle_chain_id", "oracle_address"],
595
494
  "tableTo": "oracles",
596
- "schemaTo": "router_v1.5",
495
+ "schemaTo": "router_v1.6",
496
+ "columnsFrom": ["oracle_chain_id", "oracle_address"],
597
497
  "columnsTo": ["chain_id", "address"],
598
- "onUpdate": "no action",
599
- "onDelete": "no action"
498
+ "onDelete": "no action",
499
+ "onUpdate": "no action"
600
500
  }
601
501
  },
602
502
  "compositePrimaryKeys": {
@@ -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
- "with": {},
699
- "method": "btree",
700
- "concurrently": false
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",
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",
707
574
  "columnsFrom": ["offer_hash"],
708
- "tableTo": "offers",
709
- "schemaTo": "router_v1.5",
710
575
  "columnsTo": ["hash"],
711
- "onUpdate": "no action",
712
- "onDelete": "cascade"
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
- "columnsFrom": ["pool_id"],
718
- "tableTo": "liquidity_pools",
719
- "schemaTo": "router_v1.5",
720
- "columnsTo": ["id"],
721
- "onUpdate": "no action",
722
- "onDelete": "cascade"
576
+ "onDelete": "cascade",
577
+ "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,71 +588,12 @@
733
588
  "checkConstraints": {},
734
589
  "isRLSEnabled": false
735
590
  },
736
- "router_v1.5.offer_status": {
737
- "name": "offer_status",
738
- "schema": "router_v1.5",
591
+ "router_v1.6.offers_v2": {
592
+ "name": "offers_v2",
593
+ "schema": "router_v1.6",
739
594
  "columns": {
740
- "offer_hash": {
741
- "name": "offer_hash",
742
- "type": "varchar(66)",
743
- "primaryKey": true,
744
- "notNull": true
745
- },
746
- "status_id": {
747
- "name": "status_id",
748
- "type": "serial",
749
- "primaryKey": false,
750
- "notNull": true
751
- },
752
- "block_number": {
753
- "name": "block_number",
754
- "type": "bigint",
755
- "primaryKey": false,
756
- "notNull": true
757
- },
758
- "updated_at": {
759
- "name": "updated_at",
760
- "type": "timestamp",
761
- "primaryKey": false,
762
- "notNull": true,
763
- "default": "now()"
764
- }
765
- },
766
- "indexes": {},
767
- "foreignKeys": {
768
- "offer_status_offer_hash_offers_v2_hash_fk": {
769
- "name": "offer_status_offer_hash_offers_v2_hash_fk",
770
- "tableFrom": "offer_status",
771
- "columnsFrom": ["offer_hash"],
772
- "tableTo": "offers_v2",
773
- "schemaTo": "router_v1.5",
774
- "columnsTo": ["hash"],
775
- "onUpdate": "no action",
776
- "onDelete": "cascade"
777
- },
778
- "offer_status_status_id_status_id_fk": {
779
- "name": "offer_status_status_id_status_id_fk",
780
- "tableFrom": "offer_status",
781
- "columnsFrom": ["status_id"],
782
- "tableTo": "status",
783
- "schemaTo": "router_v1.5",
784
- "columnsTo": ["id"],
785
- "onUpdate": "no action",
786
- "onDelete": "cascade"
787
- }
788
- },
789
- "compositePrimaryKeys": {},
790
- "uniqueConstraints": {},
791
- "policies": {},
792
- "checkConstraints": {},
793
- "isRLSEnabled": false
794
- },
795
- "router_v1.5.offers": {
796
- "name": "offers",
797
- "schema": "router_v1.5",
798
- "columns": {
799
- "hash": {
800
- "name": "hash",
595
+ "hash": {
596
+ "name": "hash",
801
597
  "type": "varchar(66)",
802
598
  "primaryKey": true,
803
599
  "notNull": true
@@ -808,12 +604,6 @@
808
604
  "primaryKey": false,
809
605
  "notNull": true
810
606
  },
811
- "offering": {
812
- "name": "offering",
813
- "type": "varchar(42)",
814
- "primaryKey": false,
815
- "notNull": true
816
- },
817
607
  "assets": {
818
608
  "name": "assets",
819
609
  "type": "numeric(78, 0)",
@@ -822,7 +612,7 @@
822
612
  },
823
613
  "rate": {
824
614
  "name": "rate",
825
- "type": "bigint",
615
+ "type": "numeric(78, 0)",
826
616
  "primaryKey": false,
827
617
  "notNull": true
828
618
  },
@@ -844,27 +634,33 @@
844
634
  "primaryKey": false,
845
635
  "notNull": true
846
636
  },
847
- "nonce": {
848
- "name": "nonce",
637
+ "group_chain_id": {
638
+ "name": "group_chain_id",
849
639
  "type": "bigint",
850
640
  "primaryKey": false,
851
641
  "notNull": true
852
642
  },
853
- "buy": {
854
- "name": "buy",
855
- "type": "boolean",
643
+ "group_maker": {
644
+ "name": "group_maker",
645
+ "type": "varchar(42)",
856
646
  "primaryKey": false,
857
647
  "notNull": true
858
648
  },
859
- "chain_id": {
860
- "name": "chain_id",
861
- "type": "bigint",
649
+ "group_group": {
650
+ "name": "group_group",
651
+ "type": "varchar(66)",
862
652
  "primaryKey": false,
863
653
  "notNull": true
864
654
  },
865
- "loan_token": {
866
- "name": "loan_token",
867
- "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",
868
664
  "primaryKey": false,
869
665
  "notNull": true
870
666
  },
@@ -880,326 +676,225 @@
880
676
  "primaryKey": false,
881
677
  "notNull": true
882
678
  },
883
- "callback_gas_limit": {
884
- "name": "callback_gas_limit",
679
+ "block_number": {
680
+ "name": "block_number",
885
681
  "type": "bigint",
886
682
  "primaryKey": false,
887
683
  "notNull": true
888
684
  },
889
- "signature": {
890
- "name": "signature",
891
- "type": "varchar(132)",
892
- "primaryKey": false,
893
- "notNull": false
894
- },
895
- "created_at": {
896
- "name": "created_at",
685
+ "updated_at": {
686
+ "name": "updated_at",
897
687
  "type": "timestamp",
898
688
  "primaryKey": false,
899
689
  "notNull": true,
900
690
  "default": "now()"
901
- },
902
- "block_number": {
903
- "name": "block_number",
904
- "type": "bigint",
905
- "primaryKey": false,
906
- "notNull": true
907
691
  }
908
692
  },
909
693
  "indexes": {
910
- "offers_obligation_id_idx": {
911
- "name": "offers_obligation_id_idx",
694
+ "offers_v2_group_fk_idx": {
695
+ "name": "offers_v2_group_fk_idx",
912
696
  "columns": [
913
697
  {
914
- "expression": "obligation_id",
698
+ "expression": "group_chain_id",
915
699
  "isExpression": false,
916
700
  "asc": true,
917
701
  "nulls": "last"
918
- }
919
- ],
920
- "isUnique": false,
921
- "with": {},
922
- "method": "btree",
923
- "concurrently": false
924
- },
925
- "offers_offering_idx": {
926
- "name": "offers_offering_idx",
927
- "columns": [
702
+ },
928
703
  {
929
- "expression": "offering",
704
+ "expression": "group_maker",
930
705
  "isExpression": false,
931
706
  "asc": true,
932
707
  "nulls": "last"
933
- }
934
- ],
935
- "isUnique": false,
936
- "with": {},
937
- "method": "btree",
938
- "concurrently": false
939
- },
940
- "offers_buy_idx": {
941
- "name": "offers_buy_idx",
942
- "columns": [
708
+ },
943
709
  {
944
- "expression": "buy",
710
+ "expression": "group_group",
945
711
  "isExpression": false,
946
712
  "asc": true,
947
713
  "nulls": "last"
948
714
  }
949
715
  ],
950
716
  "isUnique": false,
951
- "with": {},
717
+ "concurrently": false,
952
718
  "method": "btree",
953
- "concurrently": false
719
+ "with": {}
954
720
  },
955
- "offers_chain_id_idx": {
956
- "name": "offers_chain_id_idx",
721
+ "offers_v2_group_and_hash_idx": {
722
+ "name": "offers_v2_group_and_hash_idx",
957
723
  "columns": [
958
724
  {
959
- "expression": "chain_id",
725
+ "expression": "group_chain_id",
960
726
  "isExpression": false,
961
727
  "asc": true,
962
728
  "nulls": "last"
963
- }
964
- ],
965
- "isUnique": false,
966
- "with": {},
967
- "method": "btree",
968
- "concurrently": false
969
- },
970
- "offers_loan_token_idx": {
971
- "name": "offers_loan_token_idx",
972
- "columns": [
729
+ },
973
730
  {
974
- "expression": "loan_token",
731
+ "expression": "group_maker",
975
732
  "isExpression": false,
976
733
  "asc": true,
977
734
  "nulls": "last"
978
- }
979
- ],
980
- "isUnique": false,
981
- "with": {},
982
- "method": "btree",
983
- "concurrently": false
984
- },
985
- "offers_maturity_idx": {
986
- "name": "offers_maturity_idx",
987
- "columns": [
735
+ },
988
736
  {
989
- "expression": "maturity",
737
+ "expression": "group_group",
990
738
  "isExpression": false,
991
739
  "asc": true,
992
740
  "nulls": "last"
993
- }
994
- ],
995
- "isUnique": false,
996
- "with": {},
997
- "method": "btree",
998
- "concurrently": false
999
- },
1000
- "offers_expiry_idx": {
1001
- "name": "offers_expiry_idx",
1002
- "columns": [
741
+ },
1003
742
  {
1004
- "expression": "expiry",
743
+ "expression": "hash",
1005
744
  "isExpression": false,
1006
745
  "asc": true,
1007
746
  "nulls": "last"
1008
747
  }
1009
748
  ],
1010
749
  "isUnique": false,
1011
- "with": {},
750
+ "concurrently": false,
1012
751
  "method": "btree",
1013
- "concurrently": false
752
+ "with": {}
1014
753
  },
1015
- "offers_rate_idx": {
1016
- "name": "offers_rate_idx",
754
+ "offers_v2_group_winner_sell_side_idx": {
755
+ "name": "offers_v2_group_winner_sell_side_idx",
1017
756
  "columns": [
1018
757
  {
1019
- "expression": "rate",
758
+ "expression": "group_chain_id",
1020
759
  "isExpression": false,
1021
760
  "asc": true,
1022
761
  "nulls": "last"
1023
- }
1024
- ],
1025
- "isUnique": false,
1026
- "with": {},
1027
- "method": "btree",
1028
- "concurrently": false
1029
- },
1030
- "offers_assets_idx": {
1031
- "name": "offers_assets_idx",
1032
- "columns": [
762
+ },
1033
763
  {
1034
- "expression": "assets",
764
+ "expression": "group_maker",
1035
765
  "isExpression": false,
1036
766
  "asc": true,
1037
767
  "nulls": "last"
1038
- }
1039
- ],
1040
- "isUnique": false,
1041
- "with": {},
1042
- "method": "btree",
1043
- "concurrently": false
1044
- },
1045
- "offers_created_at_idx": {
1046
- "name": "offers_created_at_idx",
1047
- "columns": [
768
+ },
1048
769
  {
1049
- "expression": "created_at",
770
+ "expression": "group_group",
1050
771
  "isExpression": false,
1051
772
  "asc": true,
1052
773
  "nulls": "last"
1053
- }
1054
- ],
1055
- "isUnique": false,
1056
- "with": {},
1057
- "method": "btree",
1058
- "concurrently": false
1059
- },
1060
- "offers_block_number_idx": {
1061
- "name": "offers_block_number_idx",
1062
- "columns": [
774
+ },
1063
775
  {
1064
- "expression": "block_number",
1065
- "isExpression": false,
776
+ "expression": "\"rate\" desc",
1066
777
  "asc": true,
778
+ "isExpression": true,
1067
779
  "nulls": "last"
1068
- }
1069
- ],
1070
- "isUnique": false,
1071
- "with": {},
1072
- "method": "btree",
1073
- "concurrently": false
1074
- },
1075
- "offers_rate_hash_idx": {
1076
- "name": "offers_rate_hash_idx",
1077
- "columns": [
780
+ },
1078
781
  {
1079
- "expression": "rate",
1080
- "isExpression": false,
782
+ "expression": "\"block_number\" asc",
1081
783
  "asc": true,
784
+ "isExpression": true,
1082
785
  "nulls": "last"
1083
786
  },
1084
787
  {
1085
- "expression": "hash",
1086
- "isExpression": false,
788
+ "expression": "\"assets\" desc",
789
+ "asc": true,
790
+ "isExpression": true,
791
+ "nulls": "last"
792
+ },
793
+ {
794
+ "expression": "\"hash\" asc",
1087
795
  "asc": true,
796
+ "isExpression": true,
1088
797
  "nulls": "last"
1089
798
  }
1090
799
  ],
1091
800
  "isUnique": false,
1092
- "with": {},
801
+ "concurrently": false,
1093
802
  "method": "btree",
1094
- "concurrently": false
803
+ "with": {}
1095
804
  },
1096
- "offers_maturity_hash_idx": {
1097
- "name": "offers_maturity_hash_idx",
805
+ "offers_v2_group_winner_buy_side_idx": {
806
+ "name": "offers_v2_group_winner_buy_side_idx",
1098
807
  "columns": [
1099
808
  {
1100
- "expression": "maturity",
809
+ "expression": "group_chain_id",
1101
810
  "isExpression": false,
1102
811
  "asc": true,
1103
812
  "nulls": "last"
1104
813
  },
1105
814
  {
1106
- "expression": "hash",
815
+ "expression": "group_maker",
1107
816
  "isExpression": false,
1108
817
  "asc": true,
1109
818
  "nulls": "last"
1110
- }
1111
- ],
1112
- "isUnique": false,
1113
- "with": {},
1114
- "method": "btree",
1115
- "concurrently": false
1116
- },
1117
- "offers_expiry_hash_idx": {
1118
- "name": "offers_expiry_hash_idx",
1119
- "columns": [
819
+ },
1120
820
  {
1121
- "expression": "expiry",
821
+ "expression": "group_group",
1122
822
  "isExpression": false,
1123
823
  "asc": true,
1124
824
  "nulls": "last"
1125
825
  },
1126
826
  {
1127
- "expression": "hash",
1128
- "isExpression": false,
827
+ "expression": "\"rate\" asc",
1129
828
  "asc": true,
829
+ "isExpression": true,
1130
830
  "nulls": "last"
1131
- }
1132
- ],
1133
- "isUnique": false,
1134
- "with": {},
1135
- "method": "btree",
1136
- "concurrently": false
1137
- },
1138
- "offers_assets_hash_idx": {
1139
- "name": "offers_assets_hash_idx",
1140
- "columns": [
831
+ },
1141
832
  {
1142
- "expression": "assets",
1143
- "isExpression": false,
833
+ "expression": "\"block_number\" asc",
834
+ "asc": true,
835
+ "isExpression": true,
836
+ "nulls": "last"
837
+ },
838
+ {
839
+ "expression": "\"assets\" desc",
1144
840
  "asc": true,
841
+ "isExpression": true,
1145
842
  "nulls": "last"
1146
843
  },
1147
844
  {
1148
- "expression": "hash",
1149
- "isExpression": false,
845
+ "expression": "\"hash\" asc",
1150
846
  "asc": true,
847
+ "isExpression": true,
1151
848
  "nulls": "last"
1152
849
  }
1153
850
  ],
1154
851
  "isUnique": false,
1155
- "with": {},
852
+ "concurrently": false,
1156
853
  "method": "btree",
1157
- "concurrently": false
854
+ "with": {}
1158
855
  },
1159
- "offers_rate_created_at_assets_hash_idx": {
1160
- "name": "offers_rate_created_at_assets_hash_idx",
856
+ "offers_v2_obligation_id_side_idx": {
857
+ "name": "offers_v2_obligation_id_side_idx",
1161
858
  "columns": [
1162
859
  {
1163
- "expression": "rate",
860
+ "expression": "obligation_id",
1164
861
  "isExpression": false,
1165
862
  "asc": true,
1166
863
  "nulls": "last"
1167
864
  },
1168
865
  {
1169
- "expression": "\"created_at\" asc",
1170
- "isExpression": true,
1171
- "asc": true,
1172
- "nulls": "last"
1173
- },
1174
- {
1175
- "expression": "\"assets\" desc",
1176
- "isExpression": true,
1177
- "asc": true,
1178
- "nulls": "last"
1179
- },
1180
- {
1181
- "expression": "\"hash\" asc",
1182
- "isExpression": true,
866
+ "expression": "buy",
867
+ "isExpression": false,
1183
868
  "asc": true,
1184
869
  "nulls": "last"
1185
870
  }
1186
871
  ],
1187
872
  "isUnique": false,
1188
- "with": {},
873
+ "concurrently": false,
1189
874
  "method": "btree",
1190
- "concurrently": false
875
+ "with": {}
1191
876
  }
1192
877
  },
1193
878
  "foreignKeys": {
1194
- "offers_obligation_id_obligations_obligation_id_fk": {
1195
- "name": "offers_obligation_id_obligations_obligation_id_fk",
1196
- "tableFrom": "offers",
1197
- "columnsFrom": ["obligation_id"],
879
+ "offers_v2_obligation_id_obligations_obligation_id_fk": {
880
+ "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
881
+ "tableFrom": "offers_v2",
1198
882
  "tableTo": "obligations",
1199
- "schemaTo": "router_v1.5",
883
+ "schemaTo": "router_v1.6",
884
+ "columnsFrom": ["obligation_id"],
1200
885
  "columnsTo": ["obligation_id"],
1201
- "onUpdate": "no action",
1202
- "onDelete": "cascade"
886
+ "onDelete": "cascade",
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"
1203
898
  }
1204
899
  },
1205
900
  "compositePrimaryKeys": {},
@@ -1208,91 +903,228 @@
1208
903
  "checkConstraints": {},
1209
904
  "isRLSEnabled": false
1210
905
  },
1211
- "router_v1.5.offers_v2": {
1212
- "name": "offers_v2",
1213
- "schema": "router_v1.5",
906
+ "router_v1.6.oracles": {
907
+ "name": "oracles",
908
+ "schema": "router_v1.6",
1214
909
  "columns": {
1215
- "hash": {
1216
- "name": "hash",
1217
- "type": "varchar(66)",
1218
- "primaryKey": true,
910
+ "chain_id": {
911
+ "name": "chain_id",
912
+ "type": "bigint",
913
+ "primaryKey": false,
1219
914
  "notNull": true
1220
915
  },
1221
- "obligation_id": {
1222
- "name": "obligation_id",
1223
- "type": "varchar(66)",
916
+ "address": {
917
+ "name": "address",
918
+ "type": "varchar(42)",
1224
919
  "primaryKey": false,
1225
920
  "notNull": true
1226
921
  },
1227
- "assets": {
1228
- "name": "assets",
922
+ "price": {
923
+ "name": "price",
1229
924
  "type": "numeric(78, 0)",
1230
925
  "primaryKey": false,
926
+ "notNull": false
927
+ },
928
+ "block_number": {
929
+ "name": "block_number",
930
+ "type": "bigint",
931
+ "primaryKey": false,
1231
932
  "notNull": true
1232
933
  },
1233
- "rate": {
1234
- "name": "rate",
1235
- "type": "numeric(78, 0)",
934
+ "updated_at": {
935
+ "name": "updated_at",
936
+ "type": "timestamp",
1236
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,
1237
963
  "notNull": true
1238
964
  },
1239
- "maturity": {
1240
- "name": "maturity",
1241
- "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",
1242
988
  "primaryKey": false,
1243
989
  "notNull": true
1244
990
  },
1245
- "expiry": {
1246
- "name": "expiry",
1247
- "type": "integer",
991
+ "contract": {
992
+ "name": "contract",
993
+ "type": "varchar(42)",
1248
994
  "primaryKey": false,
1249
995
  "notNull": true
1250
996
  },
1251
- "start": {
1252
- "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",
1253
1005
  "type": "integer",
1254
1006
  "primaryKey": false,
1255
1007
  "notNull": true
1256
1008
  },
1257
- "group_chain_id": {
1258
- "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",
1259
1023
  "type": "bigint",
1260
1024
  "primaryKey": false,
1261
1025
  "notNull": true
1262
1026
  },
1263
- "group_maker": {
1264
- "name": "group_maker",
1265
- "type": "varchar(42)",
1027
+ "updated_at": {
1028
+ "name": "updated_at",
1029
+ "type": "timestamp",
1266
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,
1267
1067
  "notNull": true
1268
1068
  },
1269
- "group_group": {
1270
- "name": "group_group",
1271
- "type": "varchar(66)",
1069
+ "code": {
1070
+ "name": "code",
1071
+ "type": "status_code",
1072
+ "typeSchema": "router_v1.6",
1272
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,
1273
1099
  "notNull": true
1274
1100
  },
1275
- "nonce": {
1276
- "name": "nonce",
1277
- "type": "varchar(66)",
1101
+ "chain_id": {
1102
+ "name": "chain_id",
1103
+ "type": "bigint",
1278
1104
  "primaryKey": false,
1279
1105
  "notNull": true
1280
1106
  },
1281
- "buy": {
1282
- "name": "buy",
1283
- "type": "boolean",
1107
+ "contract": {
1108
+ "name": "contract",
1109
+ "type": "varchar(42)",
1284
1110
  "primaryKey": false,
1285
1111
  "notNull": true
1286
1112
  },
1287
- "callback_address": {
1288
- "name": "callback_address",
1113
+ "from": {
1114
+ "name": "from",
1289
1115
  "type": "varchar(42)",
1290
1116
  "primaryKey": false,
1291
1117
  "notNull": true
1292
1118
  },
1293
- "callback_data": {
1294
- "name": "callback_data",
1295
- "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)",
1296
1128
  "primaryKey": false,
1297
1129
  "notNull": true
1298
1130
  },
@@ -1302,8 +1134,8 @@
1302
1134
  "primaryKey": false,
1303
1135
  "notNull": true
1304
1136
  },
1305
- "updated_at": {
1306
- "name": "updated_at",
1137
+ "created_at": {
1138
+ "name": "created_at",
1307
1139
  "type": "timestamp",
1308
1140
  "primaryKey": false,
1309
1141
  "notNull": true,
@@ -1311,54 +1143,66 @@
1311
1143
  }
1312
1144
  },
1313
1145
  "indexes": {
1314
- "offers_v2_group_fk_idx": {
1315
- "name": "offers_v2_group_fk_idx",
1146
+ "transfers_chain_contract_user_idx": {
1147
+ "name": "transfers_chain_contract_user_idx",
1316
1148
  "columns": [
1317
1149
  {
1318
- "expression": "group_chain_id",
1150
+ "expression": "chain_id",
1319
1151
  "isExpression": false,
1320
1152
  "asc": true,
1321
1153
  "nulls": "last"
1322
1154
  },
1323
1155
  {
1324
- "expression": "group_maker",
1156
+ "expression": "contract",
1325
1157
  "isExpression": false,
1326
1158
  "asc": true,
1327
1159
  "nulls": "last"
1328
1160
  },
1329
1161
  {
1330
- "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",
1331
1175
  "isExpression": false,
1332
1176
  "asc": true,
1333
1177
  "nulls": "last"
1334
1178
  }
1335
1179
  ],
1336
1180
  "isUnique": false,
1337
- "with": {},
1181
+ "concurrently": false,
1338
1182
  "method": "btree",
1339
- "concurrently": false
1183
+ "with": {}
1340
1184
  }
1341
1185
  },
1342
1186
  "foreignKeys": {
1343
- "offers_v2_obligation_id_obligations_obligation_id_fk": {
1344
- "name": "offers_v2_obligation_id_obligations_obligation_id_fk",
1345
- "tableFrom": "offers_v2",
1346
- "columnsFrom": ["obligation_id"],
1347
- "tableTo": "obligations",
1348
- "schemaTo": "router_v1.5",
1349
- "columnsTo": ["obligation_id"],
1350
- "onUpdate": "no action",
1351
- "onDelete": "cascade"
1352
- },
1353
- "offers_v2_groups_fk": {
1354
- "name": "offers_v2_groups_fk",
1355
- "tableFrom": "offers_v2",
1356
- "columnsFrom": ["group_chain_id", "group_maker", "group_group"],
1357
- "tableTo": "groups",
1358
- "schemaTo": "router_v1.5",
1359
- "columnsTo": ["chain_id", "maker", "group"],
1360
- "onUpdate": "no action",
1361
- "onDelete": "cascade"
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"
1362
1206
  }
1363
1207
  },
1364
1208
  "compositePrimaryKeys": {},
@@ -1367,25 +1211,19 @@
1367
1211
  "checkConstraints": {},
1368
1212
  "isRLSEnabled": false
1369
1213
  },
1370
- "router_v1.5.oracles": {
1371
- "name": "oracles",
1372
- "schema": "router_v1.5",
1214
+ "router_v1.6.validations": {
1215
+ "name": "validations",
1216
+ "schema": "router_v1.6",
1373
1217
  "columns": {
1374
- "chain_id": {
1375
- "name": "chain_id",
1376
- "type": "bigint",
1377
- "primaryKey": false,
1378
- "notNull": true
1379
- },
1380
- "address": {
1381
- "name": "address",
1382
- "type": "varchar(42)",
1383
- "primaryKey": false,
1218
+ "offer_hash": {
1219
+ "name": "offer_hash",
1220
+ "type": "varchar(66)",
1221
+ "primaryKey": true,
1384
1222
  "notNull": true
1385
1223
  },
1386
- "block_number": {
1387
- "name": "block_number",
1388
- "type": "bigint",
1224
+ "status_id": {
1225
+ "name": "status_id",
1226
+ "type": "integer",
1389
1227
  "primaryKey": false,
1390
1228
  "notNull": true
1391
1229
  },
@@ -1398,63 +1236,52 @@
1398
1236
  }
1399
1237
  },
1400
1238
  "indexes": {},
1401
- "foreignKeys": {},
1402
- "compositePrimaryKeys": {
1403
- "oracles_pk": {
1404
- "name": "oracles_pk",
1405
- "columns": ["chain_id", "address"]
1406
- }
1407
- },
1408
- "uniqueConstraints": {},
1409
- "policies": {},
1410
- "checkConstraints": {},
1411
- "isRLSEnabled": false
1412
- },
1413
- "router_v1.5.status": {
1414
- "name": "status",
1415
- "schema": "router_v1.5",
1416
- "columns": {
1417
- "id": {
1418
- "name": "id",
1419
- "type": "serial",
1420
- "primaryKey": true,
1421
- "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"
1422
1249
  },
1423
- "code": {
1424
- "name": "code",
1425
- "type": "status_code",
1426
- "typeSchema": "router_v1.5",
1427
- "primaryKey": false,
1428
- "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"
1429
1259
  }
1430
1260
  },
1431
- "indexes": {},
1432
- "foreignKeys": {},
1433
1261
  "compositePrimaryKeys": {},
1434
- "uniqueConstraints": {
1435
- "status_code_unique": {
1436
- "name": "status_code_unique",
1437
- "columns": ["code"],
1438
- "nullsNotDistinct": false
1439
- }
1440
- },
1262
+ "uniqueConstraints": {},
1441
1263
  "policies": {},
1442
1264
  "checkConstraints": {},
1443
1265
  "isRLSEnabled": false
1444
1266
  }
1445
1267
  },
1446
1268
  "enums": {
1447
- "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": {
1448
1275
  "name": "status_code",
1449
- "schema": "router_v1.5",
1450
- "values": ["VALID", "NOT_ENOUGH_LIQUIDITY"]
1276
+ "schema": "router_v1.6",
1277
+ "values": ["VALID", "SIMULATION_ERROR"]
1451
1278
  }
1452
1279
  },
1453
1280
  "schemas": {},
1454
- "views": {},
1455
1281
  "sequences": {},
1456
1282
  "roles": {},
1457
1283
  "policies": {},
1284
+ "views": {},
1458
1285
  "_meta": {
1459
1286
  "columns": {},
1460
1287
  "schemas": {},