-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
202 lines (190 loc) · 5.63 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
"""
Billing holds global variables
"""
type Billing @entity {
"Set to 1"
id: ID!
"Address of the collectors"
collectors: [Collector!]! @derivedFrom(field: "billing")
"Address of the governor"
governor: Bytes!
"[CUMULATIVE] Total amount of tokens added"
totalTokensAdded: BigInt!
"[CUMULATIVE] Total amount of tokens pulled"
totalTokensPulled: BigInt!
"[CUMULATIVE] Total amount of tokens removed/withdrawn"
totalTokensRemoved: BigInt!
"[CURRENT] Total amount of currently available balance (totalTokensAdded - totalTokensPulled - totalTokensRemoved)"
totalCurrentBalance: BigInt!
"Current BillingDailyData entity created"
currentDailyDataEntity: BillingDailyData
"Previous BillingDailyData entity created"
previousDailyDataEntity: BillingDailyData
}
"""
Curator Name Signal for a single Subgraph
"""
type User @entity {
"EVM address"
id: ID!
"Balance of the user in the Billing contract"
billingBalance: BigInt!
"[CUMULATIVE] Total amount of tokens added"
totalTokensAdded: BigInt!
"[CUMULATIVE] Total amount of tokens pulled"
totalTokensPulled: BigInt!
"[CUMULATIVE] Total amount of tokens removed/withdrawn"
totalTokensRemoved: BigInt!
"All transactions of this user"
transactions: [Transaction!]! @derivedFrom(field: "user")
"Current UserDailyData entity created"
currentDailyDataEntity: UserDailyData
"Previous UserDailyData entity created"
previousDailyDataEntity: UserDailyData
"[DEPRECATED] Total polygonGRT balance"
polygonGRTBalance: BigInt!
}
"""
A collector authorized to pull tokens
"""
type Collector @entity {
"EVM address"
id: ID!
"Billing contract"
billing: Billing!
enabled: Boolean!
}
"""
A generic transaction
"""
interface Transaction {
"Transaction hash concatenated with event log index"
id: ID!
"Transaction hash"
hash: Bytes!
"Block number for the transaction"
blockNumber: Int!
"Timestamp for the transaction"
timestamp: Int!
"User of the transaction"
user: User!
"Amount of tokens used in the transaction"
amount: BigInt!
"Type of Graph Network transaction"
type: TransactionType!
}
"""
TokensAdded Transaction
"""
type TokensAdded implements Transaction @entity {
id: ID!
hash: Bytes!
blockNumber: Int!
timestamp: Int!
user: User!
amount: BigInt!
type: TransactionType!
}
"""
TokensRemoved Transaction
"""
type TokensRemoved implements Transaction @entity {
id: ID!
hash: Bytes!
blockNumber: Int!
timestamp: Int!
user: User!
amount: BigInt!
type: TransactionType!
"User that the tokens are withdrawn to"
to: Bytes!
}
"""
TokensPulled Transaction. Where a collector pulls tokens from the user
"""
type TokensPulled implements Transaction @entity {
id: ID!
hash: Bytes!
blockNumber: Int!
timestamp: Int!
user: User!
amount: BigInt!
type: TransactionType!
}
enum TransactionType {
TokensAdded
TokensRemoved
TokensPulled
}
"""
InsufficientBalanceForRemoval event, where a user tried to remove funds from L1 but the balance was insufficient
"""
type InsufficientBalanceForRemoval @entity {
id: ID!
hash: Bytes!
blockNumber: Int!
timestamp: Int!
user: User!
amount: BigInt!
"User that the tokens are tried to be withdrawn to"
to: Bytes!
}
# Daily data entities
type BillingDailyData @entity {
"<SUBGRAPH ID>-<DAY NUMBER>"
id: ID!
"Timestamp for the start of the day that this entity represents. UTC+0"
dayStart: BigInt!
"Timestamp for the end of the day that this entity represents. UTC+0"
dayEnd: BigInt!
"Number of the day this entity represents. Day 0 is the network launch day."
dayNumber: Int!
"Original entity that the daily data entity tracks"
entity: Billing!
"[CUMULATIVE] Total amount of tokens added"
totalTokensAdded: BigInt!
"[CUMULATIVE] Total amount of tokens pulled"
totalTokensPulled: BigInt!
"[CUMULATIVE] Total amount of tokens removed/withdrawn"
totalTokensRemoved: BigInt!
"[CURRENT] Total amount of currently available balance (totalTokensAdded - totalTokensPulled - totalTokensRemoved)"
totalCurrentBalance: BigInt!
"Address of the governor"
governor: Bytes!
"[DELTA] Chage in total tokens added since the last DailyData point"
totalTokensAddedDelta: BigInt!
"[DELTA] Chage in total tokens pulled since the last DailyData point"
totalTokensPulledDelta: BigInt!
"[DELTA] Chage in total tokens removed/withdrawn since the last DailyData point"
totalTokensRemovedDelta: BigInt!
"[DELTA] Chage in total currently available balance since the last DailyData point"
totalCurrentBalanceDelta: BigInt!
}
type UserDailyData @entity {
"<SUBGRAPH ID>-<DAY NUMBER>"
id: ID!
"Timestamp for the start of the day that this entity represents. UTC+0"
dayStart: BigInt!
"Timestamp for the end of the day that this entity represents. UTC+0"
dayEnd: BigInt!
"Number of the day this entity represents. Day 0 is the network launch day."
dayNumber: Int!
"Original entity that the daily data entity tracks"
entity: User!
"[CUMULATIVE] Total amount of tokens added"
totalTokensAdded: BigInt!
"[CUMULATIVE] Total amount of tokens pulled"
totalTokensPulled: BigInt!
"[CUMULATIVE] Total amount of tokens removed/withdrawn"
totalTokensRemoved: BigInt!
"[CURRENT] Amount of currently available balance"
billingBalance: BigInt!
"[DELTA] Chage in total tokens added since the last DailyData point"
totalTokensAddedDelta: BigInt!
"[DELTA] Chage in total tokens pulled since the last DailyData point"
totalTokensPulledDelta: BigInt!
"[DELTA] Chage in total tokens removed/withdrawn since the last DailyData point"
totalTokensRemovedDelta: BigInt!
"[DELTA] Chage in total currently available balance since the last DailyData point"
billingBalanceDelta: BigInt!
}