fix: Prevent AMM auction slots from being acquired at zero cost when trading fee is zero (#7430)

This commit is contained in:
Kassaking7
2026-08-20 19:04:04 +00:00
committed by GitHub
parent a1478fac39
commit d0dbf9163c
4 changed files with 87 additions and 30 deletions

View File

@@ -91,6 +91,17 @@ getFee(std::uint16_t tfee)
return Number{tfee} / kAuctionSlotFeeScaleFactor;
}
/**
* Minimum auction slot price: LPTokens * TradingFee / kAuctionSlotMinFeeFraction
* @param lptAMMBalance AMM LP token balance
* @param tradingFee trading fee in {0, 1000}
*/
inline Number
ammAuctionMinSlotPrice(Number const& lptAMMBalance, std::uint16_t tradingFee)
{
return lptAMMBalance * getFee(tradingFee) / kAuctionSlotMinFeeFraction;
}
/**
* Get fee multiplier (1 - tfee)
* @tfee trading fee in basis points