@dhedge/backend-flatcoin-core 0.3.21 → 0.3.22

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.
@@ -11,7 +11,8 @@ export declare enum BlockchainCode {
11
11
  ARBITRUM = "ARBITRUM"
12
12
  }
13
13
  export declare enum Market {
14
- RETH_BASE = "RETH_BASE"
14
+ RETH_BASE = "RETH_BASE",
15
+ WBTC_OPTIMISM = "WBTC_OPTIMISM"
15
16
  }
16
17
  export declare enum HistoricalPeriod {
17
18
  ONE_DAY = "1d",
@@ -18,6 +18,7 @@ var BlockchainCode;
18
18
  var Market;
19
19
  (function (Market) {
20
20
  Market["RETH_BASE"] = "RETH_BASE";
21
+ Market["WBTC_OPTIMISM"] = "WBTC_OPTIMISM";
21
22
  })(Market || (exports.Market = Market = {}));
22
23
  var HistoricalPeriod;
23
24
  (function (HistoricalPeriod) {
@@ -0,0 +1,69 @@
1
+ export declare const OptionViewer: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ outputs?: undefined;
11
+ } | {
12
+ inputs: {
13
+ internalType: string;
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ name: string;
18
+ outputs: {
19
+ components: {
20
+ internalType: string;
21
+ name: string;
22
+ type: string;
23
+ }[];
24
+ internalType: string;
25
+ name: string;
26
+ type: string;
27
+ }[];
28
+ stateMutability: string;
29
+ type: string;
30
+ } | {
31
+ inputs: never[];
32
+ name: string;
33
+ outputs: {
34
+ components: ({
35
+ internalType: string;
36
+ name: string;
37
+ type: string;
38
+ components?: undefined;
39
+ } | {
40
+ components: {
41
+ internalType: string;
42
+ name: string;
43
+ type: string;
44
+ }[];
45
+ internalType: string;
46
+ name: string;
47
+ type: string;
48
+ })[];
49
+ internalType: string;
50
+ name: string;
51
+ type: string;
52
+ }[];
53
+ stateMutability: string;
54
+ type: string;
55
+ } | {
56
+ inputs: {
57
+ internalType: string;
58
+ name: string;
59
+ type: string;
60
+ }[];
61
+ name: string;
62
+ outputs: {
63
+ internalType: string;
64
+ name: string;
65
+ type: string;
66
+ }[];
67
+ stateMutability: string;
68
+ type: string;
69
+ })[][];
@@ -0,0 +1,484 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionViewer = void 0;
4
+ exports.OptionViewer = [
5
+ [
6
+ {
7
+ inputs: [
8
+ {
9
+ internalType: 'contract IFlatcoinVault',
10
+ name: 'vault_',
11
+ type: 'address',
12
+ },
13
+ ],
14
+ stateMutability: 'nonpayable',
15
+ type: 'constructor',
16
+ },
17
+ {
18
+ inputs: [
19
+ {
20
+ internalType: 'address',
21
+ name: 'account_',
22
+ type: 'address',
23
+ },
24
+ ],
25
+ name: 'getAccountLeveragePositionData',
26
+ outputs: [
27
+ {
28
+ components: [
29
+ {
30
+ internalType: 'uint256',
31
+ name: 'tokenId',
32
+ type: 'uint256',
33
+ },
34
+ {
35
+ internalType: 'uint256',
36
+ name: 'averagePrice',
37
+ type: 'uint256',
38
+ },
39
+ {
40
+ internalType: 'uint256',
41
+ name: 'marginDeposited',
42
+ type: 'uint256',
43
+ },
44
+ {
45
+ internalType: 'uint256',
46
+ name: 'additionalSize',
47
+ type: 'uint256',
48
+ },
49
+ {
50
+ internalType: 'int256',
51
+ name: 'entryCumulativeFunding',
52
+ type: 'int256',
53
+ },
54
+ {
55
+ internalType: 'int256',
56
+ name: 'profitLoss',
57
+ type: 'int256',
58
+ },
59
+ {
60
+ internalType: 'int256',
61
+ name: 'accruedFunding',
62
+ type: 'int256',
63
+ },
64
+ {
65
+ internalType: 'int256',
66
+ name: 'marginAfterSettlement',
67
+ type: 'int256',
68
+ },
69
+ {
70
+ internalType: 'uint256',
71
+ name: 'liquidationPrice',
72
+ type: 'uint256',
73
+ },
74
+ {
75
+ internalType: 'uint256',
76
+ name: 'limitOrderStopLossPrice',
77
+ type: 'uint256',
78
+ },
79
+ {
80
+ internalType: 'uint256',
81
+ name: 'limitOrderProfitTakePrice',
82
+ type: 'uint256',
83
+ },
84
+ ],
85
+ internalType: 'struct LeveragePositionData[]',
86
+ name: 'positionData_',
87
+ type: 'tuple[]',
88
+ },
89
+ ],
90
+ stateMutability: 'view',
91
+ type: 'function',
92
+ },
93
+ {
94
+ inputs: [],
95
+ name: 'getFlatcoinPriceInUSD',
96
+ outputs: [
97
+ {
98
+ internalType: 'uint256',
99
+ name: 'priceInUSD_',
100
+ type: 'uint256',
101
+ },
102
+ ],
103
+ stateMutability: 'view',
104
+ type: 'function',
105
+ },
106
+ {
107
+ inputs: [],
108
+ name: 'getFlatcoinTVL',
109
+ outputs: [
110
+ {
111
+ internalType: 'uint256',
112
+ name: 'tvl_',
113
+ type: 'uint256',
114
+ },
115
+ ],
116
+ stateMutability: 'view',
117
+ type: 'function',
118
+ },
119
+ {
120
+ inputs: [],
121
+ name: 'getMarketSkewPercentage',
122
+ outputs: [
123
+ {
124
+ internalType: 'int256',
125
+ name: 'skewPercent_',
126
+ type: 'int256',
127
+ },
128
+ ],
129
+ stateMutability: 'view',
130
+ type: 'function',
131
+ },
132
+ {
133
+ inputs: [
134
+ {
135
+ internalType: 'uint256',
136
+ name: 'price_',
137
+ type: 'uint256',
138
+ },
139
+ ],
140
+ name: 'getMarketSummary',
141
+ outputs: [
142
+ {
143
+ components: [
144
+ {
145
+ internalType: 'int256',
146
+ name: 'profitLossTotalByLongs',
147
+ type: 'int256',
148
+ },
149
+ {
150
+ internalType: 'int256',
151
+ name: 'accruedFundingTotalByLongs',
152
+ type: 'int256',
153
+ },
154
+ {
155
+ internalType: 'int256',
156
+ name: 'currentFundingRate',
157
+ type: 'int256',
158
+ },
159
+ {
160
+ internalType: 'int256',
161
+ name: 'nextFundingEntry',
162
+ type: 'int256',
163
+ },
164
+ ],
165
+ internalType: 'struct MarketSummary',
166
+ name: 'marketSummary_',
167
+ type: 'tuple',
168
+ },
169
+ ],
170
+ stateMutability: 'view',
171
+ type: 'function',
172
+ },
173
+ {
174
+ inputs: [],
175
+ name: 'getMarketSummary',
176
+ outputs: [
177
+ {
178
+ components: [
179
+ {
180
+ internalType: 'int256',
181
+ name: 'profitLossTotalByLongs',
182
+ type: 'int256',
183
+ },
184
+ {
185
+ internalType: 'int256',
186
+ name: 'accruedFundingTotalByLongs',
187
+ type: 'int256',
188
+ },
189
+ {
190
+ internalType: 'int256',
191
+ name: 'currentFundingRate',
192
+ type: 'int256',
193
+ },
194
+ {
195
+ internalType: 'int256',
196
+ name: 'nextFundingEntry',
197
+ type: 'int256',
198
+ },
199
+ ],
200
+ internalType: 'struct MarketSummary',
201
+ name: 'marketSummary_',
202
+ type: 'tuple',
203
+ },
204
+ ],
205
+ stateMutability: 'view',
206
+ type: 'function',
207
+ },
208
+ {
209
+ inputs: [
210
+ {
211
+ internalType: 'uint256',
212
+ name: 'tokenId_',
213
+ type: 'uint256',
214
+ },
215
+ ],
216
+ name: 'getPositionData',
217
+ outputs: [
218
+ {
219
+ components: [
220
+ {
221
+ internalType: 'uint256',
222
+ name: 'tokenId',
223
+ type: 'uint256',
224
+ },
225
+ {
226
+ internalType: 'uint256',
227
+ name: 'averagePrice',
228
+ type: 'uint256',
229
+ },
230
+ {
231
+ internalType: 'uint256',
232
+ name: 'marginDeposited',
233
+ type: 'uint256',
234
+ },
235
+ {
236
+ internalType: 'uint256',
237
+ name: 'additionalSize',
238
+ type: 'uint256',
239
+ },
240
+ {
241
+ internalType: 'int256',
242
+ name: 'entryCumulativeFunding',
243
+ type: 'int256',
244
+ },
245
+ {
246
+ internalType: 'int256',
247
+ name: 'profitLoss',
248
+ type: 'int256',
249
+ },
250
+ {
251
+ internalType: 'int256',
252
+ name: 'accruedFunding',
253
+ type: 'int256',
254
+ },
255
+ {
256
+ internalType: 'int256',
257
+ name: 'marginAfterSettlement',
258
+ type: 'int256',
259
+ },
260
+ {
261
+ internalType: 'uint256',
262
+ name: 'liquidationPrice',
263
+ type: 'uint256',
264
+ },
265
+ {
266
+ internalType: 'uint256',
267
+ name: 'limitOrderStopLossPrice',
268
+ type: 'uint256',
269
+ },
270
+ {
271
+ internalType: 'uint256',
272
+ name: 'limitOrderProfitTakePrice',
273
+ type: 'uint256',
274
+ },
275
+ ],
276
+ internalType: 'struct LeveragePositionData',
277
+ name: 'positionData_',
278
+ type: 'tuple',
279
+ },
280
+ ],
281
+ stateMutability: 'view',
282
+ type: 'function',
283
+ },
284
+ {
285
+ inputs: [
286
+ {
287
+ internalType: 'uint256',
288
+ name: 'tokenIdFrom_',
289
+ type: 'uint256',
290
+ },
291
+ {
292
+ internalType: 'uint256',
293
+ name: 'tokenIdTo_',
294
+ type: 'uint256',
295
+ },
296
+ ],
297
+ name: 'getPositionData',
298
+ outputs: [
299
+ {
300
+ components: [
301
+ {
302
+ internalType: 'uint256',
303
+ name: 'tokenId',
304
+ type: 'uint256',
305
+ },
306
+ {
307
+ internalType: 'uint256',
308
+ name: 'averagePrice',
309
+ type: 'uint256',
310
+ },
311
+ {
312
+ internalType: 'uint256',
313
+ name: 'marginDeposited',
314
+ type: 'uint256',
315
+ },
316
+ {
317
+ internalType: 'uint256',
318
+ name: 'additionalSize',
319
+ type: 'uint256',
320
+ },
321
+ {
322
+ internalType: 'int256',
323
+ name: 'entryCumulativeFunding',
324
+ type: 'int256',
325
+ },
326
+ {
327
+ internalType: 'int256',
328
+ name: 'profitLoss',
329
+ type: 'int256',
330
+ },
331
+ {
332
+ internalType: 'int256',
333
+ name: 'accruedFunding',
334
+ type: 'int256',
335
+ },
336
+ {
337
+ internalType: 'int256',
338
+ name: 'marginAfterSettlement',
339
+ type: 'int256',
340
+ },
341
+ {
342
+ internalType: 'uint256',
343
+ name: 'liquidationPrice',
344
+ type: 'uint256',
345
+ },
346
+ {
347
+ internalType: 'uint256',
348
+ name: 'limitOrderStopLossPrice',
349
+ type: 'uint256',
350
+ },
351
+ {
352
+ internalType: 'uint256',
353
+ name: 'limitOrderProfitTakePrice',
354
+ type: 'uint256',
355
+ },
356
+ ],
357
+ internalType: 'struct LeveragePositionData[]',
358
+ name: 'positionData_',
359
+ type: 'tuple[]',
360
+ },
361
+ ],
362
+ stateMutability: 'view',
363
+ type: 'function',
364
+ },
365
+ {
366
+ inputs: [],
367
+ name: 'getVaultSummary',
368
+ outputs: [
369
+ {
370
+ components: [
371
+ {
372
+ internalType: 'int256',
373
+ name: 'marketSkew',
374
+ type: 'int256',
375
+ },
376
+ {
377
+ internalType: 'int256',
378
+ name: 'cumulativeFundingRate',
379
+ type: 'int256',
380
+ },
381
+ {
382
+ internalType: 'int256',
383
+ name: 'lastRecomputedFundingRate',
384
+ type: 'int256',
385
+ },
386
+ {
387
+ internalType: 'uint64',
388
+ name: 'lastRecomputedFundingTimestamp',
389
+ type: 'uint64',
390
+ },
391
+ {
392
+ internalType: 'uint256',
393
+ name: 'stableCollateralTotal',
394
+ type: 'uint256',
395
+ },
396
+ {
397
+ components: [
398
+ {
399
+ internalType: 'int256',
400
+ name: 'marginDepositedTotal',
401
+ type: 'int256',
402
+ },
403
+ {
404
+ internalType: 'uint256',
405
+ name: 'averagePrice',
406
+ type: 'uint256',
407
+ },
408
+ {
409
+ internalType: 'uint256',
410
+ name: 'sizeOpenedTotal',
411
+ type: 'uint256',
412
+ },
413
+ ],
414
+ internalType: 'struct GlobalPositions',
415
+ name: 'globalPositions',
416
+ type: 'tuple',
417
+ },
418
+ ],
419
+ internalType: 'struct VaultSummary',
420
+ name: 'vaultSummary_',
421
+ type: 'tuple',
422
+ },
423
+ ],
424
+ stateMutability: 'view',
425
+ type: 'function',
426
+ },
427
+ {
428
+ inputs: [
429
+ {
430
+ internalType: 'uint256',
431
+ name: 'tokenId_',
432
+ type: 'uint256',
433
+ },
434
+ {
435
+ internalType: 'uint256',
436
+ name: 'marketPrice_',
437
+ type: 'uint256',
438
+ },
439
+ ],
440
+ name: 'liquidationPrice',
441
+ outputs: [
442
+ {
443
+ internalType: 'uint256',
444
+ name: 'liqPrice_',
445
+ type: 'uint256',
446
+ },
447
+ ],
448
+ stateMutability: 'view',
449
+ type: 'function',
450
+ },
451
+ {
452
+ inputs: [
453
+ {
454
+ internalType: 'uint256',
455
+ name: 'tokenId_',
456
+ type: 'uint256',
457
+ },
458
+ ],
459
+ name: 'liquidationPrice',
460
+ outputs: [
461
+ {
462
+ internalType: 'uint256',
463
+ name: 'liqPrice_',
464
+ type: 'uint256',
465
+ },
466
+ ],
467
+ stateMutability: 'view',
468
+ type: 'function',
469
+ },
470
+ {
471
+ inputs: [],
472
+ name: 'vault',
473
+ outputs: [
474
+ {
475
+ internalType: 'contract IFlatcoinVault',
476
+ name: '',
477
+ type: 'address',
478
+ },
479
+ ],
480
+ stateMutability: 'view',
481
+ type: 'function',
482
+ },
483
+ ],
484
+ ];
@@ -0,0 +1,69 @@
1
+ export declare const PerpViewer: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ outputs?: undefined;
11
+ } | {
12
+ inputs: {
13
+ internalType: string;
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ name: string;
18
+ outputs: {
19
+ components: {
20
+ internalType: string;
21
+ name: string;
22
+ type: string;
23
+ }[];
24
+ internalType: string;
25
+ name: string;
26
+ type: string;
27
+ }[];
28
+ stateMutability: string;
29
+ type: string;
30
+ } | {
31
+ inputs: never[];
32
+ name: string;
33
+ outputs: {
34
+ components: ({
35
+ internalType: string;
36
+ name: string;
37
+ type: string;
38
+ components?: undefined;
39
+ } | {
40
+ components: {
41
+ internalType: string;
42
+ name: string;
43
+ type: string;
44
+ }[];
45
+ internalType: string;
46
+ name: string;
47
+ type: string;
48
+ })[];
49
+ internalType: string;
50
+ name: string;
51
+ type: string;
52
+ }[];
53
+ stateMutability: string;
54
+ type: string;
55
+ } | {
56
+ inputs: {
57
+ internalType: string;
58
+ name: string;
59
+ type: string;
60
+ }[];
61
+ name: string;
62
+ outputs: {
63
+ internalType: string;
64
+ name: string;
65
+ type: string;
66
+ }[];
67
+ stateMutability: string;
68
+ type: string;
69
+ })[];
@@ -0,0 +1,482 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PerpViewer = void 0;
4
+ exports.PerpViewer = [
5
+ {
6
+ inputs: [
7
+ {
8
+ internalType: 'contract IFlatcoinVault',
9
+ name: 'vault_',
10
+ type: 'address',
11
+ },
12
+ ],
13
+ stateMutability: 'nonpayable',
14
+ type: 'constructor',
15
+ },
16
+ {
17
+ inputs: [
18
+ {
19
+ internalType: 'address',
20
+ name: 'account_',
21
+ type: 'address',
22
+ },
23
+ ],
24
+ name: 'getAccountLeveragePositionData',
25
+ outputs: [
26
+ {
27
+ components: [
28
+ {
29
+ internalType: 'uint256',
30
+ name: 'tokenId',
31
+ type: 'uint256',
32
+ },
33
+ {
34
+ internalType: 'uint256',
35
+ name: 'averagePrice',
36
+ type: 'uint256',
37
+ },
38
+ {
39
+ internalType: 'uint256',
40
+ name: 'marginDeposited',
41
+ type: 'uint256',
42
+ },
43
+ {
44
+ internalType: 'uint256',
45
+ name: 'additionalSize',
46
+ type: 'uint256',
47
+ },
48
+ {
49
+ internalType: 'int256',
50
+ name: 'entryCumulativeFunding',
51
+ type: 'int256',
52
+ },
53
+ {
54
+ internalType: 'int256',
55
+ name: 'profitLoss',
56
+ type: 'int256',
57
+ },
58
+ {
59
+ internalType: 'int256',
60
+ name: 'accruedFunding',
61
+ type: 'int256',
62
+ },
63
+ {
64
+ internalType: 'int256',
65
+ name: 'marginAfterSettlement',
66
+ type: 'int256',
67
+ },
68
+ {
69
+ internalType: 'uint256',
70
+ name: 'liquidationPrice',
71
+ type: 'uint256',
72
+ },
73
+ {
74
+ internalType: 'uint256',
75
+ name: 'limitOrderStopLossPrice',
76
+ type: 'uint256',
77
+ },
78
+ {
79
+ internalType: 'uint256',
80
+ name: 'limitOrderProfitTakePrice',
81
+ type: 'uint256',
82
+ },
83
+ ],
84
+ internalType: 'struct LeveragePositionData[]',
85
+ name: 'positionData_',
86
+ type: 'tuple[]',
87
+ },
88
+ ],
89
+ stateMutability: 'view',
90
+ type: 'function',
91
+ },
92
+ {
93
+ inputs: [],
94
+ name: 'getFlatcoinPriceInUSD',
95
+ outputs: [
96
+ {
97
+ internalType: 'uint256',
98
+ name: 'priceInUSD_',
99
+ type: 'uint256',
100
+ },
101
+ ],
102
+ stateMutability: 'view',
103
+ type: 'function',
104
+ },
105
+ {
106
+ inputs: [],
107
+ name: 'getFlatcoinTVL',
108
+ outputs: [
109
+ {
110
+ internalType: 'uint256',
111
+ name: 'tvl_',
112
+ type: 'uint256',
113
+ },
114
+ ],
115
+ stateMutability: 'view',
116
+ type: 'function',
117
+ },
118
+ {
119
+ inputs: [],
120
+ name: 'getMarketSkewPercentage',
121
+ outputs: [
122
+ {
123
+ internalType: 'int256',
124
+ name: 'skewPercent_',
125
+ type: 'int256',
126
+ },
127
+ ],
128
+ stateMutability: 'view',
129
+ type: 'function',
130
+ },
131
+ {
132
+ inputs: [
133
+ {
134
+ internalType: 'uint256',
135
+ name: 'price_',
136
+ type: 'uint256',
137
+ },
138
+ ],
139
+ name: 'getMarketSummary',
140
+ outputs: [
141
+ {
142
+ components: [
143
+ {
144
+ internalType: 'int256',
145
+ name: 'profitLossTotalByLongs',
146
+ type: 'int256',
147
+ },
148
+ {
149
+ internalType: 'int256',
150
+ name: 'accruedFundingTotalByLongs',
151
+ type: 'int256',
152
+ },
153
+ {
154
+ internalType: 'int256',
155
+ name: 'currentFundingRate',
156
+ type: 'int256',
157
+ },
158
+ {
159
+ internalType: 'int256',
160
+ name: 'nextFundingEntry',
161
+ type: 'int256',
162
+ },
163
+ ],
164
+ internalType: 'struct MarketSummary',
165
+ name: 'marketSummary_',
166
+ type: 'tuple',
167
+ },
168
+ ],
169
+ stateMutability: 'view',
170
+ type: 'function',
171
+ },
172
+ {
173
+ inputs: [],
174
+ name: 'getMarketSummary',
175
+ outputs: [
176
+ {
177
+ components: [
178
+ {
179
+ internalType: 'int256',
180
+ name: 'profitLossTotalByLongs',
181
+ type: 'int256',
182
+ },
183
+ {
184
+ internalType: 'int256',
185
+ name: 'accruedFundingTotalByLongs',
186
+ type: 'int256',
187
+ },
188
+ {
189
+ internalType: 'int256',
190
+ name: 'currentFundingRate',
191
+ type: 'int256',
192
+ },
193
+ {
194
+ internalType: 'int256',
195
+ name: 'nextFundingEntry',
196
+ type: 'int256',
197
+ },
198
+ ],
199
+ internalType: 'struct MarketSummary',
200
+ name: 'marketSummary_',
201
+ type: 'tuple',
202
+ },
203
+ ],
204
+ stateMutability: 'view',
205
+ type: 'function',
206
+ },
207
+ {
208
+ inputs: [
209
+ {
210
+ internalType: 'uint256',
211
+ name: 'tokenId_',
212
+ type: 'uint256',
213
+ },
214
+ ],
215
+ name: 'getPositionData',
216
+ outputs: [
217
+ {
218
+ components: [
219
+ {
220
+ internalType: 'uint256',
221
+ name: 'tokenId',
222
+ type: 'uint256',
223
+ },
224
+ {
225
+ internalType: 'uint256',
226
+ name: 'averagePrice',
227
+ type: 'uint256',
228
+ },
229
+ {
230
+ internalType: 'uint256',
231
+ name: 'marginDeposited',
232
+ type: 'uint256',
233
+ },
234
+ {
235
+ internalType: 'uint256',
236
+ name: 'additionalSize',
237
+ type: 'uint256',
238
+ },
239
+ {
240
+ internalType: 'int256',
241
+ name: 'entryCumulativeFunding',
242
+ type: 'int256',
243
+ },
244
+ {
245
+ internalType: 'int256',
246
+ name: 'profitLoss',
247
+ type: 'int256',
248
+ },
249
+ {
250
+ internalType: 'int256',
251
+ name: 'accruedFunding',
252
+ type: 'int256',
253
+ },
254
+ {
255
+ internalType: 'int256',
256
+ name: 'marginAfterSettlement',
257
+ type: 'int256',
258
+ },
259
+ {
260
+ internalType: 'uint256',
261
+ name: 'liquidationPrice',
262
+ type: 'uint256',
263
+ },
264
+ {
265
+ internalType: 'uint256',
266
+ name: 'limitOrderStopLossPrice',
267
+ type: 'uint256',
268
+ },
269
+ {
270
+ internalType: 'uint256',
271
+ name: 'limitOrderProfitTakePrice',
272
+ type: 'uint256',
273
+ },
274
+ ],
275
+ internalType: 'struct LeveragePositionData',
276
+ name: 'positionData_',
277
+ type: 'tuple',
278
+ },
279
+ ],
280
+ stateMutability: 'view',
281
+ type: 'function',
282
+ },
283
+ {
284
+ inputs: [
285
+ {
286
+ internalType: 'uint256',
287
+ name: 'tokenIdFrom_',
288
+ type: 'uint256',
289
+ },
290
+ {
291
+ internalType: 'uint256',
292
+ name: 'tokenIdTo_',
293
+ type: 'uint256',
294
+ },
295
+ ],
296
+ name: 'getPositionData',
297
+ outputs: [
298
+ {
299
+ components: [
300
+ {
301
+ internalType: 'uint256',
302
+ name: 'tokenId',
303
+ type: 'uint256',
304
+ },
305
+ {
306
+ internalType: 'uint256',
307
+ name: 'averagePrice',
308
+ type: 'uint256',
309
+ },
310
+ {
311
+ internalType: 'uint256',
312
+ name: 'marginDeposited',
313
+ type: 'uint256',
314
+ },
315
+ {
316
+ internalType: 'uint256',
317
+ name: 'additionalSize',
318
+ type: 'uint256',
319
+ },
320
+ {
321
+ internalType: 'int256',
322
+ name: 'entryCumulativeFunding',
323
+ type: 'int256',
324
+ },
325
+ {
326
+ internalType: 'int256',
327
+ name: 'profitLoss',
328
+ type: 'int256',
329
+ },
330
+ {
331
+ internalType: 'int256',
332
+ name: 'accruedFunding',
333
+ type: 'int256',
334
+ },
335
+ {
336
+ internalType: 'int256',
337
+ name: 'marginAfterSettlement',
338
+ type: 'int256',
339
+ },
340
+ {
341
+ internalType: 'uint256',
342
+ name: 'liquidationPrice',
343
+ type: 'uint256',
344
+ },
345
+ {
346
+ internalType: 'uint256',
347
+ name: 'limitOrderStopLossPrice',
348
+ type: 'uint256',
349
+ },
350
+ {
351
+ internalType: 'uint256',
352
+ name: 'limitOrderProfitTakePrice',
353
+ type: 'uint256',
354
+ },
355
+ ],
356
+ internalType: 'struct LeveragePositionData[]',
357
+ name: 'positionData_',
358
+ type: 'tuple[]',
359
+ },
360
+ ],
361
+ stateMutability: 'view',
362
+ type: 'function',
363
+ },
364
+ {
365
+ inputs: [],
366
+ name: 'getVaultSummary',
367
+ outputs: [
368
+ {
369
+ components: [
370
+ {
371
+ internalType: 'int256',
372
+ name: 'marketSkew',
373
+ type: 'int256',
374
+ },
375
+ {
376
+ internalType: 'int256',
377
+ name: 'cumulativeFundingRate',
378
+ type: 'int256',
379
+ },
380
+ {
381
+ internalType: 'int256',
382
+ name: 'lastRecomputedFundingRate',
383
+ type: 'int256',
384
+ },
385
+ {
386
+ internalType: 'uint64',
387
+ name: 'lastRecomputedFundingTimestamp',
388
+ type: 'uint64',
389
+ },
390
+ {
391
+ internalType: 'uint256',
392
+ name: 'stableCollateralTotal',
393
+ type: 'uint256',
394
+ },
395
+ {
396
+ components: [
397
+ {
398
+ internalType: 'int256',
399
+ name: 'marginDepositedTotal',
400
+ type: 'int256',
401
+ },
402
+ {
403
+ internalType: 'uint256',
404
+ name: 'averagePrice',
405
+ type: 'uint256',
406
+ },
407
+ {
408
+ internalType: 'uint256',
409
+ name: 'sizeOpenedTotal',
410
+ type: 'uint256',
411
+ },
412
+ ],
413
+ internalType: 'struct GlobalPositions',
414
+ name: 'globalPositions',
415
+ type: 'tuple',
416
+ },
417
+ ],
418
+ internalType: 'struct VaultSummary',
419
+ name: 'vaultSummary_',
420
+ type: 'tuple',
421
+ },
422
+ ],
423
+ stateMutability: 'view',
424
+ type: 'function',
425
+ },
426
+ {
427
+ inputs: [
428
+ {
429
+ internalType: 'uint256',
430
+ name: 'tokenId_',
431
+ type: 'uint256',
432
+ },
433
+ {
434
+ internalType: 'uint256',
435
+ name: 'collateralPrice_',
436
+ type: 'uint256',
437
+ },
438
+ ],
439
+ name: 'liquidationPrice',
440
+ outputs: [
441
+ {
442
+ internalType: 'uint256',
443
+ name: 'liqPrice_',
444
+ type: 'uint256',
445
+ },
446
+ ],
447
+ stateMutability: 'view',
448
+ type: 'function',
449
+ },
450
+ {
451
+ inputs: [
452
+ {
453
+ internalType: 'uint256',
454
+ name: 'tokenId_',
455
+ type: 'uint256',
456
+ },
457
+ ],
458
+ name: 'liquidationPrice',
459
+ outputs: [
460
+ {
461
+ internalType: 'uint256',
462
+ name: 'liqPrice_',
463
+ type: 'uint256',
464
+ },
465
+ ],
466
+ stateMutability: 'view',
467
+ type: 'function',
468
+ },
469
+ {
470
+ inputs: [],
471
+ name: 'vault',
472
+ outputs: [
473
+ {
474
+ internalType: 'contract IFlatcoinVault',
475
+ name: '',
476
+ type: 'address',
477
+ },
478
+ ],
479
+ stateMutability: 'view',
480
+ type: 'function',
481
+ },
482
+ ];
@@ -10,4 +10,8 @@ export { LimitOrder } from './abi/limit-order';
10
10
  export { DelayedOrder } from './abi/delayed-order';
11
11
  export { FlatcoinVault } from './abi/flatcoin-vault';
12
12
  export { CanLiquidateWithPriceFeeds } from './abi/liquidation-module';
13
+ export { OrderAnnouncementModule } from './abi/v2/order-announcement-module';
14
+ export { OrderExecutionModule } from './abi/v2/order-execution-module';
15
+ export { OptionViewer } from './abi/v2/option-viewer';
16
+ export { PerpViewer } from './abi/v2/perp-viewer';
13
17
  export * from './helpers';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CanLiquidateWithPriceFeeds = exports.FlatcoinVault = exports.DelayedOrder = exports.LimitOrder = exports.LiquidateWithoutPriceFeeds = exports.Liquidate = exports.LiquidationModule = exports.LeverageModule = exports.FlatcoinErrors = exports.ViewerGetPositionData = exports.Viewer = exports.StableModule = void 0;
17
+ exports.PerpViewer = exports.OptionViewer = exports.OrderExecutionModule = exports.OrderAnnouncementModule = exports.CanLiquidateWithPriceFeeds = exports.FlatcoinVault = exports.DelayedOrder = exports.LimitOrder = exports.LiquidateWithoutPriceFeeds = exports.Liquidate = exports.LiquidationModule = exports.LeverageModule = exports.FlatcoinErrors = exports.ViewerGetPositionData = exports.Viewer = exports.StableModule = void 0;
18
18
  var stable_module_1 = require("./abi/stable-module");
19
19
  Object.defineProperty(exports, "StableModule", { enumerable: true, get: function () { return stable_module_1.StableModule; } });
20
20
  var viewer_1 = require("./abi/viewer");
@@ -39,4 +39,12 @@ var flatcoin_vault_1 = require("./abi/flatcoin-vault");
39
39
  Object.defineProperty(exports, "FlatcoinVault", { enumerable: true, get: function () { return flatcoin_vault_1.FlatcoinVault; } });
40
40
  var liquidation_module_4 = require("./abi/liquidation-module");
41
41
  Object.defineProperty(exports, "CanLiquidateWithPriceFeeds", { enumerable: true, get: function () { return liquidation_module_4.CanLiquidateWithPriceFeeds; } });
42
+ var order_announcement_module_1 = require("./abi/v2/order-announcement-module");
43
+ Object.defineProperty(exports, "OrderAnnouncementModule", { enumerable: true, get: function () { return order_announcement_module_1.OrderAnnouncementModule; } });
44
+ var order_execution_module_1 = require("./abi/v2/order-execution-module");
45
+ Object.defineProperty(exports, "OrderExecutionModule", { enumerable: true, get: function () { return order_execution_module_1.OrderExecutionModule; } });
46
+ var option_viewer_1 = require("./abi/v2/option-viewer");
47
+ Object.defineProperty(exports, "OptionViewer", { enumerable: true, get: function () { return option_viewer_1.OptionViewer; } });
48
+ var perp_viewer_1 = require("./abi/v2/perp-viewer");
49
+ Object.defineProperty(exports, "PerpViewer", { enumerable: true, get: function () { return perp_viewer_1.PerpViewer; } });
42
50
  __exportStar(require("./helpers"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",