@drift-labs/sdk 2.48.0-beta.7 → 2.48.0-beta.9

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.48.0-beta.7
1
+ 2.48.0-beta.9
@@ -54,7 +54,7 @@ class PollingUserAccountSubscriber {
54
54
  async fetch() {
55
55
  var _a, _b;
56
56
  const dataAndContext = await this.program.account.user.fetchAndContext(this.userAccountPublicKey, this.accountLoader.commitment);
57
- if ((_b = dataAndContext.context.slot > ((_a = this.user) === null || _a === void 0 ? void 0 : _a.slot)) !== null && _b !== void 0 ? _b : 0) {
57
+ if (dataAndContext.context.slot > ((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : 0)) {
58
58
  this.user = {
59
59
  data: dataAndContext.data,
60
60
  slot: dataAndContext.context.slot,
@@ -54,7 +54,7 @@ class PollingUserStatsAccountSubscriber {
54
54
  async fetch() {
55
55
  var _a, _b;
56
56
  const dataAndContext = await this.program.account.userStats.fetchAndContext(this.userStatsAccountPublicKey, this.accountLoader.commitment);
57
- if ((_b = dataAndContext.context.slot > ((_a = this.userStats) === null || _a === void 0 ? void 0 : _a.slot)) !== null && _b !== void 0 ? _b : 0) {
57
+ if (dataAndContext.context.slot > ((_b = (_a = this.userStats) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : 0)) {
58
58
  this.userStats = {
59
59
  data: dataAndContext.data,
60
60
  slot: dataAndContext.context.slot,
@@ -93,7 +93,7 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
93
93
  }
94
94
  const updatedAmm = (0, __1.calculateUpdatedAMM)(marketAccount.amm, oraclePriceData);
95
95
  let [openBids, openAsks] = (0, __1.calculateMarketOpenBidAsk)(updatedAmm.baseAssetReserve, updatedAmm.minBaseAssetReserve, updatedAmm.maxBaseAssetReserve, updatedAmm.orderStepSize);
96
- const minOrderSize = marketAccount.amm.orderStepSize;
96
+ const minOrderSize = marketAccount.amm.minOrderSize;
97
97
  if (openBids.lt(minOrderSize.muln(2))) {
98
98
  openBids = __1.ZERO;
99
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.48.0-beta.7",
3
+ "version": "2.48.0-beta.9",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -97,7 +97,7 @@ export class PollingUserAccountSubscriber implements UserAccountSubscriber {
97
97
  this.userAccountPublicKey,
98
98
  this.accountLoader.commitment
99
99
  );
100
- if (dataAndContext.context.slot > this.user?.slot ?? 0) {
100
+ if (dataAndContext.context.slot > (this.user?.slot ?? 0)) {
101
101
  this.user = {
102
102
  data: dataAndContext.data as UserAccount,
103
103
  slot: dataAndContext.context.slot,
@@ -101,7 +101,7 @@ export class PollingUserStatsAccountSubscriber
101
101
  this.userStatsAccountPublicKey,
102
102
  this.accountLoader.commitment
103
103
  );
104
- if (dataAndContext.context.slot > this.userStats?.slot ?? 0) {
104
+ if (dataAndContext.context.slot > (this.userStats?.slot ?? 0)) {
105
105
  this.userStats = {
106
106
  data: dataAndContext.data as UserStatsAccount,
107
107
  slot: dataAndContext.context.slot,
@@ -173,7 +173,7 @@ export function getVammL2Generator({
173
173
  updatedAmm.orderStepSize
174
174
  );
175
175
 
176
- const minOrderSize = marketAccount.amm.orderStepSize;
176
+ const minOrderSize = marketAccount.amm.minOrderSize;
177
177
  if (openBids.lt(minOrderSize.muln(2))) {
178
178
  openBids = ZERO;
179
179
  }