-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
234 lines (213 loc) · 6.02 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
enum ProtocolVersion {
v2
v3
v3_1
}
# VestingTokenFactory
type VestingTokenFactory @entity {
id: String! # address
# Fee collector
feeCollector: Bytes!
# Creation Fee
currentGlobalCreationFee: BigInt!
nextGlobalCreationFee: BigInt!
nextGlobalCreationFeeTime: BigInt!
# Transfer Fee
currentGlobalTransferFee: BigInt!
nextGlobalTransferFee: BigInt!
nextGlobalTransferFeeTime: BigInt!
# Claim Fee
currentGlobalClaimFee: BigInt!
nextGlobalClaimFee: BigInt!
nextGlobalClaimFeeTime: BigInt!
# Tx info
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
# Misc
version: ProtocolVersion!
}
# CustomCreationFee for the underlying token
type CustomCreationFee @entity {
id: Bytes!
"Indicates if the custom fee is currently enabled."
isEnabled: Boolean!
"The current fee value in wei."
currentCustomValue: BigInt!
"The new fee value in wei to be applied at `valueChangeAt`."
nextCustomValue: BigInt!
"Timestamp at which a new fee value becomes effective."
valueChangeAt: BigInt!
"Indicates the future state of `isEnabled` after `statusChangeAt`."
nextEnableState: Boolean!
"Timestamp at which the change to `isEnabled` becomes effective."
statusChangeAt: BigInt!
underlyingToken: UnderlyingToken!
updatedAt: BigInt!
}
# CustomTransferFee for the underlying token
type CustomTransferFee @entity {
id: Bytes!
"Indicates if the custom fee is currently enabled."
isEnabled: Boolean!
"The current fee value in wei."
currentCustomValue: BigInt!
"The new fee value in wei to be applied at `valueChangeAt`."
nextCustomValue: BigInt!
"Timestamp at which a new fee value becomes effective."
valueChangeAt: BigInt!
"Indicates the future state of `isEnabled` after `statusChangeAt`."
nextEnableState: Boolean!
"Timestamp at which the change to `isEnabled` becomes effective."
statusChangeAt: BigInt!
underlyingToken: UnderlyingToken!
updatedAt: BigInt!
}
# CustomClaimFee for the underlying token
type CustomClaimFee @entity {
id: Bytes!
"Indicates if the custom fee is currently enabled."
isEnabled: Boolean!
"The current fee value in wei."
currentCustomValue: BigInt!
"The new fee value in wei to be applied at `valueChangeAt`."
nextCustomValue: BigInt!
"Timestamp at which a new fee value becomes effective."
valueChangeAt: BigInt!
"Indicates the future state of `isEnabled` after `statusChangeAt`."
nextEnableState: Boolean!
"Timestamp at which the change to `isEnabled` becomes effective."
statusChangeAt: BigInt!
underlyingToken: UnderlyingToken!
updatedAt: BigInt!
}
# PermanentFee for the `UnderlyingToken`.
type UnderlyingTokenPermanentFees @entity {
id: Bytes!
isEnabled: Boolean!
claimFeeValue: BigInt!
transferFeePercentage: BigInt!
underlyingToken: UnderlyingToken!
updatedAt: BigInt!
}
# PermanentFee for the `VestingToken`.
type VestingTokenPermanentFees @entity {
id: Bytes!
claimFeeValue: BigInt!
transferFeePercentage: BigInt!
vestingToken: VestingToken!
}
# UnderlyingToken (ERC20)
type UnderlyingToken @entity(immutable: true) {
id: String! # address
name: String!
symbol: String!
decimals: Int!
# Vesting tokens
vestingTokens: [VestingToken!]! @derivedFrom(field: "underlyingToken")
# Custom fees
customCreationFee: CustomCreationFee @derivedFrom(field: "underlyingToken")
customTransferFee: CustomTransferFee @derivedFrom(field: "underlyingToken")
customClaimFee: CustomClaimFee @derivedFrom(field: "underlyingToken")
# Permanent fees
permanentFees: UnderlyingTokenPermanentFees @derivedFrom(field: "underlyingToken")
}
# VestingToken
type VestingToken @entity {
id: String! # address
name: String!
symbol: String!
decimals: Int!
underlyingToken: UnderlyingToken! # address
# Milestones
milestones: [Milestone!]! @derivedFrom(field: "vestingToken")
# Deployer
deployer: String!
# Vesting balance
balance: VestingBalance! @derivedFrom(field: "vestingToken")
# Holders
holdersCount: Int!
recipientsCount: Int!
holders: [HolderBalance!]! @derivedFrom(field: "vestingToken")
# DistributionBatches
distributionBatches: [DistributionBatch!]! @derivedFrom(field: "vestingToken")
# Tx info
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
# Permanent fees
permanentFees: VestingTokenPermanentFees @derivedFrom(field: "vestingToken")
# Misc
version: ProtocolVersion!
}
type Claim @entity(immutable: true) {
id: Bytes!
vestingToken: VestingToken
claimer: Bytes! # address
amount: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type Burn @entity(immutable: true) {
id: Bytes!
vestingToken: VestingToken
burner: Bytes! # address
amount: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type Transfer @entity(immutable: true) {
id: Bytes!
vestingToken: VestingToken
from: Bytes! # address
to: Bytes! # address
value: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
distributionBatch: DistributionBatch # Optional. Not all transfers will have a distribution batch. Just those that were minted
}
type DistributionBatch @entity(immutable: false) {
id: String!
vestingToken: VestingToken!
totalAmount: BigInt!
from: Bytes! # address
recipients: [Transfer!]! @derivedFrom(field: "distributionBatch")
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type VestingBalance @entity {
id: String!
vestingToken: VestingToken!
allocation: BigInt!
claimed: BigInt!
claimable: BigInt!
locked: BigInt!
updatedAt: BigInt!
lastClaimedAt: BigInt
}
type HolderBalance @entity {
id: String!
user: String!
vestingToken: VestingToken!
isRecipient: Boolean!
allocation: BigInt!
claimed: BigInt!
claimable: BigInt!
locked: BigInt!
balance: BigInt!
updatedAt: BigInt!
lastClaimedAt: BigInt
transferredIn: BigInt!
transferredOut: BigInt!
}
type Milestone @entity {
id: String!
vestingToken: VestingToken!
timestamp: BigInt
ramp: Int
percentage: BigInt
}