10/12/2024 - BE - Borrow fees reset on position increase

What

When a PositionIncrease ix was called, it would reset the cumulative interest snapshot, without previously resolving the already due borrow fees.

Impact

User who had pending borrow fees and used an increase_position IX were exempted of the previously accumulated borrow fees. Given the current usage of the platform this was not a big issue in term of amounts.

Resolution

When the cumulative interest snapshot is refreshed we now save the "unrealized interest amount" in a new counter on the position, that is resolved at close/liquidation (and that is also accounted for during PnL calculations)

Details

issue found: Corto (10/12/2024) issue fix: Orex and Corto patch in: Release/11 - Adrena Program v1.0.10 proposal url: https://dao.adrena.xyz/dao/AdrenaDAO/proposal/6isHBoQ3gswx2dGf3sq6EfAuBB6cTKnMjHiqbQWMhKTi

Last updated