-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Calc actual oSqthToMint instead of estimating #979
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
(uint256 crabCollateral, uint256 crabDebt) = | ||
IZenBullStrategy(_zenBull).getCrabVaultDetails(); | ||
// _ethIntoCrab.wmul(crabDebt).wdiv(crabCollateral.add(crabDebt.wmul(feeAdjustment))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it as a reference because the actual implementation is quite long with parentheses, so I'll just keep it
_exactInFlashSwap( | ||
usdc, | ||
weth, | ||
_params.wethUsdcPoolFee, | ||
usdcToBorrow, | ||
minWethForUsdcDebt, | ||
wethToLend - (_params.depositsToProcess + wethFromAuction - ethIntoCrab), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take minWethForUsdcDebt as input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do this in separate PR
vm.prank(owner); | ||
vm.expectRevert(bytes("ZBN02")); | ||
zenBullNetting.setOTCPriceTolerance(maxOtcPriceTolerance + 1); | ||
zenBullNetting.setOTCPriceTolerance(3e17); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not max+1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it private, to decrease contract size, so can't fetch it, trying to do with Vm though
(, uint256 crabDebt) = IZenBullStrategy(ZEN_BULL).getCrabVaultDetails(); | ||
uint256 oSqthAmount = crabAmount * crabDebt / crabTotalSupply; | ||
|
||
(uint256 crabCollateral, uint256 crabDebt) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need the same in depositAuction integration tests (without angering the stack2deep gods)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - deposit integration tests could use exact oSQTH amount like in the DepositAuctionFuzzing
Task: Calc actual oSqthToMint instead of estimating
Description
Fixes ENG-1508
Type of change