From 91e6a916acc8a343ee79f7101c7d7d2b0492226a Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 29 Sep 2025 16:10:30 -0400 Subject: [PATCH] burnSwap fees --- src/PartyPoolSwapMintImpl.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/PartyPoolSwapMintImpl.sol b/src/PartyPoolSwapMintImpl.sol index 87decab..1d5249f 100644 --- a/src/PartyPoolSwapMintImpl.sol +++ b/src/PartyPoolSwapMintImpl.sol @@ -45,8 +45,6 @@ contract PartyPoolSwapMintImpl is PartyPoolBase { require(inputTokenIndex < n, "swapMint: idx"); require(maxAmountIn > 0, "swapMint: input zero"); require(deadline == 0 || block.timestamp <= deadline, "swapMint: deadline"); - - // Ensure pool initialized require(lmsr.nAssets > 0, "swapMint: uninit pool"); // compute fee on gross maxAmountIn to get an initial net estimate (we'll recompute based on actual used) @@ -136,7 +134,6 @@ contract PartyPoolSwapMintImpl is PartyPoolBase { /// @param deadline optional deadline /// @param swapFeePpm fee in parts-per-million for this pool (may be used for future fee logic) /// @return amountOutUint uint amount of asset i sent to receiver - // todo fee!? function burnSwap( address payer, address receiver, @@ -155,7 +152,8 @@ contract PartyPoolSwapMintImpl is PartyPoolBase { require(balanceOf(payer) >= lpAmount, "burnSwap: insufficient LP"); // alpha = lpAmount / supply as Q64.64 - int128 alpha = ABDKMath64x64.divu(lpAmount, supply); + int128 alpha = ABDKMath64x64.divu(lpAmount, supply) // fraction of total supply to burn + .mul(ABDKMath64x64.divu(1000000-swapFeePpm, 1000000)); // adjusted for fee // Use LMSR view to compute single-asset payout and burned size-metric (int128 payoutInternal, ) = lmsr.swapAmountsForBurn(inputTokenIndex, alpha);