Calculates the winning bids for an auction based on clearing price and token allocation.
This function determines which bids win tokens in the auction by:
Array of winning bids in order of priority
const tree = await fetchAuctionAVLTreeV1(umi, treePda);const clearingPrice = lamportsToMicroLamports(500_000_000); // 0.5 SOLconst tokenSupply = 1_000_000n;const winners = calculateAuctionWinners(tree, clearingPrice, tokenSupply);
The auction AVL tree containing all bids
The clearing price in micro-lamports
The total number of tokens available for distribution
Generated using TypeDoc
Calculates the winning bids for an auction based on clearing price and token allocation.
This function determines which bids win tokens in the auction by:
Returns
Array of winning bids in order of priority
Example