Livepeer Subgraph Updates


#1

Hey all - I wanted to share some updates I made to the Livepeer Subgraph in support of an email notification application I’m building for token holders (a Livepeer Community Node grant project).

While creating the engineering spec for this grant project I realized one of the requirements assumed access to data that’s not readily available in the Livepeer smart contracts. Per the Community Node’s wish list, the email notifications should offer token holders two value propositions:

  1. Daily, weekly, or monthly summaries of their transcoder’s reward calls (missed vs made)
  2. Daily, weekly, or monthly summaries of their earnings

Missed reward calls for past rounds are already available in the Livepeer Subgraph, however, delegator earnings for past rounds were not, without making some updates to it. So, I’ve added two new Subgraph entities, Delegator (for storing delegator data) and Share (for storing a delegator’s share of earnings associated with a given round).

I’ve published these updates to The Graph’s new Explorer/hosted service (which is totally awesome by the way!) so you can play around with this data using the Subgraph’s GraphQL playground or the API endpoint it provides, and ask for data such as the following:

  • Show me all earnings for delegator X between rounds 1200-1207.
  • Show me all earnings for delegator X between Dec 1st and Dec 31st
  • Show me all delegators bonded to transcoder X

This data also opens up the possibility to compute some interesting statistics. For example, you can now easily compute the median and average delegator stake associated with each transcoder (or across the entire protocol).

I hope some of you find this useful! Feel free to respond with any questions or feedback.