[PE-7265] Fix volume attribution for CTA and fee payers #514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous version had a couple of quirks that were not ideal:
So, alternative approach:
2a. Attempt to find claimable tokens transfers that occurred in the same tx. If so, credit for the volume goes to the AUDIO user bank of the user whose claimable tokens account(s) were involved. This is based on the
sender_eth_addressof the claimable tokens transfer.2b. If no claimable tokens transfer is found, the fee payer for the transaction gets credit for the volume.
We do still (left) join in the user_change and check the owner to see if it's either pool authority so that migrations don't get counted.
I need to read through this again tomorrow and make sure it makes sense. But I think this covers things more cleanly than the previous approach. Some possible considerations:
nullfee payer).As a follow-on, if we see weird data here, we can always set up an exclude list of fee payer addresses. I'd rather not do that unless absolutely necessary, though.