Introduction to LSD Subgraph
This documentation is a guide on how to use the LSD (Liquid Staking Derivative) Network subgraph. This subgraph currently indexes the smart contract suite deployed on Goerli. Data points available include:
LiquidStakingNetwork - All the LSDNs deployed using the LSDN Factory
NodeRunner - Node operator’s data
SmartWallet - Smart wallet created for every unique node operator address
LSDValidator - Validator’s data
ProtectedDeposit - Protected Deposits Pool of each of the LSDNs
FeesAndMevDeposit - MEV Staking Pool of each of the LSDNs
GiantSavETHPool - The Giant Protected Staking Pool
GiantFeesAndMevPool - The Giant MEV Staking Pool
Event - For capturing crucial information emitted as events via the contracts
LPToken - LP tokens issued for every validator
Any query seen in this document can be copied and pasted into the LSD v1 playground and LSD v2 playground.
The document assumes basic knowledge about core concepts within the LSD Network.
Queries listed in the document are few of the many possible queries.
Liquid Staking Network
Use this to get information about any LSD deployed by the LSD factory. Every LSD is unique in its own way and can be deployed to cater the needs of a specific group of users. Liquid Staking Manager is the heart of any LSD and carries out crucial tasks. Every LSD has its own unique Liquid Staking Manager, MEV Staking pool, Protected Staking Pool and Syndicate.
While these are the components that make up an LSD, the users are node operators and stakers. Stakers can stake their ETH in any of the pools depending on their risk appetite.
For example:
{
liquidStakingNetworks {
id
ticker
commission
feeRecipientAndSyndicate
feesAndMevPool
savETHPool
}
}
Some insight: This query is all the LSDs deployed in the LSD Network where,
id - Address of the Liquid Staking Manager
ticker - 3-5 character string name given to the LSD
commission - Percentage of commission that the network deployer takes from the node operators
feeRecipientAndSyndicate - Address of the Syndicate
feesAndMevPool - Address of the MEV Staking Pool
savETHPool - Address of the Protected Staking Pool
Node Runner
Contains all the information about a node operator. If a node operator uses the same ETH address across multiple LSDs then the NodeRunner entity will list all the validators that the node operator runs and all the smart wallets that he is associated with across the network.
A node operator needs to put 4 ETH for every BLS public key he wants to register in the LSD Network and the rest of the 28 ETH per validator is pooled in by the stakers. The BLS public key of the node operator is associated with the Smart Wallet which is owned by the Liquid Staking Manager of the LSD.
{
nodeRunners(where:{
liquidStakingNetworks_:{
id:"$id"
}
}) {
id
name
smartWallets {
id
}
liquidStakingNetworks {
ticker
}
validators {
id
totalETHStaked
}
}
}
The above query lists all the node operators of a specific LSD, where $id is the Liquid Staking Manager of the target LSD. The response of the query is as follows:
id - Ethereum address of the node operator
name - Unique name (1-10 characters long) set by the node runner
smartWallets.id - Address of the smart wallet associated with the node operator in the LSD
liquidStakingNetworks.ticker - 3-5 character string name of the LSD
validators - List of BLS public keys registered by the node operator in the LSD
validators.id - BLS public key of the validator
validators.totalETHStaked - Number of ETH (in wei) pooled for the BLS public key## Smart Wallet
Can be used to get information related to any smart wallet created in the LSD Network. A smart wallet is a unique wallet created by the Liquid Staking Manager for every unique node runner that joins their network and registers at least 1 BLS public key. The smart wallet is registered as the owner of the validator once the BLS public key has been registered in the Stakehouse Protocol and 32 ETH have been deposited into the Ethereum deposit contract. A smart wallet holds all the BLS public keys for a node operator.
{
smartWallets {
id
liquidStakingNetwork {
id
}
nodeRunner {
id
validators {
id
}
}
}
}
This query lists all the smart wallets created in the LSD Network.
id - Ethereum address of the smart wallet
liquidStakingNetwork.id - Ethereum address of the Liquid Staking Manager that owns the smart wallet
nodeRunner.id - Ethereum address of the node operator associated with the smart wallet
nodeRunner.validators.id - List of BLS public keys contained in the smart wallet
LSDValidator
LSDValidator is an entity for any BLS public key introduced to the LSD Network. This subgraph entity can be used to get the lifecycle status of the BLS public key, staked amount, etc.
{
lsdvalidators(
where:{
liquidStakingManager:"$liquidStakingManagerAddress"
smartWallet_:{
nodeRunner:"$nodeRunnerAddress"
}
}
) {
id
status
totalETHStaked
smartWallet {
id
}
}
}
The above query lists all the validators of a specific LSD, belonging to a specific node operator by specifying the $liquidStakingManagerAddress
as the target Liquid Staking Manager address and $nodeRunnerAddress
as the target node operator address.
id - BLS public key of the validator
status - Status of the BLS Public Key. Can be one of WAITING_FOR_ETH
, READY_TO_STAKE
, STAKED
, or MINTED_DERIVATIVES
totalETHStaked - Total ETH collected for the BLS Public Key
smartWallet.id - Ethereum address of the smart wallet associated with the BLS public key
GiantSavETHPool (Open Pool)
The GiantSavETHPool entity contains the information about the Giant Protected Staking Pool. There can only be one Giant Protected Staking Pool for all LSD networks deployed by the LSD factory. Protected Staking Pools of each of the LSDs can request for ETH from this giant pool.
{
giantSavETHPools {
id
availableToStake
sentToLiquidStakingNetworks
giantLPToken
}
}
The above query lists the collected ETH which is ready to stake, giant LP token address, etc.
id - Ethereum address of the Giant Protected Staking Pool
availableToStake - How much ETH in wei that is ready to deploy
sentToLiquidStakingNetworks - Amount of ETH (in wei) already sent to different LSDs
giantLPToken - Token address of the Giant Protected Staking LP token
GiantFeesAndMevPool
The Giant MEV Staking Pool is used to pool in ETH from its stakers and then send these ETH to the MEV Staking pool of each of the LSDs (specifically the Staking funds vaults of an LSD). Once the ETH is staked in the LSDs, the skaters start earning rewards which they can claim from time to time.
{
giantFeesAndMevPools {
id
availableToStake
sentToLiquidStakingNetworks
giantLPToken
}
}
id - Ethereum address of the Giant MEV Staking Pool
availableToStake - Amount of ETH collected in the Giant pool that is ready to be deployed to an LSD network
sentToLiquidStakingNetworks - Amount of ETH (in wei) already sent to MEV Staking Pool of different LSDs
giantLPToken - Token address of the Giant MEV Staking LP token
LPToken
LP tokens originate from LSD networks and are created by MEV Staking Pool and Protected Staking Pool for each of the registered BLS Public keys. Every staker that deposits ETH gets back LP tokens (equal to the amount of ETH they deposited) including ETH deployed to. Once the associated BLS public key is staked, stakers that hold these LP tokens start earning rewards proportional to their LP token holdings.
{
lptokens(where:{
blsPublicKey:"$blsPublicKey"
}) {
id
minted
liquidStakingNetwork {
id
}
issuer
tokenType
lifecycleStatus
liquidityProviders {
id
lpAddress
amount
}
}
}
The above query lists the LP tokens associated with a BLS public key (by providing the BLS public key as $blsPublicKey
).
id - Token address of the LP token
minted - Number of LP tokens minted equal to amount of ETH deposited to the BLS key
liquidStakingNetwork.id - Ethereum address of the LSD that minted this LP token
issuer - Ethereum address of the pool that issued this LP token. This address can either be of the MEV Staking Pool or the Protected Staking Pool.
tokenType - Can be either 'PROTECTED_STAKING_LP' or 'FEES_AND_MEV_LP' depending on the pool that issued this LP token
lifecycleStatus - Status of the LP token. Can be either 'NOT_STAKED', 'STAKED' or 'MINTED_DERIVATIVES'
liquidityProviders.id - String formed by concatenation of LP Token address and depositor address
liquidityProviders.lpAddress - Address of the depositor
liquidityProviders.amount - Amount of ETH deposited by the lpAddress