This commit is contained in:
tim
2025-09-30 15:42:52 -04:00
parent 91e6a916ac
commit 5ce14ab2e1
10 changed files with 100 additions and 86 deletions

View File

@@ -711,7 +711,7 @@ contract LMSRStabilizedTest is Test {
}
// Path 1: Direct swap from asset 0 to asset 2
(int128 directAmountIn, int128 directAmountOut) = s.swapAmountsForExactInput(0, 2, directSwapAmount, 0);
(/*int128 directAmountIn*/, int128 directAmountOut) = s.swapAmountsForExactInput(0, 2, directSwapAmount, 0);
// Restore original state for second path
_updateCachedQInternal(backupQ);
@@ -724,7 +724,7 @@ contract LMSRStabilizedTest is Test {
s.qInternal[1] = s.qInternal[1].add(indirectAmountOut1);
// Second swap: asset 1 -> asset 2
(int128 indirectAmountIn2, int128 indirectAmountOut2) = s.swapAmountsForExactInput(1, 2, indirectAmountOut1, 0);
(/*int128 indirectAmountIn2*/, int128 indirectAmountOut2) = s.swapAmountsForExactInput(1, 2, indirectAmountOut1, 0);
// The path independence property isn't perfect due to discrete swap mechanics,
// but the difference should be within reasonable bounds
@@ -765,7 +765,7 @@ contract LMSRStabilizedTest is Test {
s.qInternal[1] = s.qInternal[1].add(amountOut1);
// Step 2: Swap back asset 1 -> asset 0
(int128 amountIn2, int128 amountOut2) = s.swapAmountsForExactInput(1, 0, amountOut1, 0);
(/*int128 amountIn2*/, int128 amountOut2) = s.swapAmountsForExactInput(1, 0, amountOut1, 0);
// Calculate round-trip slippage: (initial amount - final amount) / initial amount
int128 roundTripSlippage = (amountIn1.sub(amountOut2)).div(amountIn1);