@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.
@@ -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, _h, _j, _k, _l;
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: (_a = signedMsgOrderParams.baseAssetAmount) !== null && _a !== void 0 ? _a : sdk_1.ZERO,
113
- auctionDuration: (_b = signedMsgOrderParams.auctionDuration) !== null && _b !== void 0 ? _b : 0,
114
- auctionStartPrice: (_c = signedMsgOrderParams.auctionStartPrice) !== null && _c !== void 0 ? _c : sdk_1.ZERO,
115
- auctionEndPrice: (_d = signedMsgOrderParams.auctionEndPrice) !== null && _d !== void 0 ? _d : sdk_1.ZERO,
116
- immediateOrCancel: (_e = signedMsgOrderParams.immediateOrCancel) !== null && _e !== void 0 ? _e : false,
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: (_f = signedMsgOrderParams.oraclePriceOffset) !== null && _f !== void 0 ? _f : 0,
120
- maxTs: (_g = signedMsgOrderParams.maxTs) !== null && _g !== void 0 ? _g : sdk_1.ZERO,
121
- reduceOnly: (_h = signedMsgOrderParams.reduceOnly) !== null && _h !== void 0 ? _h : false,
122
- triggerCondition: (_j = signedMsgOrderParams.triggerCondition) !== null && _j !== void 0 ? _j : sdk_1.OrderTriggerCondition.ABOVE,
123
- price: (_k = signedMsgOrderParams.price) !== null && _k !== void 0 ? _k : sdk_1.ZERO,
124
- userOrderId: (_l = signedMsgOrderParams.userOrderId) !== null && _l !== void 0 ? _l : 0,
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.50",
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.7",
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
  },
@@ -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 ?? ZERO,
256
- auctionDuration: signedMsgOrderParams.auctionDuration ?? 0,
257
- auctionStartPrice: signedMsgOrderParams.auctionStartPrice ?? ZERO,
258
- auctionEndPrice: signedMsgOrderParams.auctionEndPrice ?? ZERO,
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,