Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RocketPool support #13

Closed
yorickdowne opened this issue Jan 12, 2023 · 7 comments
Closed

RocketPool support #13

yorickdowne opened this issue Jan 12, 2023 · 7 comments

Comments

@yorickdowne
Copy link

yorickdowne commented Jan 12, 2023

How feasible would it be to add automatic detection of RocketPool minipools and calculate consensus layer rewards that go to the node operator?

A column that has the node fee percentage, and a column that has the rewards earned by the NO, as opposed to earned by the validator:

  • 16 ETH minipool: Total rewards * 0.5 + total rewards * 0.5 * node fee percentage
  • 8 ETH minipool: Total rewards * 0.25 + total rewards * 0.75 * node fee percentage

Acknowledged that this is easy enough to add manually to the generated CSV :)

@eth2353
Copy link
Member

eth2353 commented Jan 14, 2023

Very feasible and it's on my to-do list, see the Gitcoin grant.

I have decided to prioritize execution layer rewards over Rocketpool support (since that will benefit everyone, not just RPL node operators). I've been working on it in my free time since October but there are still some inconsistencies in the rewards calculation (especially when the fee recipient is a smart contract things can get interesting).

When I get to adding Rocketpool support I would like to include RPL rewards as well besides consensus layer rewards.

Do you know how to get the operator commission rate? I haven't looked into it yet, but I assume I'll need to go through events emitted by one of the Rocketpool contracts.

@aliask
Copy link

aliask commented Apr 23, 2023

The commission rate for a Rocketpool validator can be found on chain or via the Beaconcha.in API.
For onchain, you can get this by looking at the deployment of the minipool contract (validator withdrawal address), which includes _minimumNodeFee corresponding to the commission rate of that validator.

The Beaconcha.in API also has an endpoint which contains a lot of relevant info, including the commission rate: https://beaconcha.in/api/v1/rocketpool/validator/{index}

You've possibly already figured this out, but I thought I'd drop the info here anyway.

@eth2353
Copy link
Member

eth2353 commented Apr 25, 2023

Thanks for chiming in @aliask and thanks for the information provided. I would like to avoid using beaconcha.in APIs as much as possible/practical, just to have two independent sources of income data and also to be independent in general.

The problem with the commission rate is that it can change over time. The beaconcha.in API seems to return the current value. But I'm guessing you need to apply the commission rate at the time the rewards was received, right? So I will need to store the values as they change, together with the time period during which they applied.

Here's the major bullet points that I could think of that need to be taken into account for Rocketpool node operators:

  • commission rate changes (as mentioned above)
  • smoothing pool rewards
  • RPL rewards
  • other events
    • bond reductions
    • refund claims

Am I missing anything?

This is going to be harder than I expected 😄

@aliask
Copy link

aliask commented Apr 26, 2023

Yeah, I agree that it would absolutely be best to have an independent implementation. But it's definitely more work 😅.

I didn't realise that you had specific plans for Rocketpool. I actually submitted a bounty application to the RP Grants Management Committee for a tax calculation tool a couple of week ago, and they will decide whether or not to include it in the next 5ish days. So there may be some incentive to complete the work!

One thing which I think is missing is the EL MEV rewards for those not in the smoothing pool. I'm pretty sure those get paid to the minipool address, and then split according to the minipool commission.

The commission only changes at very specific times (almost never). It's only when a minipool performs a "bond reduction", they go from their previous fee, to 14% (in the case of 8ETH minipools). So the commission should whatever they deployed the minipool at, or if they went through a bond reduction, 14%.

RPL and smoothing pool rewards are very complicated to calculate, but fortunately you don't have to do that. The oDAO members generate this data once per rewards period and publish the per-node data on IPFS and a reference to it (the CID) is published on-chain when the rewards are distributed.

Rocketpool support is definitely not a small task, but it would help many people 🙏

@eth2353
Copy link
Member

eth2353 commented Apr 27, 2023

I found this very helpful documentation of how the calculations are performed (and were performed historically).

@eth2353
Copy link
Member

eth2353 commented Feb 2, 2024

I've put a lot of effort into this and it looks like I'm finally close to something viable.

A development version is running at http://194.163.155.173/preview , if anyone is subscribed to this issue and wants to give it a try, compare it to what they expect they earned, it would be greatly appreciated! Feel free to reach out to me in private as well, I'm on the Rocket Pool Discord among many more.

It currently supports:

  • CL and EL income
  • bond reductions
  • RPL income
  • Smoothing Pool income

There are some limitations, but I believe it should work just fine for 99% of RP node operators:

  • the transition from solo staker to a promoted minipool is not supported at the moment. If running promoted minipools, the workaround is to use the default mode for the date range where the validator was running "solo", and Rocket Pool mode for the date range after the promotion
  • pre-Redstone RPL (September 2022) rewards are not supported
  • due to the way the calculations work, the calculate request in Rocket Pool mode may take several minutes to return, especially if the node operator is not using the Smoothing Pool. At the extremes, e.g. with a node that has 450 linked minipools without SP, the request takes about 20 minutes currently.
  • slashing scenarios are not handled right now but the request should return with an error response in this case, and not return incorrect/incomplete data

@eth2353
Copy link
Member

eth2353 commented Feb 6, 2024

Rocket Pool Mode is now a part of ethstaker.tax 🚀 enjoy!

Accompanying blog post: https://serenita.io/blog/ethstaker-tax-rocket-pool-mode

@eth2353 eth2353 closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants