ntropika-labs / potion-protocol

2 stars 3 forks source link

fix: exchange asset amount calculation (CU-375xaj4) #170

Closed wonderbeel closed 1 year ago

wonderbeel commented 1 year ago

This PR fixes the computation of shares and underlying in the WithdrawExchangeAssetBatch and WithdrawExchangeAsset using the round rate to and recipeAmount to calculate the correct exchangeAssetAmount instead of using the one available in the event (because in the batch version of the event this value is the total amount burned between multiple tickets). Tests have been updated to reflect this computation.

aurelianoB commented 1 year ago

Task linked: CU-375xaj4 Deposit Ticket and Withdrawal Ticket subgraph bad calculation on batch event