Skip to content

Commit

Permalink
sdk: fix isFillableByVAMM
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 22, 2023
1 parent f01ee25 commit 1b5c00e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sdk/src/math/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
import { ZERO, TWO } from '../constants/numericConstants';
import { BN } from '@coral-xyz/anchor';
import { OraclePriceData } from '../oracles/types';
import { getAuctionPrice, isAuctionComplete } from './auction';
import {
getAuctionPrice,
isAuctionComplete,
isFallbackAvailableLiquiditySource,
} from './auction';
import {
calculateMaxBaseAssetAmountFillable,
calculateMaxBaseAssetAmountToTrade,
Expand Down Expand Up @@ -186,10 +190,11 @@ export function isFillableByVAMM(
market: PerpMarketAccount,
oraclePriceData: OraclePriceData,
slot: number,
ts: number
ts: number,
minAuctionDuration: number
): boolean {
return (
(isAuctionComplete(order, slot) &&
(isFallbackAvailableLiquiditySource(order, minAuctionDuration, slot) &&
calculateBaseAssetAmountForAmmToFulfill(
order,
market,
Expand Down

0 comments on commit 1b5c00e

Please sign in to comment.