Skip to content

Commit 2032794

Browse files
committed
sdk: tweak math for filling triggers
1 parent 803fc32 commit 2032794

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sdk/src/math/auction.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export function isFallbackAvailableLiquiditySource(
2626
return true;
2727
}
2828

29+
if ((order.bitFlags & OrderBitFlag.SafeTriggerOrder) !== 0) {
30+
return true;
31+
}
32+
2933
return new BN(slot).sub(order.slot).gt(new BN(minAuctionDuration));
3034
}
3135

sdk/src/math/orders.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export function isFillableByVAMM(
245245
market,
246246
mmOraclePriceData,
247247
slot
248-
).gte(market.amm.minOrderSize)) ||
248+
).gt(ZERO)) ||
249249
isOrderExpired(order, ts)
250250
);
251251
}
@@ -256,10 +256,6 @@ export function calculateBaseAssetAmountForAmmToFulfill(
256256
mmOraclePriceData: MMOraclePriceData,
257257
slot: number
258258
): BN {
259-
if (mustBeTriggered(order) && !isTriggered(order)) {
260-
return ZERO;
261-
}
262-
263259
const limitPrice = getLimitPrice(order, mmOraclePriceData, slot);
264260
let baseAssetAmount;
265261

0 commit comments

Comments
 (0)