
- Indeed, there was a abs previously iirc so the issue wasn’t happening
DONE : floor when value is negative instead

- previously was using associated token account check
- removed to not use the associated token account program
- not sure the ATA should be the only option, it allow for more flexibility for when we have composable instruction, also make the code more generic. This was conscious choice to get ride of ATA edge case logic. Wdyt?

- Quote position must use the
taker_quote delta as it does not includes the fees yet (so that we can know the exact composition of traded amount, fees..), the quote_position does include the fees since 3.4.5.
- Base position delta could indeed be inferred with the sole
taker_base delta, this is an oversight, but without impact. (change the referential from 0 to x)

- for the minting operation this is crucial as we deposit the equivalent base amount before calling the perp order.
- for the redeeming operation this is optional (more like UX), as we burn redeemable, then return collateral, based on the amount the perp order filled.
This is by design as to minimize the amount of constraints the redemption is subjected to. Open to suggestion if you think this is dubious.

- This is a remnant and will be corrected.
Initial idea was to use checked ADD for amounts that should never overflow, but use wrapping for the one who do, so that if the program run in the next century, wouldn’t be stuck by fee counter increase “year 2000 bug” style
TODO - uniform arithmetic for accounting