Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

haythemsellami
Copy link
Member

@haythemsellami haythemsellami commented Feb 13, 2023

Task: Calc actual oSqthToMint instead of estimating

Description

Fixes ENG-1508

Type of change

  • New feature
  • Bug fix
  • Testing code
  • Document update or config files

@vercel
Copy link

vercel bot commented Feb 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
continuouscall ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 15, 2023 at 4:04PM (UTC)


(uint256 crabCollateral, uint256 crabDebt) =
IZenBullStrategy(_zenBull).getCrabVaultDetails();
// _ethIntoCrab.wmul(crabDebt).wdiv(crabCollateral.add(crabDebt.wmul(feeAdjustment)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delet

Copy link
Member Author

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take minWethForUsdcDebt as input

Copy link
Member Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not max+1?

Copy link
Member Author

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) =
Copy link
Contributor

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)

Copy link
Contributor

@alpinechicken alpinechicken left a 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

@linear
Copy link

linear bot commented Feb 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants