@drift-labs/sdk 2.97.0-beta.35 → 2.97.0-beta.36

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.97.0-beta.35
1
+ 2.97.0-beta.36
@@ -18,14 +18,17 @@ function isFallbackAvailableLiquiditySource(order, minAuctionDuration, slot) {
18
18
  }
19
19
  exports.isFallbackAvailableLiquiditySource = isFallbackAvailableLiquiditySource;
20
20
  function getAuctionPrice(order, slot, oraclePrice) {
21
- if ((0, types_1.isOneOfVariant)(order.orderType, [
22
- 'market',
23
- 'triggerMarket',
24
- 'limit',
25
- 'triggerLimit',
26
- ])) {
21
+ if ((0, types_1.isOneOfVariant)(order.orderType, ['market', 'triggerMarket', 'triggerLimit'])) {
27
22
  return getAuctionPriceForFixedAuction(order, slot);
28
23
  }
24
+ else if ((0, types_1.isVariant)(order.orderType, 'limit')) {
25
+ if (order.oraclePriceOffset !== 0) {
26
+ return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
27
+ }
28
+ else {
29
+ return getAuctionPriceForFixedAuction(order, slot);
30
+ }
31
+ }
29
32
  else if ((0, types_1.isVariant)(order.orderType, 'oracle')) {
30
33
  return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
31
34
  }
@@ -18,14 +18,17 @@ function isFallbackAvailableLiquiditySource(order, minAuctionDuration, slot) {
18
18
  }
19
19
  exports.isFallbackAvailableLiquiditySource = isFallbackAvailableLiquiditySource;
20
20
  function getAuctionPrice(order, slot, oraclePrice) {
21
- if ((0, types_1.isOneOfVariant)(order.orderType, [
22
- 'market',
23
- 'triggerMarket',
24
- 'limit',
25
- 'triggerLimit',
26
- ])) {
21
+ if ((0, types_1.isOneOfVariant)(order.orderType, ['market', 'triggerMarket', 'triggerLimit'])) {
27
22
  return getAuctionPriceForFixedAuction(order, slot);
28
23
  }
24
+ else if ((0, types_1.isVariant)(order.orderType, 'limit')) {
25
+ if (order.oraclePriceOffset !== 0) {
26
+ return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
27
+ }
28
+ else {
29
+ return getAuctionPriceForFixedAuction(order, slot);
30
+ }
31
+ }
29
32
  else if ((0, types_1.isVariant)(order.orderType, 'oracle')) {
30
33
  return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
31
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.97.0-beta.35",
3
+ "version": "2.97.0-beta.36",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -27,14 +27,15 @@ export function getAuctionPrice(
27
27
  oraclePrice: BN
28
28
  ): BN {
29
29
  if (
30
- isOneOfVariant(order.orderType, [
31
- 'market',
32
- 'triggerMarket',
33
- 'limit',
34
- 'triggerLimit',
35
- ])
30
+ isOneOfVariant(order.orderType, ['market', 'triggerMarket', 'triggerLimit'])
36
31
  ) {
37
32
  return getAuctionPriceForFixedAuction(order, slot);
33
+ } else if (isVariant(order.orderType, 'limit')) {
34
+ if (order.oraclePriceOffset !== 0) {
35
+ return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
36
+ } else {
37
+ return getAuctionPriceForFixedAuction(order, slot);
38
+ }
38
39
  } else if (isVariant(order.orderType, 'oracle')) {
39
40
  return getAuctionPriceForOracleOffsetAuction(order, slot, oraclePrice);
40
41
  } else {