-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
157 lines (138 loc) · 2.6 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
type StakingEvent @entity {
id: ID!
userAddress: String! @index
transaction: UserTransactionType!
contractAddress: String
amount: BigInt!
timestamp: BigInt! @index
blockNumber: BigInt!
}
type GroupedStakingEvent @entity {
id: ID!
transaction: UserTransactionType!
amount: BigInt!
timestamp: BigInt! @index
}
enum UserTransactionType {
BondAndStake
UnbondAndUnstake
Withdraw
WithdrawFromUnregistered
NominationTransfer
}
type RewardEvent @entity {
id: ID!
userAddress: String! @index
transaction: RewardEventType! @index
contractAddress: String
tierId: Int
era: BigInt
period: Int
amount: BigInt!
timestamp: BigInt! @index
blockNumber: BigInt!
}
type RewardAggregatedDaily @entity {
id: ID!
beneficiary: String! @index # userAddress or dapp beneficiary
amount: BigInt!
timestamp: BigInt! @index
}
enum RewardEventType {
Reward
BonusReward
DAppReward
}
enum DappState {
Registered
Unregistered
}
type Dapp @entity {
# dApp address
id: ID!
# dApp id
dappId: Int!
owner: String!
# dApp reward received address
beneficiary: String
state: DappState!
registeredAt: BigInt!
registrationBlockNumber: Int!
unregisteredAt: BigInt
unregistrationBlockNumber: Int
stakersCount: Int!
}
type DappAggregatedDaily @entity {
id: ID!
dappAddress: String! @index
stakersCount: Int!
timestamp: BigInt! @index
}
type Stakers @entity {
id: ID!
dappAddress: String! @index
stakerAddress: String! @index
amount: BigInt!
}
type UniqueStakerAddress @entity {
id: ID!
}
type UniqueLockerAddress @entity {
id: ID!
amount: BigInt!
}
type StakersCountAggregatedDaily @entity {
id: ID!
blockNumber: Int!
stakersCount: Int!
stakersAmount: BigInt!
usdPrice: Float!
}
type TvlAggregatedDaily @entity {
id: ID!
blockNumber: Int!
lockersCount: Int!
tvl: BigInt!
usdPrice: Float!
}
type Stake @entity {
id: ID!
dappAddress: String! @index
stakerAddress: String!
amount: BigInt!
timestamp: BigInt!
blockNumber: Int!
period: Int! @index
}
enum SubperiodType {
Voting
BuildAndEarn
}
type Subperiod @entity {
id: ID!
type: SubperiodType!
blockNumber: Int!
timestamp: BigInt! @index
}
type StakesPerDapAndPeriod @entity {
id: ID!
dappAddress: String! @index
period: Int!
stakeAmount: BigInt!
rewardAmount: BigInt!
}
type StakesPerStakerAndPeriod @entity {
id: ID!
stakerAddress: String! @index
period: Int!
stakeAmount: BigInt!
stakerRewardAmount: BigInt!
bonusRewardAmount: BigInt!
}
type Burn @entity {
id: ID!
user: String! @index
amount: BigInt!
timestamp: BigInt!
blockNumber: Int!
}