enzymefinance / protocol

Enzyme Protocol Implementation

Home Page:https://enzyme.finance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix ExchangeMethodCall event to reflect the quantities that were actually traded

jennazenk opened this issue · comments

Fix ExchangeMethodCall event to reflect the quantities that were actually traded

@jennazenk ExchangeMethodCall was removed with the new internal accounting PR ( #822 ) and replaced with the OrderFilled event (which is exactly for the purpose you're describing).

Yep that's good but we might want to redeploy the current Trading contract with the fix before the deployment of the next big upgrade

Sure, whatever needs to be done as a stopgap would be fine. Alternatively, the frontend can parse a fund's Trading().orders to get the info they need for now.

Just looking at the naming convention and the return values (I wasn't around at the time), it seems like ExchangeMethodCall works as intended: to just basically say "hey, a call was made to callOnExchange with these params," not to make a judgement about an order that was executed with that call.

There would need to be extra logic to compare balances before and after an exchange fill happens at the Trading contract level (that's where ExchangeMethodCall happens, rather than in the adapters themselves), and then interpret the differences in those balances (what if a fee asset and one of the maker/taker assets overlap?, etc). It's more nuanced than it would seem, and that's what OrderFiller takes care of.

Moved to CH