It looks like you’re working with the result of the /payout-history/{period} endpoint on the node. Is that right? If so, this corresponds to the type payouts.SatellitePayoutForPeriod. Although that probably doesn’t help much, as I don’t see any documentation there beyond “SatellitePayoutForPeriod contains payouts information for specific period for specific satellite.”
That structure is only filled out in the function (*Service).AllSatellitesPayoutPeriod(), so that might help. satelliteID and satelliteURL are probably self-explanatory. age is apparently the (current) age of your node in months according to the satellite. heldPercent is how much of a payment would be held by the satellite in the period that this record is for. It looks like earned, surge, held, paid, distributed are amounts in “microcurrency” units, i.e., 0.000001 STORJ.
Does that help? I’m admittedly not very familiar with this code.
Yes, that is correct. I have so many questions now.
What is the difference in paid and distributed?
Is surge applied to the distrubuted value ? If its not then where is it applied or how that is taken in to account in the calculation ?
Does adding all the distributed values for a month result in total distributed for that node in that month ?
How does surgePercent get in the calculation of what amount is distributed/paid to the SNO ?
Thank you for that bit of information and the keyword “microcurrency”. This confirms what Alexey has suggested to use 1e6 for all monetary divisions.
You taking time to reply during holidays is what helps me admire the spirit of Storj and Storjlings. Thank you for that
// TotalAmounts holds the amounts held and disposed.
//
// Invariants:
//
// TotalHeld >= TotalDisposed
// TotalPaid >= TotalDisposed
// TotalPaid >= TotalDistributed (we may distribute less due to minimum payout threshold)
type TotalAmounts struct {
TotalHeld currency.MicroUnit // portion from owed that was held back
TotalDisposed currency.MicroUnit // portion from held back that went into paid
TotalPaid currency.MicroUnit // earned amount that is available to be distributed
TotalDistributed currency.MicroUnit // amount actually transferred to the operator
}
The other questions look like they’d take a bit more digging, at least for me.
I just want to point out the odd choice of words regarding paid and distributed, in my opinion.
Here paid is not actually paid but earned that’s yet to be paid. This confusion could have been avoided by labelling it TotalEarned while TotalDistributed could be labelled as TotalPaid since its actually “paid” to SNO.
Considering the above code, if I add up all the distributed rows from the endpoint for a particular month, I would end up with a total that is distributed (paid) for that month. Is this correct ?
Sorry about the naming - paid used to make sense, before we introduced the minimum payout threshold. Then we had people earning $0.02 when Eth transaction fees cost $2.00 and that was a bit silly. So we added distributed without going back and renaming paid to something more sensible.
Distributed is indeed the final value that corresponds to what the Satellite thinks was actually sent via the payment process.
Note that this does not include bonus multipliers (zksync transfers used to get a 10% bonus, now they get 3%, the Ukraine bonus policy was 2x for a while, etc).
We’re missing a way to channel this back through the API. I have an outstanding ticket to add cost basis for the STORJ/USD conversion into the data flow here, but it’s not done yet.
The /payout-history/ endpoint currently does not show decommissioned satellites Europe North 1 and US2. While paystubs endpoint does show decommissioned satellites.
When reports for both endpoints are compared, a discrepancy is observed i.e. paystub report shows more amount compared to payout-history.