/Docs

/ Docs

Introduction

Installation

Install Livepeer Client

Video Developers

Getting Started

Overview

Protocol

Reference

Subgraph API Entities

protocol

/

reference

Subgraph API Entities

Entities define the schema of the subgraph, and represent the data that can be queried. Within each entity are sets of fields that store useful information related to the entity. Below is a list of the available entities within the Livepeer Subgraph, and descriptions for the available fields.

To see an interactive sandbox of all entities see the Graph Explorer.

Each entity is defined with a value type, which will always be a base AssemblyScript type, or a custom type provided by The Graph's custom TypeScript library. For more information on value types see here.

Protocol

The Protocol entity is responsible for storing aggregate information across the entire protocol. It can be used to view stats such as total supply, total active stake, total volume, participation rate and more. There is only one Protocol entity in the subgraph.

FieldTypeDescription
idID

ID is set to 0

inflationBigInt

Per round inflation rate

inflationChangeBigInt

Change in inflation rate per round until the target bonding rate is achieved

numActiveTranscodersInt

Total active transcoders

pausedBoolean

True if the protocol is paused

targetBondingRateBigInt

Target bonding rate (participation) that determines whether inflation should increase or decrease

unbondingPeriodBigInt

Time in blocks needed to wait to unstake

lockPeriodBigInt

Time in blocks delegators have to review transcoder information without changes

roundLockAmountBigInt

Lock period of a round as a % of round length

totalActiveStakeBigDecimal

The total amount of active LPT staked

totalVolumeETHBigDecimal

Total broadcaster fees transcoders have accumulated in ETH

totalVolumeUSDBigDecimal

Total broadcaster fees transcoders have accumulated in USD

participationRateBigDecimal

Ratio of total active stake to total supply

currentRoundRound

Current round the protocol is in

lastInitializedRoundRound

Round that was last initialized

lastRoundLengthUpdateRoundRound

Round when round length was last updated

roundLengthBigInt

Round length in blocks

lastRoundLengthUpdateStartBlockBigInt

Block when round length was last updated

totalSupplyBigDecimal

Livepeer Token supply

winningTicketCountInt

Total winning tickets

roundCountInt

Total rounds

Transcoder

The transcoder entity contains data associated with the orchestrator role. It includes references to each of its earning pools, fee volume information, total stake, delegators, and more.

FieldTypeDescription
idID

Transcoder's ETH address

activationRoundBigInt

Round in which the transcoder became active

deactivationRoundBigInt

Round in which the transcoder will become inactive

lastActiveStakeUpdateRoundBigInt

Round for which the stake was last updated while the transcoder is active

activeBoolean

Whether or not the transcoder is active

statusTranscoderStatus

Status of the transcoder

lastRewardRoundRound

Last round that the transcoder called reward

rewardCutBigInt

% of block reward cut paid to transcoder by a delegator

feeShareBigInt

% of fees paid to delegators by transcoder

totalStakeBigDecimal

Total tokens delegated toward a transcoder (including their own)

totalVolumeETHBigDecimal

Total fees generated by the transcoder in ETH (before distribution to delegators)

totalVolumeUSDBigDecimal

Total fees generated by the transcoder in USD (before distribution to delegators)

pools[Pool]

Pools associated with the transcoder

delegators[Delegator]

Delegators bonded to the transcoder

delegatorDelegator

Delegator that registered this transcoder

serviceURIString

Service URI endpoint that can be used to send off-chain requests

Round

The Livepeer protocol is round based and each round is represented by some number of Ethereum blocks.

FieldTypeDescription
idID

Round number

initializedBoolean

Whether the round was initialized

lengthBigInt

Number of blocks this round lasts for

startBlockBigInt

Start block for the round

endBlockBigInt

End block for the round

pools[Pool]

Pools associated with the round

mintableTokensBigDecimal

Mintable tokens for the round

volumeETHBigDecimal

Fees generated this round in ETH

volumeUSDBigDecimal

Fees generated this round in USD

totalActiveStakeBigDecimal

Total active stake during the round

totalSupplyBigDecimal

Total Livepeer token supply during the round

participationRateBigDecimal

Participation rate during the round (totalActiveStake/totalSupply)

movedStakeBigDecimal

Total stake moved from one delegate to another during the round

newStakeBigDecimal

Total amount of new stake introduced during the round

Pool

Represents a transcoder's rewards and fees to be distributed to delegators

FieldTypeDescription
idID

Unique identifer for the pool (formed using the transcoder's address and round number)

roundRound

Round associated with the pool

delegateTranscoder

Transcoder associated with the pool

feesBigDecimal

Fees collected in the pool

rewardTokensBigDecimal

Total reward tokens collected in the pool

totalStakeBigDecimal

Transcoder's total stake during the earnings pool's round

rewardCutBigInt

Transcoder's reward cut during the earnings pool's round

feeShareBigInt

Transcoder's fee share during the earnings pool's round

Delegator

Bonded accounts who have delegated their stake towards a transcoder candidate

FieldTypeDescription
idID

ETH address of a delegator

delegateTranscoder

ETH address of the delegate (the one whom the delegator has bonded to)

startRoundBigInt

Round the delegator becomes bonded and delegated to its delegate

lastClaimRoundRound

Last round that the delegator claimed reward and fee pool shares

bondedAmountBigDecimal

Amount of Livepeer Token a delegator currently has bonded

principalBigDecimal

Amount of Livepeer Token a delegator has bonded over its lifetime separate from rewards

unbondedBigDecimal

Amount of Livepeer Token a delegator has unbonded over its lifetime

feesBigDecimal

Amount of fees a delegator has collected

withdrawnFeesBigDecimal

Amount of fees withdrawn

delegatedAmountBigDecimal

Amount of Livepeer Token the delegator has delegated

unbondingLocks[UnbondingLock]

Unbonding locks associated with the delegator

Broadcaster

Broadcasters pay transcoders to do the work of transcoding in exchange for fees

FieldTypeDescription
idID

ETH address of a broadcaster

depositBigDecimal

Amount of funds deposited

reserveBigDecimal

Amount of funds in reserve

UnbondingLock

Get an unbonding lock for a delegator

FieldTypeDescription
idID

Unique unlock identifer

unbondingLockIdInt

unbonding lock id

delegatorDelegator

Delegator address this lock belongs to

delegateTranscoder

Address of delegate unbonding from

amountBigDecimal

Amount being unbonded

withdrawRoundBigInt

Round number when the unbonding amount will be available for withdrawal

Poll

Stake weighted poll

FieldTypeDescription
idID

Poll address

proposalString

IPFS multihash for the proposal

endBlockBigInt

Block at which the poll ends and votes can no longer be submitted

quorumBigInt

Minimum amount of participation (total stake including inactive stake) required for a poll to pass

quotaBigInt

Minimum amount of yes votes required for a poll to pass

tallyPollTally

Poll tally

votes[Vote]

Votes belonging to a poll

PollTally

Stake weighted tally associated with a poll

FieldTypeDescription
idID

Poll address

yesBigDecimal

Stake voted yes

noBigDecimal

Stake voted no

Vote

Vote data

FieldTypeDescription
idID

Voter address + poll address

voterString

Vote caster

voteStakeBigDecimal

Stake weighted vote

nonVoteStakeBigDecimal

This will be non-zero if voter is an transcoder and any of the its delegators voted

choiceIDPollChoice

Vote choice

pollPoll

Poll associated with this vote

registeredTranscoderBoolean

True if the voter was a registered transcoder during the poll period

Day

Protocol data accumulated and condensed into day stats

FieldTypeDescription
idID

Timestamp rounded to current day by dividing by 86400

dateInt

The date beginning at 12:00am UTC

volumeETHBigDecimal

Fees generated this day in ETH

volumeUSDBigDecimal

Fees generated this day in USD

totalActiveStakeBigDecimal

Total active stake during the day

totalSupplyBigDecimal

Total Livepeer token supply during the day

participationRateBigDecimal

Participation rate during the day (totalActiveStake/totalSupply)

TranscoderDay

Transcoder data accumulated and condensed into day stats

FieldTypeDescription
idID

Combination of the transcoder address and the timestamp rounded to current day by dividing by 86400

dateInt

The date beginning at 12:00am UTC

volumeETHBigDecimal

Fees generated this day in ETH

volumeUSDBigDecimal

Fees generated this day in USD

transcoderTranscoder

Transcoder associated with the day

Transaction

Transaction entities are created for each Ethereum transaction that contains an interaction within Livepeer contracts.

FieldTypeDescription
idID

Ethereum transaction hash

blockNumberBigInt

Block transaction was mined in

timestampInt

Timestamp for transaction

gasUsedBigInt

Amount of gas used in the transaction

gasPriceBigInt

Cost per unit of gas specified for the transaction

fromString

The sending party of the transaction

toString

The receiving party of the transaction

events[Event]

The events emitted within this transaction

BondEvent

BondEvent entities are created for every emitted Bond event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in, used to sort

roundRound

Reference to the round the event occured in

bondedAmountBigDecimal

Delegator's current total bonded amount

additionalAmountBigDecimal

Additional amount added to bonded amount

newDelegateTranscoder

Reference to the Delegator's new delegate

oldDelegateTranscoder

Reference to the Delegator's old delegate

delegatorDelegator

Reference to the Delegator that bonded

UnbondEvent

UnbondEvent entities are created for every emitted Unbond event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

amountBigDecimal

Amount unbonded in the transaction

withdrawRoundBigInt

The future round in which the Delegator may withdraw its unbonded stake

unbondingLockIdInt

The unbonding lock ID associated with this transaction, used to optionally rebond the amount

delegateTranscoder

Reference to the delegate unbonded from

delegatorDelegator

Reference to the Delegator that unbonded

RebondEvent

RebondEvent entities are created for every emitted Rebond event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegatorDelegator

Reference to the delegator that rebonded

delegateTranscoder
amountBigDecimal
unbondingLockIdInt

RewardEvent

RewardEvent entities are created for every emitted Reward event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

rewardTokensBigDecimal

Amount of inflationary token rewards claimed

delegateTranscoder

Reference to the delegate that claimed its inflationary token reward

TranscoderActivatedEvent

TranscoderActivatedEvent entities are created for every emitted TranscoderActivated event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegateTranscoder

Reference to the delegate that will be active

activationRoundBigInt

Future round in which the delegate will become active

TranscoderDeactivatedEvent

TranscoderDeactivatedEvent entities are created for every emitted TranscoderDeactivated event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegateTranscoder

Reference to the delegate that will become deactive

deactivationRoundBigInt

Future round in which the delegate will become deactive

EarningsClaimedEvent

EarningsClaimedEvent entities are created for every emitted EarningsClaimed event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegatorDelegator

Reference to the delegator that claimed its earnings

delegateTranscoder

Reference to the delegator's delegate

startRoundBigInt

First round that the delegator's pending stake was computed from

endRoundRound

Last round that the delegator's pending stake was computed from

rewardTokensBigDecimal

Reward tokens claimed by the delegator

feesBigDecimal

Fees claimed by the delegator

TranscoderUpdateEvent entities are created for every emitted TranscoderUpdate event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegateTranscoder

Reference to the delegate that was updated

rewardCutBigInt

Delegate's updated reward cut

feeShareBigInt

Delegate's updated fee share

TranscoderSlashedEvent

TranscoderSlashedEvent entities are created for every emitted TranscoderSlashed event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegateTranscoder

Reference to the delegate that was slashed

finderBytes

Finder that proved a transcoder violated a slashing condition. Null address if there is no finder

penaltyBigDecimal

Percentage of transcoder bond to be slashed

finderRewardBigInt

Percentage of penalty awarded to finder. Zero if there is no finder

WithdrawStakeEvent

WithdrawStakeEvent entities are created for every emitted WithdrawStake event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegatorDelegator

Reference to the delegator that withdraw its stake

unbondingLockIdInt

Unbonding lock ID that was deleted upon withdrawal

amountBigDecimal

Amount of stake withdrawn

WithdrawFeesEvent

WithdrawFeesEvent entities are created for every emitted WithdrawFees event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

delegatorDelegator

Reference to the delegator that withdraw its fees

amountBigDecimal

Amount of fees withdrawn

NewRoundEvent

NewRoundEvent entities are created for every emitted NewRound event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

blockHashString

Block hash for the round

WinningTicketRedeemedEvent

WinningTicketRedeemedEvent entities are created for every emitted WinningTicketRedeemed event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

senderBroadcaster

Reference to the broadcaster who sent the fees

recipientTranscoder

Reference to the recipient of the broadcaster fees

faceValueBigDecimal

Face value of ticket paid to recipient

faceValueUSDBigDecimal

Amount of fees the winning ticket was redeemed for in in USD

winProbBigInt

The winning probability of the ticket

senderNonceBigInt

Sender's monotonically increasing counter for each ticket

recipientRandBigInt

keccak256 hash commitment to recipient's random value

auxDataBytes

Auxilary data included in ticket used for additional validation

DepositFundedEvent

DepositFundedEvent entities are created for every emitted DepositFunded event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

senderBroadcaster

Reference to the broadcaster that deposited the broadcasting fees

amountBigDecimal

Amount of broadcasting fees deposited

ReserveFundedEvent

ReserveFundedEvent entities are created for every emitted ReserveFunded event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

reserveHolderBroadcaster

Reference to reserve holder

amountBigDecimal

Amount of funds added to reserve

ReserveClaimedEvent

ReserveClaimedEvent entities are created for every emitted ReserveClaimed event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

reserveHolderBroadcaster

Reference to the reserve holder

claimantTranscoder

Reference to the claimant

amountBigDecimal

Amount of funds claimed by claimant from the reserve for the reserve holder

WithdrawalEvent

WithdrawalEvent entities are created for every emitted Withdrawal event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

senderBroadcaster

Reference to the broadcaster withdrawing its deposit and reserve

depositBigDecimal

Deposit amount withdrawn

reserveBigDecimal

Reserve amount withdrawn

SetCurrentRewardTokensEvent

SetCurrentRewardTokensEvent entities are created for every emitted SetCurrentRewardTokens event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

currentMintableTokensBigDecimal

Number of mintable tokens for the round

currentInflationBigInt

Current inflation during the round

PauseEvent

PauseEvent entities are created for every emitted Pause event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

UnpauseEvent

UnpauseEvent entities are created for every emitted Unpause event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

ParameterUpdateEvent

ParameterUpdateEvent entities are created for every emitted ParameterUpdate event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

paramString

Parameter that was updated

VoteEvent

VoteEvent entities are created for every emitted Vote event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

voterString

Address belonging to the voter

choiceIDBigInt

Voter choice. Zero means yes and one means no

pollPoll

Reference to the poll this vote was casted in

PollCreatedEvent

PollCreatedEvent entities are created for every emitted PollCreated event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

pollPoll

Reference to the poll that was created

proposalBytes

IPFS content hash representing proposal

endBlockBigInt

Ethereum block in which this poll ends

quorumBigInt

The minimum amount of stake-weighted votes for this poll's outcome to be considered valid

quotaBigInt

The minimum amount of stake-weighted 'yes' votes needed for the poll to pass

ServiceURIUpdateEvent

ServiceURIUpdateEvent entities are created for every emitted ServiceURIUpdate event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

addrString

Address of sender

serviceURIString

Service URI endpoint for the caller

MintEvent

MintEvent entities are created for every emitted Mint event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

toString

Token smart contract address

amountBigDecimal

Amount of tokens minted

BurnEvent

BurnEvent entities are created for every emitted Burn event.

FieldTypeDescription
idID

Ethereum transaction hash + event log index

transactionTransaction

Reference to the transaction the event was included in

timestampInt

Timestamp of the transaction the event was included in

roundRound

Reference to the round the event occured in

valueBigDecimal

Amount of tokens burned

Previous

Subgraph API Overview