I need help understanding this JSON

What do the keys mean ?

"satelliteID": "118UWpMCHzs6CvSgWd9BfFVjw5K9pZbJjkfZJexMtSkmKxvvAW",
"satelliteURL": "",
"age": 56,
"earned": 100000,
"surge": 100000,
"surgePercent": 100,
"held": 80000,
"heldPercent": 75,
"afterHeld": 20000,
"disposed": 0,
"paid": 20000,
"receipt": "",
"isExitComplete": false,
"distributed": 20000

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.

3 Likes

Yes, that is correct. I have so many questions now.

  1. What is the difference in paid and distributed?
  2. 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 ?
  3. Does adding all the distributed values for a month result in total distributed for that node in that month ?
  4. 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 :slight_smile: :heart_decoration:

I think I found the answer to this at satellite/compensation/db.go.

The whole section is probably relevant for you:

// 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.

2 Likes

They are in US Dollars. We never use STORJ for payout calculations.

3 Likes

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).

5 Likes

Now it makes sense. Thank you for that information.

How should I calculate bonus ? So it reflects perfectly with what the SNO was paid in that month.

1 Like

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.

2 Likes

I have included a disclaimer about this in my script.

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.

I have created a github issue for the same.

1 Like