AmbireTech / adex-platform

AdEx Platform UI
https://platform.adex.network
GNU General Public License v3.0
58 stars 19 forks source link

discrepancies between balance (outstanding+on identity) and analytics (eventsPayouts) #317

Closed Ivshti closed 4 years ago

Ivshti commented 4 years ago

Describe the bug There could be a small discrepancy between the total balance of the user and what analytics shows they earned.

There are two sources of this:

  1. min channel earnings: a channel will be counted in the total balance only if the outstanding amount is more than a certain minimum; therefore, if you're earning small amounts from many channels, some won't be counted
  2. validator fees; the eventPayouts reflects the gross earnings while the balances will only count the net earnings after the fees are deducted

To Reproduce With a new account, earn small amounts from multiple campaigns, and the total aggregate earnings as shown by the analytics will be more than your balance.

Expected behavior There should not be discrepancies

Solutions

The validator can now return /analytics segmented by channel (?segmentedByChannel) - which means it will return a separate data point for each channel/time pair, allowing the Platform to "post-process" those data points in such a way that will be consistent with the balance calculation.

To solve this issue, do this only for publisher payout analytics (impresions are not affected):

rori4 commented 4 years ago

Shouldn't this be fixed in the data provided by the validator?

Ivshti commented 4 years ago

Yes, putting the respective label.

It should indeed be fixed in the validator, I opened the issue here so we can track it as a bug in the platform too, but I'll make the respective issue in adex-validator once we have it figured out.

Also, the first point might still have to be corrected in the platform since the platform determines the min amounts for sweeping

Ivshti commented 4 years ago

because segmentByChannel was merged, I'm removing the blocked-by-validator: https://github.com/AdExNetwork/adex-validator/pull/258

Now the validator will return records by channel, so we can process/filter them on the client side to remove discrepancies

Ivshti commented 4 years ago

@rori4 at the end, we decided that it will be fixed in the Platform

The reason is that the Platform determines what's counted towards the balance and what's not, so it has the final say.

If this decision leads to performance degradation, we will look for ways to shift work back to the server