transcodeninja / livepeer-exporter

A Prometheus exporter for Livepeer orchestrator metrics. Fetches and exposes orchestrator metrics from various Livepeer endpoints for Prometheus to scrape.
https://hub.docker.com/r/rickstaa/livepeer-exporter
MIT License
0 stars 0 forks source link

`livepeer_orch_delegator_bonded_amount` doe not include pending stake #61

Open rickstaa opened 9 months ago

rickstaa commented 9 months ago

Describe the bug

I just noticed that the livepeer_orch_delegator_bonded_amount parameter does not include the pending stake accumulated due to network inflation. It would also make sense to offer users the ability to show the total reward (i.e. bonded + pending).

Reproduction steps

  1. Go to https://dashboards.transcode.ninja/public-dashboards/612ce9347bc44e1885e6417b145f4093?orgId=1&refresh=30s.
  2. Check out the delegators panel.
  3. See the summed rewards don't add up to the amount shown on the orchestrator transcoder page.

Expected behaviour

No response

Screenshots / Live demo link

No response

System information

Additional context

No response

rickstaa commented 9 months ago

@stronk-dev, the subgraph also returns the bonded amount without the pending rewards of a delegator. Do you maybe know of a way to improve this:

https://github.com/transcodeninja/livepeer-exporter/blob/d25dda8bc9c9d8568d9565aab36d987734aa7b2d/exporters/orch_delegators_exporter/orch_delegators_exporter.go#L23-L28

My main account, for example, has a cumulated stake of 49.76 while the subgraph returns 49.018229682364821635 🤔.

stronk-dev commented 9 months ago

You could check pending stake on-chain: https://arbiscan.io/address/0x35Bcf3c30594191d53231E4FF333E8A770453e40#readProxyContract#F19

My new API would also count the total stake correctly once that's finished (and I might put some PR's back to the subgraph repo so that one is correct too)

rickstaa commented 9 months ago

You could check pending stake on-chain: https://arbiscan.io/address/0x35Bcf3c30594191d53231E4FF333E8A770453e40#readProxyContract#F19

My new API would also count the total stake correctly once that's finished (and I might put some PR's back to the subgraph repo so that one is correct too)

@stronk-dev, thanks a lot for your answer! For now, I'm happy with the stake without the pending stake. It would be nice to add this feature to the subgraph. If I find time, I will also take a look 👍🏻.

rickstaa commented 9 months ago

@stronk-dev I've opened issue #158 to keep tabs on our discussed feature request. With a strong interest in incorporating this info into the exporter, I'm considering taking it up when time allows. I'll drop a comment on the issue if I proceed. If you're planning any PRs for the subgraph, feel free to comment as well to avoid duplicate efforts 👍🏻.