Skip to content

Commit

Permalink
round outputs up on diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Aug 11, 2024
1 parent 5d81d70 commit f14536c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/concrete/ob/OrderBook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,11 @@ contract OrderBook is IOrderBookV4, IMetaV1_2, ReentrancyGuard, Multicall, Order
LibFixedPointDecimalScale.scale18(
output,
orderIOCalculation.context[CONTEXT_VAULT_OUTPUTS_COLUMN][CONTEXT_VAULT_IO_TOKEN_DECIMALS] / 1e18,
0
// Round outputs diff up if the scaling causes a rounding error.
// This only happens if the token has more than 18 decimals.
// Generally it's safer to overestimate output than
// underestimate.
FLAG_ROUND_UP
);
}

Expand Down

0 comments on commit f14536c

Please sign in to comment.