@typus/typus-perp-sdk 1.1.5 → 1.1.7
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.
- package/dist/src/api/sentio.d.ts +1 -1
- package/dist/src/api/sentio.js +8 -4
- package/dist/src/fetch.d.ts +10 -1
- package/dist/src/fetch.js +21 -8
- package/dist/src/index.js +1 -1
- package/dist/src/typus_perp/lp-pool/functions.d.ts +34 -0
- package/dist/src/typus_perp/lp-pool/functions.js +56 -0
- package/dist/src/typus_perp/lp-pool/structs.d.ts +774 -0
- package/dist/src/typus_perp/lp-pool/structs.js +1952 -498
- package/dist/src/typus_perp/trading/functions.d.ts +105 -10
- package/dist/src/typus_perp/trading/functions.js +152 -16
- package/dist/src/typus_perp/user-account/functions.d.ts +36 -0
- package/dist/src/typus_perp/user-account/functions.js +70 -0
- package/dist/src/typus_perp/user-account/structs.d.ts +168 -0
- package/dist/src/typus_perp/user-account/structs.js +448 -0
- package/dist/src/user/history.d.ts +4 -1
- package/dist/src/user/history.js +196 -9
- package/dist/src/user/order.d.ts +4 -0
- package/dist/src/user/order.js +48 -0
- package/dist/src/user/orderWithBidReceipt.js +2 -4
- package/package.json +1 -1
package/dist/src/user/history.js
CHANGED
|
@@ -66,6 +66,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
66
66
|
exports.parseUserHistory = parseUserHistory;
|
|
67
67
|
exports.getGraphQLEvents = getGraphQLEvents;
|
|
68
68
|
exports.getLiquidateFromSentio = getLiquidateFromSentio;
|
|
69
|
+
exports.getRealizeFundingFromSentio = getRealizeFundingFromSentio;
|
|
70
|
+
exports.getRemovePositionFromSentio = getRemovePositionFromSentio;
|
|
71
|
+
exports.getCancelOrderFromSentio = getCancelOrderFromSentio;
|
|
69
72
|
exports.getOrderMatchFromSentio = getOrderMatchFromSentio;
|
|
70
73
|
exports.getRealizeOptionFromSentio = getRealizeOptionFromSentio;
|
|
71
74
|
exports.toSentioToken = toSentioToken;
|
|
@@ -81,7 +84,7 @@ function parseUserHistory(raw_events) {
|
|
|
81
84
|
return __generator(this, function (_a) {
|
|
82
85
|
events = [];
|
|
83
86
|
raw_events.forEach(function (event) {
|
|
84
|
-
var _a
|
|
87
|
+
var _a;
|
|
85
88
|
var type = event.contents.type.repr;
|
|
86
89
|
if (type.endsWith("PythPrice")) {
|
|
87
90
|
return;
|
|
@@ -93,7 +96,7 @@ function parseUserHistory(raw_events) {
|
|
|
93
96
|
// console.log(tx_digest);
|
|
94
97
|
// console.log(json);
|
|
95
98
|
// console.log(timestamp);
|
|
96
|
-
var
|
|
99
|
+
var _b = __read(type.split("::"), 3), pkg = _b[0], mod = _b[1], name = _b[2];
|
|
97
100
|
switch (name) {
|
|
98
101
|
case structs_2.CreateTradingOrderEvent.$typeName.split("::")[2]:
|
|
99
102
|
case structs_2.CreateTradingOrderWithBidReceiptsEvent.$typeName.split("::")[2]:
|
|
@@ -186,16 +189,61 @@ function parseUserHistory(raw_events) {
|
|
|
186
189
|
};
|
|
187
190
|
events.push(e);
|
|
188
191
|
break;
|
|
189
|
-
case structs_1.
|
|
192
|
+
case structs_1.RemovePositionEvent.$typeName.split("::")[2]:
|
|
190
193
|
// same tx with order filled
|
|
191
|
-
var index = events.findLastIndex(function (e) { return e.tx_digest == tx_digest; });
|
|
194
|
+
var index = events.findLastIndex(function (e) { return e.tx_digest == tx_digest && e.action == "Order Filled (Close Position)"; });
|
|
192
195
|
// console.log(index);
|
|
193
196
|
if (index !== -1) {
|
|
194
197
|
// true => user paid to pool
|
|
195
|
-
var
|
|
196
|
-
events[index] = __assign(__assign({}, events[index]), {
|
|
198
|
+
var remaining_collateral_amount = json.remaining_collateral_amount / Math.pow(10, (0, constants_1.assetToDecimal)(events[index].collateral_token));
|
|
199
|
+
events[index] = __assign(__assign({}, events[index]), { collateral: remaining_collateral_amount + Math.max(0, events[index].realized_pnl) });
|
|
197
200
|
}
|
|
198
201
|
break;
|
|
202
|
+
case structs_1.RealizeFundingEvent.$typeName.split("::")[2]:
|
|
203
|
+
// // same tx with order filled
|
|
204
|
+
// var index = events.findLastIndex((e) => e.tx_digest == tx_digest);
|
|
205
|
+
// // console.log(index);
|
|
206
|
+
// if (index !== -1) {
|
|
207
|
+
// // true => user paid to pool
|
|
208
|
+
// let x = json.realized_funding_sign ? json.realized_funding_fee_usd / 10 ** 9 : -json.realized_funding_fee_usd / 10 ** 9;
|
|
209
|
+
// events[index] = {
|
|
210
|
+
// ...events[index],
|
|
211
|
+
// realized_pnl: (events[index].realized_pnl ?? 0) - x,
|
|
212
|
+
// };
|
|
213
|
+
// }
|
|
214
|
+
var base_token = (0, constants_1.typeArgToAsset)(json.symbol.base_token.name);
|
|
215
|
+
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
216
|
+
var market = "".concat(base_token, "/USD");
|
|
217
|
+
var related = events.find(function (e) { return e.position_id === json.position_id && e.market === market; });
|
|
218
|
+
// if realized_funding_sign is true, user pays to pool
|
|
219
|
+
var realized_funding_fee = json.realized_funding_sign
|
|
220
|
+
? -json.realized_funding_fee / Math.pow(10, (0, constants_1.assetToDecimal)(collateral_token))
|
|
221
|
+
: json.realized_funding_fee / Math.pow(10, (0, constants_1.assetToDecimal)(collateral_token));
|
|
222
|
+
var realized_funding_fee_usd = json.realized_funding_sign
|
|
223
|
+
? -json.realized_funding_fee_usd / Math.pow(10, 9)
|
|
224
|
+
: json.realized_funding_fee_usd / Math.pow(10, 9);
|
|
225
|
+
var e = {
|
|
226
|
+
action: "Realized Funding",
|
|
227
|
+
typeName: name,
|
|
228
|
+
order_id: undefined,
|
|
229
|
+
position_id: json.position_id,
|
|
230
|
+
market: market,
|
|
231
|
+
side: related === null || related === void 0 ? void 0 : related.side,
|
|
232
|
+
order_type: related === null || related === void 0 ? void 0 : related.order_type,
|
|
233
|
+
status: "Filled",
|
|
234
|
+
size: related === null || related === void 0 ? void 0 : related.size,
|
|
235
|
+
base_token: base_token,
|
|
236
|
+
collateral: realized_funding_fee,
|
|
237
|
+
collateral_token: collateral_token,
|
|
238
|
+
price: undefined,
|
|
239
|
+
realized_pnl: realized_funding_fee_usd,
|
|
240
|
+
timestamp: timestamp,
|
|
241
|
+
tx_digest: tx_digest,
|
|
242
|
+
dov_index: related === null || related === void 0 ? void 0 : related.dov_index,
|
|
243
|
+
sender: "user",
|
|
244
|
+
};
|
|
245
|
+
events.push(e);
|
|
246
|
+
break;
|
|
199
247
|
case structs_2.CancelTradingOrderEvent.$typeName.split("::")[2]:
|
|
200
248
|
var base_token = (0, constants_1.typeArgToAsset)(json.base_token.name);
|
|
201
249
|
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
@@ -385,18 +433,156 @@ function getLiquidateFromSentio(userAddress, startTimestamp, events) {
|
|
|
385
433
|
});
|
|
386
434
|
});
|
|
387
435
|
}
|
|
436
|
+
function getRealizeFundingFromSentio(userAddress, startTimestamp, events) {
|
|
437
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
438
|
+
var datas, realizeFunding;
|
|
439
|
+
return __generator(this, function (_a) {
|
|
440
|
+
switch (_a.label) {
|
|
441
|
+
case 0: return [4 /*yield*/, (0, sentio_1.getFromSentio)("RealizeFunding", userAddress, startTimestamp.toString())];
|
|
442
|
+
case 1:
|
|
443
|
+
datas = _a.sent();
|
|
444
|
+
realizeFunding = datas.map(function (x) {
|
|
445
|
+
var base_token = toToken(x.base_token);
|
|
446
|
+
var txHistory = {
|
|
447
|
+
action: "Realized Funding",
|
|
448
|
+
typeName: "RealizeFundingEvent",
|
|
449
|
+
order_id: undefined,
|
|
450
|
+
position_id: x.position_id,
|
|
451
|
+
market: "".concat(base_token, "/USD"),
|
|
452
|
+
side: undefined,
|
|
453
|
+
order_type: undefined,
|
|
454
|
+
status: "Filled",
|
|
455
|
+
size: undefined,
|
|
456
|
+
base_token: base_token,
|
|
457
|
+
collateral: Number(x.realized_funding_fee),
|
|
458
|
+
collateral_token: x.collateral_token,
|
|
459
|
+
price: undefined,
|
|
460
|
+
realized_pnl: Number(x.realized_funding_fee_usd),
|
|
461
|
+
timestamp: x.timestamp,
|
|
462
|
+
tx_digest: x.transaction_hash,
|
|
463
|
+
dov_index: undefined,
|
|
464
|
+
sender: "cranker",
|
|
465
|
+
};
|
|
466
|
+
return txHistory;
|
|
467
|
+
});
|
|
468
|
+
// deduplicate
|
|
469
|
+
realizeFunding = realizeFunding.filter(function (x) { return events.findIndex(function (y) { return y.tx_digest == x.tx_digest && y.action == "Realized Funding"; }) == -1; });
|
|
470
|
+
realizeFunding = realizeFunding.map(function (x) {
|
|
471
|
+
// find related position
|
|
472
|
+
var related = events.find(function (e) { return e.position_id === x.position_id && e.market === x.market; });
|
|
473
|
+
// console.log(x, related);
|
|
474
|
+
if (related) {
|
|
475
|
+
x.side = related.side;
|
|
476
|
+
x.order_type = related.order_type;
|
|
477
|
+
x.size = related.size;
|
|
478
|
+
x.dov_index = related.dov_index;
|
|
479
|
+
}
|
|
480
|
+
return x;
|
|
481
|
+
});
|
|
482
|
+
// console.log(realizeFunding);
|
|
483
|
+
events = events.concat(realizeFunding);
|
|
484
|
+
events = events.sort(function (a, b) { return Number(new Date(a.timestamp)) - Number(new Date(b.timestamp)); });
|
|
485
|
+
return [2 /*return*/, events];
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
function getRemovePositionFromSentio(userAddress, startTimestamp, events) {
|
|
491
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
492
|
+
var datas;
|
|
493
|
+
return __generator(this, function (_a) {
|
|
494
|
+
switch (_a.label) {
|
|
495
|
+
case 0: return [4 /*yield*/, (0, sentio_1.getFromSentio)("RemovePosition", userAddress, startTimestamp.toString())];
|
|
496
|
+
case 1:
|
|
497
|
+
datas = _a.sent();
|
|
498
|
+
// console.log(datas);
|
|
499
|
+
datas.forEach(function (x) {
|
|
500
|
+
// console.log(x);
|
|
501
|
+
// same tx with order filled
|
|
502
|
+
var index = events.findLastIndex(function (e) { return e.tx_digest == x.transaction_hash && e.action == "Force Close Position"; });
|
|
503
|
+
// console.log(index);
|
|
504
|
+
if (index !== -1) {
|
|
505
|
+
// true => user paid to pool
|
|
506
|
+
var remaining_collateral_amount = x.remaining_collateral_amount;
|
|
507
|
+
events[index] = __assign(__assign({}, events[index]), { collateral: remaining_collateral_amount + Math.max(0, events[index].realized_pnl) });
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
return [2 /*return*/, events];
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
function getCancelOrderFromSentio(userAddress, startTimestamp, events) {
|
|
516
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
517
|
+
var datas, cancelOrder;
|
|
518
|
+
return __generator(this, function (_a) {
|
|
519
|
+
switch (_a.label) {
|
|
520
|
+
case 0: return [4 /*yield*/, (0, sentio_1.getFromSentio)("CancelOrder", userAddress, startTimestamp.toString(), true)];
|
|
521
|
+
case 1:
|
|
522
|
+
datas = _a.sent();
|
|
523
|
+
cancelOrder = datas.map(function (x) {
|
|
524
|
+
var collateral = Number(x.released_collateral_amount);
|
|
525
|
+
var base_token = toToken(x.base_token);
|
|
526
|
+
var txHistory = {
|
|
527
|
+
action: "Force Cancel Order",
|
|
528
|
+
typeName: "CancelTradingOrderEvent",
|
|
529
|
+
order_id: x.order_id,
|
|
530
|
+
position_id: undefined,
|
|
531
|
+
market: "".concat(base_token, "/USD"),
|
|
532
|
+
side: undefined,
|
|
533
|
+
order_type: undefined,
|
|
534
|
+
status: "Canceled",
|
|
535
|
+
size: undefined,
|
|
536
|
+
base_token: base_token,
|
|
537
|
+
collateral: collateral,
|
|
538
|
+
collateral_token: x.collateral_token,
|
|
539
|
+
price: undefined,
|
|
540
|
+
realized_pnl: undefined,
|
|
541
|
+
timestamp: x.timestamp,
|
|
542
|
+
tx_digest: x.transaction_hash,
|
|
543
|
+
dov_index: undefined,
|
|
544
|
+
sender: "cranker",
|
|
545
|
+
};
|
|
546
|
+
return txHistory;
|
|
547
|
+
});
|
|
548
|
+
// no duplicate
|
|
549
|
+
cancelOrder = cancelOrder.map(function (x) {
|
|
550
|
+
// find related order
|
|
551
|
+
var related = events.findLast(function (e) { return e.order_id == x.order_id && e.market == x.market; });
|
|
552
|
+
// console.log(x, related);
|
|
553
|
+
if (related) {
|
|
554
|
+
x.position_id = related.position_id;
|
|
555
|
+
x.side = related.side;
|
|
556
|
+
x.order_type = related.order_type;
|
|
557
|
+
x.size = related.size;
|
|
558
|
+
x.price = related.price;
|
|
559
|
+
}
|
|
560
|
+
return x;
|
|
561
|
+
});
|
|
562
|
+
// console.log(cancelOrder);
|
|
563
|
+
events = events.concat(cancelOrder);
|
|
564
|
+
events = events.sort(function (a, b) { return Number(new Date(a.timestamp)) - Number(new Date(b.timestamp)); });
|
|
565
|
+
return [2 /*return*/, events];
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
}
|
|
388
570
|
function getOrderMatchFromSentio(userAddress, startTimestamp, events) {
|
|
389
571
|
return __awaiter(this, void 0, void 0, function () {
|
|
390
572
|
var datas, order_match;
|
|
391
573
|
return __generator(this, function (_a) {
|
|
392
574
|
switch (_a.label) {
|
|
393
|
-
case 0: return [4 /*yield*/, (0, sentio_1.getFromSentio)("OrderFilled", userAddress, startTimestamp.toString())];
|
|
575
|
+
case 0: return [4 /*yield*/, (0, sentio_1.getFromSentio)("OrderFilled", userAddress, startTimestamp.toString(), true)];
|
|
394
576
|
case 1:
|
|
395
577
|
datas = _a.sent();
|
|
396
578
|
order_match = datas.map(function (x) {
|
|
397
579
|
var base_token = toToken(x.base_token);
|
|
398
580
|
var txHistory = {
|
|
399
|
-
action: x.order_type == "Open"
|
|
581
|
+
action: x.order_type == "Open"
|
|
582
|
+
? "Order Filled (Open Position)"
|
|
583
|
+
: x.sender == "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd"
|
|
584
|
+
? "Force Close Position"
|
|
585
|
+
: "Order Filled (Close Position)",
|
|
400
586
|
typeName: "OrderFilledEvent",
|
|
401
587
|
order_id: x.order_id,
|
|
402
588
|
position_id: x.position_id,
|
|
@@ -413,13 +599,14 @@ function getOrderMatchFromSentio(userAddress, startTimestamp, events) {
|
|
|
413
599
|
timestamp: x.timestamp,
|
|
414
600
|
tx_digest: x.transaction_hash,
|
|
415
601
|
dov_index: undefined,
|
|
416
|
-
sender: "cranker",
|
|
602
|
+
sender: x.is_cranker ? "cranker" : "user",
|
|
417
603
|
};
|
|
418
604
|
return txHistory;
|
|
419
605
|
});
|
|
420
606
|
// deduplicate
|
|
421
607
|
order_match = order_match.filter(function (x) { return events.findIndex(function (y) { return y.tx_digest == x.tx_digest; }) == -1; });
|
|
422
608
|
order_match = order_match.map(function (x) {
|
|
609
|
+
// find related order
|
|
423
610
|
var related = events.findLast(function (e) { return e.order_id == x.order_id && e.market == x.market; });
|
|
424
611
|
// console.log(x, related);
|
|
425
612
|
if (related) {
|
package/dist/src/user/order.d.ts
CHANGED
|
@@ -31,3 +31,7 @@ export declare function releaseCollateral(config: TypusConfig, tx: Transaction,
|
|
|
31
31
|
amount: string;
|
|
32
32
|
suiCoins?: string[];
|
|
33
33
|
}): Promise<Transaction>;
|
|
34
|
+
export declare function collectPositionFundingFee(config: TypusConfig, tx: Transaction, pythClient: PythClient, input: {
|
|
35
|
+
position: Position;
|
|
36
|
+
suiCoins?: string[];
|
|
37
|
+
}): Promise<Transaction>;
|
package/dist/src/user/order.js
CHANGED
|
@@ -68,6 +68,7 @@ exports.zeroCoin = zeroCoin;
|
|
|
68
68
|
exports.cancelTradingOrder = cancelTradingOrder;
|
|
69
69
|
exports.increaseCollateral = increaseCollateral;
|
|
70
70
|
exports.releaseCollateral = releaseCollateral;
|
|
71
|
+
exports.collectPositionFundingFee = collectPositionFundingFee;
|
|
71
72
|
var functions_1 = require("../typus_perp/trading/functions");
|
|
72
73
|
var __1 = require("..");
|
|
73
74
|
var utils_1 = require("@typus/typus-sdk/dist/src/utils");
|
|
@@ -271,3 +272,50 @@ function releaseCollateral(config, tx, pythClient, input) {
|
|
|
271
272
|
});
|
|
272
273
|
});
|
|
273
274
|
}
|
|
275
|
+
function collectPositionFundingFee(config, tx, pythClient, input) {
|
|
276
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
277
|
+
var TOKEN, BASE_TOKEN, tokens, suiCoin, tokens_4, tokens_4_1, token, cToken, baseToken;
|
|
278
|
+
var e_4, _a;
|
|
279
|
+
return __generator(this, function (_b) {
|
|
280
|
+
switch (_b.label) {
|
|
281
|
+
case 0:
|
|
282
|
+
TOKEN = (0, constants_1.typeArgToAsset)(input.position.collateralToken.name);
|
|
283
|
+
BASE_TOKEN = (0, constants_1.typeArgToAsset)(input.position.symbol.baseToken.name);
|
|
284
|
+
tokens = Array.from(new Set([TOKEN, BASE_TOKEN]));
|
|
285
|
+
if (config.sponsored) {
|
|
286
|
+
suiCoin = (0, utils_1.splitCoin)(tx, constants_1.tokenType.MAINNET.SUI, input.suiCoins, tokens.length.toString(), config.sponsored);
|
|
287
|
+
}
|
|
288
|
+
return [4 /*yield*/, (0, utils_1.updatePyth)(pythClient, tx, tokens, suiCoin)];
|
|
289
|
+
case 1:
|
|
290
|
+
_b.sent();
|
|
291
|
+
try {
|
|
292
|
+
for (tokens_4 = __values(tokens), tokens_4_1 = tokens_4.next(); !tokens_4_1.done; tokens_4_1 = tokens_4.next()) {
|
|
293
|
+
token = tokens_4_1.value;
|
|
294
|
+
(0, utils_1.updateOracleWithPythUsd)(pythClient, tx, config.package.oracle, token);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
298
|
+
finally {
|
|
299
|
+
try {
|
|
300
|
+
if (tokens_4_1 && !tokens_4_1.done && (_a = tokens_4.return)) _a.call(tokens_4);
|
|
301
|
+
}
|
|
302
|
+
finally { if (e_4) throw e_4.error; }
|
|
303
|
+
}
|
|
304
|
+
cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
305
|
+
baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
306
|
+
(0, functions_1.collectPositionFundingFee)(tx, [cToken, baseToken], {
|
|
307
|
+
version: __1.PERP_VERSION,
|
|
308
|
+
registry: __1.MARKET,
|
|
309
|
+
poolRegistry: __1.LP_POOL,
|
|
310
|
+
marketIndex: BigInt(0),
|
|
311
|
+
poolIndex: BigInt(0),
|
|
312
|
+
typusOracleCToken: constants_1.oracle[__1.NETWORK][TOKEN],
|
|
313
|
+
typusOracleTradingSymbol: constants_1.oracle[__1.NETWORK][BASE_TOKEN],
|
|
314
|
+
clock: constants_1.CLOCK,
|
|
315
|
+
positionId: BigInt(input.position.positionId),
|
|
316
|
+
});
|
|
317
|
+
return [2 /*return*/, tx];
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
}
|
|
@@ -94,7 +94,7 @@ function createTradingOrderWithBidReceiptByAutoBid(config, tx, pythClient, input
|
|
|
94
94
|
cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
95
95
|
bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
|
96
96
|
baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
97
|
-
(0, functions_1.
|
|
97
|
+
(0, functions_1.createTradingOrderWithBidReceiptV3)(tx, [cToken, bToken, baseToken], {
|
|
98
98
|
version: __1.PERP_VERSION,
|
|
99
99
|
registry: __1.MARKET,
|
|
100
100
|
poolRegistry: __1.LP_POOL,
|
|
@@ -109,7 +109,6 @@ function createTradingOrderWithBidReceiptByAutoBid(config, tx, pythClient, input
|
|
|
109
109
|
isLong: input.isLong,
|
|
110
110
|
dovRegistry: config.registry.dov.dovSingle,
|
|
111
111
|
collateralBidReceipt: collateralBidReceipt,
|
|
112
|
-
user: input.user,
|
|
113
112
|
tailsStakingRegistry: config.registry.typus.tailsStaking,
|
|
114
113
|
competitionConfig: __1.COMPETITION_CONFIG,
|
|
115
114
|
});
|
|
@@ -156,7 +155,7 @@ function createTradingOrderWithBidReceipt(config, tx, pythClient, input) {
|
|
|
156
155
|
cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
157
156
|
bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
|
158
157
|
baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
159
|
-
(0, functions_1.
|
|
158
|
+
(0, functions_1.createTradingOrderWithBidReceiptV3)(tx, [cToken, bToken, baseToken], {
|
|
160
159
|
version: __1.PERP_VERSION,
|
|
161
160
|
registry: __1.MARKET,
|
|
162
161
|
poolRegistry: __1.LP_POOL,
|
|
@@ -171,7 +170,6 @@ function createTradingOrderWithBidReceipt(config, tx, pythClient, input) {
|
|
|
171
170
|
isLong: input.isLong,
|
|
172
171
|
dovRegistry: config.registry.dov.dovSingle,
|
|
173
172
|
collateralBidReceipt: collateralBidReceipt,
|
|
174
|
-
user: input.user,
|
|
175
173
|
tailsStakingRegistry: config.registry.typus.tailsStaking,
|
|
176
174
|
competitionConfig: __1.COMPETITION_CONFIG,
|
|
177
175
|
});
|