@drift-labs/sdk 2.52.0-beta.14 → 2.52.0-beta.15

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.52.0-beta.14
1
+ 2.52.0-beta.15
@@ -11,7 +11,7 @@ export declare function standardizePrice(price: BN, tickSize: BN, direction: Pos
11
11
  export declare function getLimitPrice(order: Order, oraclePriceData: OraclePriceData, slot: number, fallbackPrice?: BN): BN | undefined;
12
12
  export declare function hasLimitPrice(order: Order, slot: number): boolean;
13
13
  export declare function hasAuctionPrice(order: Order, slot: number): boolean;
14
- export declare function isFillableByVAMM(order: Order, market: PerpMarketAccount, oraclePriceData: OraclePriceData, slot: number, ts: number): boolean;
14
+ export declare function isFillableByVAMM(order: Order, market: PerpMarketAccount, oraclePriceData: OraclePriceData, slot: number, ts: number, minAuctionDuration: number): boolean;
15
15
  export declare function calculateBaseAssetAmountForAmmToFulfill(order: Order, market: PerpMarketAccount, oraclePriceData: OraclePriceData, slot: number): BN;
16
16
  export declare function calculateBaseAssetAmountToFillUpToLimitPrice(order: Order, amm: AMM, limitPrice: BN, oraclePriceData: OraclePriceData): BN;
17
17
  export declare function isOrderExpired(order: Order, ts: number, enforceBuffer?: boolean): boolean;
@@ -124,8 +124,8 @@ function hasAuctionPrice(order, slot) {
124
124
  (!order.auctionStartPrice.eq(numericConstants_1.ZERO) || !order.auctionEndPrice.eq(numericConstants_1.ZERO)));
125
125
  }
126
126
  exports.hasAuctionPrice = hasAuctionPrice;
127
- function isFillableByVAMM(order, market, oraclePriceData, slot, ts) {
128
- return (((0, auction_1.isAuctionComplete)(order, slot) &&
127
+ function isFillableByVAMM(order, market, oraclePriceData, slot, ts, minAuctionDuration) {
128
+ return (((0, auction_1.isFallbackAvailableLiquiditySource)(order, minAuctionDuration, slot) &&
129
129
  calculateBaseAssetAmountForAmmToFulfill(order, market, oraclePriceData, slot).gte(market.amm.minOrderSize)) ||
130
130
  isOrderExpired(order, ts));
131
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.52.0-beta.14",
3
+ "version": "2.52.0-beta.15",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -10,7 +10,11 @@ import {
10
10
  import { ZERO, TWO } from '../constants/numericConstants';
11
11
  import { BN } from '@coral-xyz/anchor';
12
12
  import { OraclePriceData } from '../oracles/types';
13
- import { getAuctionPrice, isAuctionComplete } from './auction';
13
+ import {
14
+ getAuctionPrice,
15
+ isAuctionComplete,
16
+ isFallbackAvailableLiquiditySource,
17
+ } from './auction';
14
18
  import {
15
19
  calculateMaxBaseAssetAmountFillable,
16
20
  calculateMaxBaseAssetAmountToTrade,
@@ -186,10 +190,11 @@ export function isFillableByVAMM(
186
190
  market: PerpMarketAccount,
187
191
  oraclePriceData: OraclePriceData,
188
192
  slot: number,
189
- ts: number
193
+ ts: number,
194
+ minAuctionDuration: number
190
195
  ): boolean {
191
196
  return (
192
- (isAuctionComplete(order, slot) &&
197
+ (isFallbackAvailableLiquiditySource(order, minAuctionDuration, slot) &&
193
198
  calculateBaseAssetAmountForAmmToFulfill(
194
199
  order,
195
200
  market,