Closed Oighty closed 2 months ago
@0xJem can you double check me on the new tests I wrote here. I think I discovered a precision error that breaks an invariant I came up with while thinking through the price math. Namely, that a users calculated payout from a price & amount should be less than or equal to the expected payout, where the expected payout is the amountOut they bid times the price difference. I'm concerned about some payouts being slightly too big and then bricking someone who needs to claim.
I may be overthinking this because the marginal price is determined from the total bid amounts meeting the required capacity and should account for rounding, but maybe not on a per bid basis.
Closing in preference of #146
Addresses https://github.com/sherlock-audit/2024-03-axis-finance-judging/issues/83