• Determines if a bid is winning based on the auction's clearing price and bid number.

    A bid is considered winning if:

    • Its price exceeds the clearing price, OR
    • Its price equals the clearing price AND its bid number is at or before the clearing price bid number

    Returns

    True if the bid is winning, false otherwise

    Example

    const auction = await fetchAuctionBucketV1(umi, auctionPda);
    const bid = await fetchAuctionBidV1(umi, bidPda);
    const isWinner = isBidWinning(auction, bid); // true (price exceeds clearing)

    Parameters

    • auction: Pick<AuctionBucketV1Input, "clearingPriceUlamports" | "clearingPriceBidNumber">

      The auction bucket with clearing price and clearing price bid number

    • bid: Pick<BidInput, "priceUlamports" | "bidNumber">

      The bid to check with price per token and bid number

    Returns boolean

Generated using TypeDoc