Skip to content

Conversation

@adhusson
Copy link
Contributor

Specify slippage by price instead of limit amount, which became less useful since we stopped adjusting amounts that are not type(uint).max.

Notes:

  • Price argument names have a E18 to avoid any risk of error / confusion when e.g. called from the js. It makes the units obvious.
  • Don't used wDiv in the contract, multiply only. Possibility to completely remove the MathLib.sol import if WAD is redefined locally.

@adhusson adhusson requested a review from MathisGD November 18, 2024 18:34
@adhusson adhusson changed the base branch from main to refactor/harmonize-amount-interpretation November 18, 2024 18:35
Base automatically changed from refactor/harmonize-amount-interpretation to main November 19, 2024 10:32
@adhusson adhusson changed the title slippage by price feat: slippage by price Nov 19, 2024
@adhusson adhusson requested a review from MathisGD November 20, 2024 21:38
@adhusson
Copy link
Contributor Author

Made a fix + moved to wDivDown so that type(uint).max can be used as a share price (for when you don't care).

@adhusson adhusson merged commit e60c256 into main Nov 23, 2024
8 checks passed
@adhusson adhusson deleted the refactor/slippage-by-price branch November 23, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants