Add multi-staking entities, APY calculation, Asset Hub indexer support

- Add StakingApy, ActiveStaker, Reward entities to schema.graphql
- Add APY calculation engine in NewEra.ts (inflation curve + validator commission)
- Add saveMultiStakingReward to Rewards.ts and PoolRewards.ts
- Add handleAssetTransfer for assets.Transferred events
- Add constants.ts with genesis hashes and inflation params
- Add docker-compose.prod.yml for production deployment (relay + assethub nodes)
- Add deploy-vps.yml GitHub Actions workflow for auto-deploy on push
This commit is contained in:
2026-02-14 02:38:22 +03:00
parent 9922e8ba89
commit 076b54bdc9
8 changed files with 496 additions and 15 deletions
+29 -2
View File
@@ -17,7 +17,7 @@ type AssetTransfer @jsonField {
success: Boolean!
}
type Reward @jsonField {
type RewardInfo @jsonField {
eventIdx: Int!
amount: String!
isReward: Boolean!
@@ -97,7 +97,7 @@ type HistoryElement @entity {
extrinsicHash: String
timestamp: BigInt! @index
address: String! @index
reward: Reward
reward: RewardInfo
poolReward: PoolReward
extrinsic: Extrinsic
transfer: Transfer
@@ -123,3 +123,30 @@ type ErrorEvent @entity {
id: ID!
description: String!
}
# ===== Multi-staking API entities (used by PezWallet dashboard) =====
type StakingApy @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
maxAPY: Float!
}
type ActiveStaker @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
address: String! @index
}
type Reward @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
address: String! @index
type: RewardType! @index
amount: BigInt!
timestamp: BigInt!
blockNumber: Int! @index
}