You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this when implementing an orderbook based only on events.
We emit a SolutionSubmission event when a solution is accepted. This event allows us to update the solution submitter's fee token balance based on solution fee reward (their OWL balance increases). Handling this properly is needed in the orderbook because we need to know accurate balances for all users. This includes the solution submitter in case they decide to participate in trading, too.
When a solution is reverted we correctly emit a TradeReversion event for each trade but we silently decrease the previously granted solution free reward. This goes unnoticed in the orderbook.
There is a workaround: We can keep track of the latest solution submitter and granted reward. When we notice any TradeReversion we know the solution must have been reverted and deduct the reward again and delete our record of the latest solution (so that we don't deduct it multiple times).
I think this works in every case but it doesn't feel intended.
The text was updated successfully, but these errors were encountered:
e00E
changed the title
There should be a SolutionReverted event
There should be a SolutionReversion event
Mar 26, 2020
We can keep track of the latest solution submitter and granted reward. When we notice any TradeReversion we know the solution must have been reverted and deduct the reward again and delete our record of the latest solution (so that we don't deduct it multiple times).
If I understand everything correctly, shouldn't a new SolutionSubmission for the same batch just revert the fee transfer to the solution submitter in case there was a previous solution submission? I think that feels less hacky than using TradeReversion events.
I noticed this when implementing an orderbook based only on events.
We emit a
SolutionSubmission
event when a solution is accepted. This event allows us to update the solution submitter's fee token balance based on solution fee reward (their OWL balance increases). Handling this properly is needed in the orderbook because we need to know accurate balances for all users. This includes the solution submitter in case they decide to participate in trading, too.When a solution is reverted we correctly emit a
TradeReversion
event for each trade but we silently decrease the previously granted solution free reward. This goes unnoticed in the orderbook.There is a workaround: We can keep track of the latest solution submitter and granted reward. When we notice any
TradeReversion
we know the solution must have been reverted and deduct the reward again and delete our record of the latest solution (so that we don't deduct it multiple times).I think this works in every case but it doesn't feel intended.
The text was updated successfully, but these errors were encountered: