If the "low" estimate is very low, the high estimate is only double that, leaving a situation where you have a low of 0.001 and a high of 0.002. Make the max some other value if 2*low ends up being too small. I recommend:
max(
2*low,
_wethBought * .05
)
Allow purchase price of eth to be 5% over feed price.
If the "low" estimate is very low, the high estimate is only double that, leaving a situation where you have a low of 0.001 and a high of 0.002. Make the max some other value if 2*low ends up being too small. I recommend:
Allow purchase price of eth to be 5% over feed price.