mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 14:50:54 +00:00
fix: Prevent AMM auction slots from being acquired at zero cost when trading fee is zero (#7430)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user