Skip to content

Commit

Permalink
Merge pull request #9 from maticnetwork/jdkanani/staking-info
Browse files Browse the repository at this point in the history
new: add staking info subgraph
  • Loading branch information
jdkanani authored Dec 23, 2020
2 parents 4b4d4ef + 012c447 commit f2b83f8
Show file tree
Hide file tree
Showing 6 changed files with 331 additions and 174 deletions.
4 changes: 2 additions & 2 deletions root/config/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
},
"rootChainManager": {
"address": "0xBbD7cBFA79faee899Eaf900F13C9065bF03B1A74",
"startBlock": 0
"startBlock": 3000761
},
"stakingInfo": {
"address": "0x29C40836C17f22d16a7fE953Fb25DA670C96d69E",
"startBlock": 0
"startBlock": 2917902
}
}
}
4 changes: 2 additions & 2 deletions root/config/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
},
"rootChainManager": {
"address": "0xA0c68C638235ee32657e8f720a23ceC1bFc77C77",
"startBlock": 0
"startBlock": 10735437
},
"stakingInfo": {
"address": "0xa59C847Bd5aC0172Ff4FE912C5d29E5A71A7512B",
"startBlock": 0
"startBlock": 10342572
}
}
}
2 changes: 1 addition & 1 deletion root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ maticnetwork/mumbai-root-subgraphs",
"create-local": "graph create --node http://localhost:8020/ maticnetwork/mumbai-root-subgraphs",
"remove-local": "graph remove --node http://localhost:8020/ maticnetwork/mumbai-root-subgraphs",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 maticnetwork/mumbai-root-subgraphs"
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs https://ipfs.infura.io:5001 maticnetwork/mumbai-root-subgraphs"
},
"dependencies": {
"@graphprotocol/graph-ts": "0.18.0"
Expand Down
40 changes: 32 additions & 8 deletions root/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,45 @@ type Validator @entity {
validatorId: BigInt!
signer: Bytes!
signerPubKey: Bytes!
reward: BigInt
liquidatedRewards: BigInt!
activationEpoch: BigInt!
deactivationEpoch: BigInt
jailEndEpoch: BigInt
amount: BigInt!
total: BigInt!
commissionRate: BigInt
status: Int!
deactivationEpoch: BigInt!
totalStaked: BigInt!
commissionRate: BigInt!
nonce: BigInt!
unstaked: Boolean!
jailEndEpoch: BigInt!
}

type Delegator @entity {
id: ID!
validatorId: BigInt!
address: Bytes!
amount: BigInt!
# total delegated amount
delegatedAmount: BigInt!
# total unclaimed amount (after sellVoucher and before claiming it)
unclaimedAmount: BigInt!
# total claimed amount (after withdraw delay, while claiming unstaked amount)
claimedAmount: BigInt!
# total current shares (works until tokens are non-transferable)
tokens: BigInt!
claimedRewards: BigInt!
}

# Heimdall topups
type Topup @entity {
id: ID!
address: Bytes!
topupAmount: BigInt!
withdrawAmount: BigInt!
}

# Staking Params across all validators
type StakingParams @entity {
id: ID!
owner: Bytes
validatorThreshold: BigInt!
proposerBonus: BigInt!
dynasty: BigInt!
liquidatedRewards: BigInt!
}
Loading

0 comments on commit f2b83f8

Please sign in to comment.