-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
224 lines (193 loc) · 6.76 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
enum ActionCategory {
Claim
Clawback
Create
TransferAdmin
}
enum CampaignCategory {
LockupDynamic
LockupLinear
LockupTranched
}
type Action @entity {
"unique identifier resolving to transaction hash concatenated with the log index (there may be multiple actions per tx)"
id: String!
"transaction details: block number"
block: BigInt!
"category of action e.g. Create or Clawback"
category: ActionCategory!
"hardcoded chainId"
chainId: BigInt!
"contract through which the stream actions has been triggered"
campaign: Campaign!
"transaction details: hash"
hash: Bytes!
"address that triggered the transaction"
from: Bytes!
"unique global id tracked by the subgraph watcher"
subgraphId: BigInt!
"transaction details: timestamp"
timestamp: BigInt!
"claim action data: stream identifier as constructed in the protocol subgraph - origin contract address concatenated with the chainId and the tokenId"
claimStreamId: String
"claim action data: native stream id"
claimTokenId: BigInt
"claim action data: amount"
claimAmount: BigInt
"claim action data: recipient index"
claimIndex: BigInt
"claim action data: recipient index"
claimRecipient: Bytes
"clawback action data: amount"
clawbackAmount: BigInt
"clawback action data: amount"
clawbackFrom: Bytes
"clawback action data: amount"
clawbackTo: Bytes
}
type Activity @entity {
"unique identifier resolving to the string 'activity' concatenated with the campaign id and the day of the snapshot"
id: String!
"campaign the activity (day) is linked to"
campaign: Campaign!
"timestamp for the start of the day"
timestamp: BigInt!
"day index (UNIX time / 24 * 60 * 60)"
day: BigInt!
"amount claimed during the day"
amount: BigInt!
"number of claims completed during the day"
claims: BigInt!
}
type Asset @entity(immutable: true) {
"unique identifier resolving to the ERC20 asset/token address"
id: String!
"address of the ERC20 asset/token"
address: Bytes!
"hardcoded chainId"
chainId: BigInt!
"decimals of the ERC20 asset/token"
decimals: BigInt!
"name of the ERC20 asset/token"
name: String!
"symbol of the ERC20 asset/token"
symbol: String!
"campaigns that rely on this asset/token"
campaigns: [Campaign!]! @derivedFrom(field: "asset")
}
type Campaign @entity {
"unique identifier resolving to the contract address concatenated with the chainId"
id: String!
"unique global id tracked by the subgraph watcher"
subgraphId: BigInt!
"address of the campaign"
address: Bytes!
"underlying asset"
asset: Asset!
"factory producing the campaign"
factory: Factory!
"hardcoded chainId"
chainId: BigInt!
"transaction hash for the campaign creation"
hash: Bytes!
"timestamp of the campaign creation (for sorting reasons)"
timestamp: BigInt!
"category of the produced streams e.g. LockupLinear or LockupDynamic"
category: CampaignCategory!
"address of the campaign admin, entitled to clawback"
admin: Bytes!
"address of the lockup contract through which streams will be created"
lockup: Bytes!
"merkle root"
root: Bytes!
"flag showing if the campaign expires or is forever claimable"
expires: Boolean!
"time at which the campaign expires and clawback is enabled, if the expires flag is true"
expiration: BigInt
"name assigned as the campaign title"
name: String!
"ipfs content identifier for the list of recipients and other static details"
ipfsCID: String!
"funds required for the entire campaign to conclude"
aggregateAmount: BigInt!
"total number of recipients"
totalRecipients: BigInt!
"action in which the campaign underwent a clawback, if it was supposed to expire"
clawbackAction: Action
"timestamp for the when the campaign underwent a clawback"
clawbackTime: BigInt
"flag showing if the produced stream has a cliff, only available on linear streams"
streamCliff: Boolean!
"timestamp for the start of the cliff, if there's a streamCliff, only available on linear streams"
streamCliffDuration: BigInt
"total duration for produced streams"
streamTotalDuration: BigInt!
"flag showing the *initial* cancelability of the produced streams (making it false is a one-way trip, tracked in the protocol subgraph)"
streamCancelable: Boolean!
"flag showing the transferability of the produced streams"
streamTransferable: Boolean!
"total claimed amount up to this point"
claimedAmount: BigInt!
"number of claims requested up to this point"
claimedCount: BigInt!
"index of the campaign based on the factory's campaignIndex"
position: BigInt!
"full version based on the v2-core contract versioning system (e.g. '2.0' / '2.1')"
version: String!
"a set of tranches with unlock percentages instead of concrete amounts, only available on tranched streams"
streamTranches: [Tranche!]! @derivedFrom(field: "campaign")
"actions triggered in the context of this campaign"
actions: [Action!]! @derivedFrom(field: "campaign")
"list of daily activity snapshots for days with 1+ events"
activities: [Activity!]! @derivedFrom(field: "campaign")
}
type Factory @entity {
"unique identifier resolving to contract address"
id: String!
"hardcoded alias"
alias: String!
"address of the contract"
address: Bytes!
"hardcoded chainId"
chainId: BigInt!
"full version based on the v2-core contract versioning system (e.g. '2.0' / '2.1')"
version: String!
"factory index for campaigns"
campaignIndex: BigInt!
"list of campaigns"
campaigns: [Campaign!]! @derivedFrom(field: "factory")
}
type Tranche @entity {
"unique id resolving to campaign id concatenated with the position of the tranche"
id: String!
"position of the tranche inside the array"
position: BigInt!
"stream upon which the tranche is used"
campaign: Campaign!
"percentage resolving to the percentage of value streamed during this tranche"
percentage: BigInt!
"timestamp resolving to the duration of the tranche"
duration: BigInt!
"derived percentage resoling to the total amount in percentages streamed until the start of the timestamp"
startPercentage: BigInt!
"derived percentage resoling to the total amount in percentages streamed until the end of the timestamp"
endPercentage: BigInt!
"duration accrued at the end of the tranche"
endDuration: BigInt!
"timestamp resolving to the duration accrued at the start of the tranche"
startDuration: BigInt!
}
type Watcher @entity {
"unique identifier for the watcher, resolving to the chainId - there is only one watcher for the entire subgraph"
id: String!
"hardcoded chainId"
chainId: BigInt!
"global index for actions"
actionIndex: BigInt!
"global index for campaigns"
campaignIndex: BigInt!
"flag that defines the initialization status of the subgraph"
initialized: Boolean!
"list of logs, for debugging purposes"
logs: [String!]!
}