Bonfida/dex-v4

Cranker & Consume order events Bug

Closed this issue · 2 comments

The cranker code is only getting maker callback whereas taker is also required in order to make it work.

But why it's working without error?
Because in the consume events code instead of getting taker from maker. It might be an intended behavior but getting taker from maker seems a bit strange.

Ah thanks for pointing this out, the variable names are indeed incorrect. This stems from the fact that the code you're looking at used to be for the separate self trading case (maker == taker), which turned out didn't need to be separate in the end.
Taker information is not required on the consume_events side though, this is due to the fact that all changes to the taker user account are preemptively made by new_order. The AOB Event still provides taker info for more flexibility, but it isn't strictly necessary in this case.
I am closing this issue for now, just to make it clear that this isn't a bug, but I will definitely correct the mistake ASAP, since code legibility is really important to us.
Thanks for your contribution!

I see. Thank you!

Yeah it’s very good that taker info exists! I’m using it for my usage of aob.