Previously, OrderChange events for closing an open SpotOrder weren't updating that SpotOrder's base_size because the field OrderChange.order was null and the handler was attempting to load a SpotOrder based off of OrderChange.order.id (which was null) instead of Orderchange.order_id.
**Make sure to double check the logic for the changes. I'm not super familiar with Spark orderbook smart contracts and event emitting patterns so this could miss an edge case. But it does solve the issue of the "phantom order" we encountered.
Previously,
OrderChange
events for closing an openSpotOrder
weren't updating thatSpotOrder
'sbase_size
because the fieldOrderChange.order
was null and the handler was attempting to load aSpotOrder
based off ofOrderChange.order.id
(which was null) instead ofOrderchange.order_id
.**Make sure to double check the logic for the changes. I'm not super familiar with Spark orderbook smart contracts and event emitting patterns so this could miss an edge case. But it does solve the issue of the "phantom order" we encountered.