@drift-labs/jit-proxy 0.13.50 → 0.13.52
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/lib/jitter/baseJitter.js +15 -12
- package/package.json +2 -2
- package/src/jitter/baseJitter.ts +8 -4
package/lib/jitter/baseJitter.js
CHANGED
|
@@ -85,7 +85,7 @@ class BaseJitter {
|
|
|
85
85
|
});
|
|
86
86
|
await ((_a = this.slotSubscriber) === null || _a === void 0 ? void 0 : _a.subscribe());
|
|
87
87
|
await ((_b = this.fastlaneOrderSubscriber) === null || _b === void 0 ? void 0 : _b.subscribe(async (orderMessageRaw, signedMsgOrderParamsMessage) => {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
89
89
|
const signedMsgOrderParams = signedMsgOrderParamsMessage.signedMsgOrderParams;
|
|
90
90
|
if (!signedMsgOrderParams.auctionDuration ||
|
|
91
91
|
!signedMsgOrderParams.auctionStartPrice ||
|
|
@@ -94,6 +94,9 @@ class BaseJitter {
|
|
|
94
94
|
signedMsgOrderParams.auctionEndPrice.eq(sdk_1.ZERO)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
if (signedMsgOrderParams.baseAssetAmount.eq(sdk_1.ZERO)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
97
100
|
const signedMsgOrderParamsBufHex = Buffer.from(orderMessageRaw['order_message']);
|
|
98
101
|
const takerSubaccountId = signedMsgOrderParamsMessage.subAccountId;
|
|
99
102
|
const takerAuthority = new web3_js_1.PublicKey(orderMessageRaw['taker_authority']);
|
|
@@ -109,19 +112,19 @@ class BaseJitter {
|
|
|
109
112
|
slot: new sdk_1.BN(orderSlot),
|
|
110
113
|
marketIndex: signedMsgOrderParams.marketIndex,
|
|
111
114
|
marketType: sdk_1.MarketType.PERP,
|
|
112
|
-
baseAssetAmount:
|
|
113
|
-
auctionDuration:
|
|
114
|
-
auctionStartPrice:
|
|
115
|
-
auctionEndPrice:
|
|
116
|
-
immediateOrCancel: (
|
|
115
|
+
baseAssetAmount: signedMsgOrderParams.baseAssetAmount,
|
|
116
|
+
auctionDuration: signedMsgOrderParams.auctionDuration,
|
|
117
|
+
auctionStartPrice: signedMsgOrderParams.auctionStartPrice,
|
|
118
|
+
auctionEndPrice: signedMsgOrderParams.auctionEndPrice,
|
|
119
|
+
immediateOrCancel: (_a = signedMsgOrderParams.immediateOrCancel) !== null && _a !== void 0 ? _a : false,
|
|
117
120
|
direction: signedMsgOrderParams.direction,
|
|
118
121
|
postOnly: false,
|
|
119
|
-
oraclePriceOffset: (
|
|
120
|
-
maxTs: (
|
|
121
|
-
reduceOnly: (
|
|
122
|
-
triggerCondition: (
|
|
123
|
-
price: (
|
|
124
|
-
userOrderId: (
|
|
122
|
+
oraclePriceOffset: (_b = signedMsgOrderParams.oraclePriceOffset) !== null && _b !== void 0 ? _b : 0,
|
|
123
|
+
maxTs: (_c = signedMsgOrderParams.maxTs) !== null && _c !== void 0 ? _c : sdk_1.ZERO,
|
|
124
|
+
reduceOnly: (_d = signedMsgOrderParams.reduceOnly) !== null && _d !== void 0 ? _d : false,
|
|
125
|
+
triggerCondition: (_e = signedMsgOrderParams.triggerCondition) !== null && _e !== void 0 ? _e : sdk_1.OrderTriggerCondition.ABOVE,
|
|
126
|
+
price: (_f = signedMsgOrderParams.price) !== null && _f !== void 0 ? _f : sdk_1.ZERO,
|
|
127
|
+
userOrderId: (_g = signedMsgOrderParams.userOrderId) !== null && _g !== void 0 ? _g : 0,
|
|
125
128
|
// Rest are not necessary and set for type conforming
|
|
126
129
|
existingPositionDirection: sdk_1.PositionDirection.LONG,
|
|
127
130
|
triggerPrice: sdk_1.ZERO,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/jit-proxy",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.52",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rm -rf lib",
|
|
6
6
|
"build": "yarn clean && tsc"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@coral-xyz/anchor": "0.26.0",
|
|
10
|
-
"@drift-labs/sdk": "2.112.0-beta.
|
|
10
|
+
"@drift-labs/sdk": "2.112.0-beta.8",
|
|
11
11
|
"@solana/web3.js": "1.91.7",
|
|
12
12
|
"tweetnacl-util": "^0.15.1"
|
|
13
13
|
},
|
package/src/jitter/baseJitter.ts
CHANGED
|
@@ -218,6 +218,10 @@ export abstract class BaseJitter {
|
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
if (signedMsgOrderParams.baseAssetAmount.eq(ZERO)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
221
225
|
const signedMsgOrderParamsBufHex = Buffer.from(
|
|
222
226
|
orderMessageRaw['order_message']
|
|
223
227
|
);
|
|
@@ -252,10 +256,10 @@ export abstract class BaseJitter {
|
|
|
252
256
|
slot: new BN(orderSlot),
|
|
253
257
|
marketIndex: signedMsgOrderParams.marketIndex,
|
|
254
258
|
marketType: MarketType.PERP,
|
|
255
|
-
baseAssetAmount: signedMsgOrderParams.baseAssetAmount
|
|
256
|
-
auctionDuration: signedMsgOrderParams.auctionDuration
|
|
257
|
-
auctionStartPrice: signedMsgOrderParams.auctionStartPrice
|
|
258
|
-
auctionEndPrice: signedMsgOrderParams.auctionEndPrice
|
|
259
|
+
baseAssetAmount: signedMsgOrderParams.baseAssetAmount,
|
|
260
|
+
auctionDuration: signedMsgOrderParams.auctionDuration,
|
|
261
|
+
auctionStartPrice: signedMsgOrderParams.auctionStartPrice,
|
|
262
|
+
auctionEndPrice: signedMsgOrderParams.auctionEndPrice,
|
|
259
263
|
immediateOrCancel: signedMsgOrderParams.immediateOrCancel ?? false,
|
|
260
264
|
direction: signedMsgOrderParams.direction,
|
|
261
265
|
postOnly: false,
|