Protocol Subgraphs
Last updated
Last updated
The Rio Network contracts are open source on our Github monorepo.
Browse on GitHub at rio-org/rio-monorepo/tree/main/packages/subgraph
The Rio Network will launch our mainnet subgraphs on the decentralized subgraph service provided by TheGraph.
The Rio Network has curated a set of protocol subgraphs on Goldsky to speed web3 decentralized application (dApp) development.
A liquid restaking token issuer instance.
type Issuer @entity {
id: ID!
address: Bytes!
tokensIssued: Int!
tokens: [LiquidRestakingToken!] @derivedFrom(field: "issuer")
}
The withdrawal queue contract for a liquid restaking token.
type Coordinator @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
The withdrawal queue contract for a liquid restaking token.
type WithdrawalQueue @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
The operator registry contract for a liquid restaking token.
type OperatorRegistry @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
A liquid restaking token.
type LiquidRestakingToken @entity {
id: ID!
address: Bytes!
symbol: String!
name: String!
createdTimestamp: BigInt!
totalSupply: BigDecimal!
totalValueETH: BigDecimal
totalValueUSD: BigDecimal
exchangeRateETH: BigDecimal
exchangeRateUSD: BigDecimal
issuer: Issuer!
coordinator: Coordinator! @derivedFrom(field: "restakingToken")
assetRegistry: AssetRegistry! @derivedFrom(field: "restakingToken")
operatorRegistry: OperatorRegistry! @derivedFrom(field: "restakingToken")
avsRegistry: AVSRegistry! @derivedFrom(field: "restakingToken")
depositPool: DepositPool! @derivedFrom(field: "restakingToken")
withdrawalQueue: WithdrawalQueue! @derivedFrom(field: "restakingToken")
rewardDistributor: RewardDistributor! @derivedFrom(field: "restakingToken")
priceFeeds: [PriceFeed!] @derivedFrom(field: "usedBy")
underlyingAssets: [UnderlyingAsset!] @derivedFrom(field: "restakingToken")
}
A user who has interacted with a liquid restaking token.
type User @entity {
id: ID!
address: Bytes!
balance: BigDecimal!
deposits: [Deposit!] @derivedFrom(field: "user")
withdrawalRequests: [WithdrawalRequest!] @derivedFrom(field: "user")
withdrawalClaims: [WithdrawalClaim!] @derivedFrom(field: "user")
}
A deposit made by a user.
type Deposit @entity(immutable: true) {
id: ID!
user: User!
sender: Bytes!
assetIn: Asset!
amountIn: BigDecimal!
amountOut: BigDecimal!
restakingToken: LiquidRestakingToken!
restakingTokenPriceUSD: BigDecimal
userBalanceBefore: BigDecimal!
userBalanceAfter: BigDecimal!
valueUSD: BigDecimal
timestamp: BigInt!
blockNumber: BigInt!
tx: Bytes!
}
The deposit pool contract for a liquid restaking token.
type DepositPool @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
The reward distributor contract for a liquid restaking token.
type RewardDistributor @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
A withdrawal request made by a user.
type WithdrawalRequest @entity {
id: ID!
user: User!
sender: Bytes!
epoch: WithdrawalEpoch!
assetOut: Asset!
sharesOwed: BigDecimal!
amountIn: BigDecimal!
restakingToken: LiquidRestakingToken!
restakingTokenPriceUSD: BigDecimal
userBalanceBefore: BigDecimal!
userBalanceAfter: BigDecimal!
valueUSD: BigDecimal
timestamp: BigInt!
blockNumber: BigInt!
tx: Bytes!
logIndex: BigInt!
isClaimed: Boolean!
claim: WithdrawalClaim
}
A withdrawal claim made by a user. Multiple withdrawal requests from the same user in the same epoch are claimed together.
type WithdrawalRequest @entity {
id: ID!
user: User!
sender: Bytes!
epoch: WithdrawalEpoch!
assetOut: Asset!
amountIn: BigDecimal!
restakingToken: LiquidRestakingToken!
restakingTokenPriceUSD: BigDecimal
userBalanceBefore: BigDecimal!
userBalanceAfter: BigDecimal!
valueUSD: BigDecimal
timestamp: BigInt!
blockNumber: BigInt!
tx: Bytes!
logIndex: BigInt!
isClaimed: Boolean!
claim: WithdrawalClaim
}
All possible statuses for a withdrawal epoch.
enum WithdrawalEpochStatus {
ACTIVE
QUEUED
SETTLED
}
A withdrawal epoch for a given underlying asset.
type WithdrawalEpoch @entity {
id: ID!
epoch: BigInt!
asset: Asset!
status: WithdrawalEpochStatus!
restakingToken: LiquidRestakingToken!
queuedTimestamp: BigInt
settledTimestamp: BigInt
amountIn: BigDecimal!
sharesOwed: BigDecimal!
assetsReceived: BigDecimal!
shareValueOfAssetsReceived: BigDecimal!
amountToBurnAtSettlement: BigDecimal!
aggregateRoot: Bytes
requests: [WithdrawalRequest!] @derivedFrom(field: "epoch")
claims: [WithdrawalClaim!] @derivedFrom(field: "epoch")
requestCount: Int!
claimCount: Int!
}
An underlying asset for a liquid restaking token.
type UnderlyingAsset @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
asset: Asset!
strategy: Bytes!
depositCap: BigDecimal!
priceFeed: PriceFeed!
balance: BigDecimal!
balanceInDepositPool: BigDecimal!
balanceInEigenLayer: BigDecimal!
}
Asset metadata.
type Asset @entity {
id: ID!
symbol: String!
name: String!
decimals: Int!
address: Bytes!
latestUSDPrice: BigDecimal # Latest price of asset in USD.
latestUSDPriceTimestamp: BigInt # Timestamp at which the `latestUSDPrice` was updated.
}
The asset registry contract for a liquid restaking token.
type AssetRegistry @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
The AVS registry contract for a liquid restaking token.
type AVSRegistry @entity {
id: ID!
address: Bytes!
restakingToken: LiquidRestakingToken!
}
The underlying source of a Rio price feed.
type PriceSource @entity {
id: ID!
address: Bytes!
priceFeed: PriceFeed!
}
A Rio price feed for an asset.
type PriceFeed @entity {
id: ID!
address: Bytes!
priceSource: PriceSource @derivedFrom(field: "priceFeed")
feedType: String!
description: String!
decimals: Int!
usedBy: [LiquidRestakingToken!]!
baseAsset: Asset!
quoteAssetSymbol: String!
assetPair: String!
price: BigDecimal
lastUpdatedTimestamp: BigInt
}
A Rio Operator metadata.
type OperatorMetadata @entity {
id: ID!
name: String
website: String
description: String
logo: String
twitter: String
}
A Rio Operator entity.
type Operator @entity {
id: ID!
address: Bytes!
metadataURI: String!
metadata: OperatorMetadata
delegator: OperatorDelegator! @derivedFrom(field: "operator")
delegationApprover: Bytes
stakerOptOutWindowBlocks: BigInt
}
A Rio Operator Delegator entity.
type OperatorDelegator @entity {
id: ID!
address: Bytes!
delegatorId: Int!
eigenPod: Bytes!
operator: Operator!
manager: Bytes!
earningsReceiver: Bytes!
restakingToken: LiquidRestakingToken!
validators: [Validator!] @derivedFrom(field: "delegator")
unusedValidatorKeyCount: BigInt!
depositedValidatorKeyCount: BigInt!
exitedValidatorKeyCount: BigInt!
totalValidatorKeyCount: BigInt!
}
An internal entity used for validator key lookups.
type ValidatorKeyIndex @entity {
id: ID! # The ID is the concatenation of the delegator ID and the key index.
keyIndex: BigInt!
validator: Validator!
}
A Rio Operator Validator entity.
type Validator @entity {
id: ID! # The ID is the validator public key.
keyIndex: BigInt!
status: ValidatorStatus!
delegator: OperatorDelegator!
publicKey: Bytes!
keyUploadTimestamp: BigInt!
keyUploadTx: Bytes!
}
Represents the potential states of an operator's validator.
enum ValidatorStatus {
UNUSED
DEPOSITED
EXITED
}
A restaking token transfer between users
type TokenTransfer @entity(immutable: true) {
id: ID!
receiver: User!
sender: User!
amount: BigDecimal!
restakingToken: LiquidRestakingToken!
restakingTokenPriceUSD: BigDecimal
senderBalanceBefore: BigDecimal!
senderBalanceAfter: BigDecimal!
receiverBalanceBefore: BigDecimal!
receiverBalanceAfter: BigDecimal!
valueUSD: BigDecimal
timestamp: BigInt!
blockNumber: BigInt!
tx: Bytes!
}