Skip to content

Commit

Permalink
test(tradingFunction): adds BTT tests for the trading function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexangelj committed Sep 5, 2023
1 parent 88e6fc8 commit 821dc93
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/TestPortfolioInvariant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ contract TestPortfolioInvariant is Setup {
bound(deltaY, MINIMUM_DELTA, reserveYPerWad - MINIMUM_RESERVE_Y);

uint256 prevQuotient = reserveYPerWad.divWadUp(strikePriceWad);
uint256 quotient = (reserveYPerWad - deltaY).divWadUp(strikePriceWad);
uint256 quotient = (reserveYPerWad - deltaY).divWadDown(strikePriceWad);
console.log("prevQuotient: ", prevQuotient);
console.log("quotient: ", quotient);
vm.assume(quotient > 0 && quotient < 1 ether);

/// Make sure quotient is within bounds and it decreases by at least 2
vm.assume(prevQuotient >= MINIMUM_QUOTIENT_DELTA);
Expand Down
Loading

0 comments on commit 821dc93

Please sign in to comment.