four-flap-meme-sdk 1.4.64 → 1.4.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -160,8 +160,10 @@ export async function flapBundleBuyFirstMerkle(params) {
|
|
|
160
160
|
// ✅ 拆分买入和卖出金额
|
|
161
161
|
const buyAmountsWei = splitAmount(buyerFundsWei, buyCount);
|
|
162
162
|
const sellAmountsWei = splitAmount(sellAmountWei, sellCount);
|
|
163
|
-
// ✅
|
|
164
|
-
|
|
163
|
+
// ✅ 多笔买入时,minOutputAmount 设置为 0 以避免滑点导致交易失败
|
|
164
|
+
// 原因:每笔买入会改变池子价格,后续买入获得的代币会变少
|
|
165
|
+
// 单笔买入时使用正常的 minOutputAmount 作为保护
|
|
166
|
+
const minOutputPerBuy = buyCount === 1 ? sellAmountWei : 0n;
|
|
165
167
|
// ✅ 第三批并行 - 构建多笔买入和卖出交易、estimatedSellFunds
|
|
166
168
|
const buyUnsignedPromises = buyAmountsWei.map(amount => portalBuyer.swapExactInput.populateTransaction({
|
|
167
169
|
inputToken,
|