Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/AutoWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ contract AutoWrapper is BaseHook, DeltaResolver, Ownable2Step {

_settle(Currency.wrap(address(wUSDL)), address(this), uint256(-wUSDLDelta));

int128 amountUnspecified =
isExactInput ? -baseCurrencyDelta.toInt128() : (usdlBalanceAfter - usdlBalanceBefore).toInt128();
int128 amountUnspecified = isExactInput ? -baseCurrencyDelta.toInt128() : inputAmount.toInt128();
swapDelta = toBeforeSwapDelta(-params.amountSpecified.toInt128(), amountUnspecified);
}

Expand Down Expand Up @@ -422,7 +421,7 @@ contract AutoWrapper is BaseHook, DeltaResolver, Ownable2Step {
function getWrapInputRequired(
uint256 wUSDLAmount
) public view returns (int256) {
return int256(wUSDL.previewRedeem(wUSDLAmount));
return int256(wUSDL.previewMint(wUSDLAmount));
}

/**
Expand All @@ -433,7 +432,7 @@ contract AutoWrapper is BaseHook, DeltaResolver, Ownable2Step {
function getUnwrapInputRequired(
uint256 usdlAmount
) public view returns (int256) {
return int256(wUSDL.previewDeposit(usdlAmount));
return int256(wUSDL.previewWithdraw(usdlAmount));
}

/**
Expand Down