Skip to content

Commit

Permalink
change ratioPrecision.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 committed Sep 29, 2024
1 parent b98c30a commit 6859fdd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/functions/ConstantProduct2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,8 @@ contract ConstantProduct2 is ProportionalLPToken2, IBeanstalkWellFunction {

/**
* @notice Returns the precision of the ratio at which the pump will cap the reserve at.
* @param j The index of the reserve to solve for
* @param data The data passed to the well function
* @return precision The precision of the ratio at which the pump will cap the reserve at
*/
function ratioPrecision(uint256 j, bytes calldata data) external pure returns (uint256 precision) {
(uint256 iDecimals, uint256 jDecimals) = abi.decode(data, (uint256, uint256));
if (j == 0) {
return ((10 ** iDecimals) * CALC_RATE_PRECISION) / (10 ** jDecimals);
} else {
return ((10 ** jDecimals) * CALC_RATE_PRECISION) / (10 ** iDecimals);
}
function ratioPrecision(uint256, bytes calldata) external pure returns (uint256 precision) {
return CALC_RATE_PRECISION;
}
}

0 comments on commit 6859fdd

Please sign in to comment.