Skip to content

Commit

Permalink
feat: standardize rounding in favour of swapper (#246)
Browse files Browse the repository at this point in the history
* feat: standardize rounding in favour of swapper

This commit changes decay to standardize rounding in favour of swapper
- rounding output amounts up and input amounts down

* feat: remove fixedpoint
  • Loading branch information
marktoda committed Apr 19, 2024
1 parent 856a66f commit 0e7be6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/DutchDecayLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ library DutchDecayLib {
if (endAmount < startAmount) {
decayedAmount = startAmount - (startAmount - endAmount).mulDivDown(elapsed, duration);
} else {
decayedAmount = startAmount + (endAmount - startAmount).mulDivDown(elapsed, duration);
decayedAmount = startAmount + (endAmount - startAmount).mulDivUp(elapsed, duration);
}
}
}
Expand Down

0 comments on commit 0e7be6e

Please sign in to comment.