-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
252 lines (189 loc) · 7.3 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
enum EntityType {
"Fund Entity"
Fund
"Org Entity"
Org
"Unknown Entity, not yet fully supported by the subgraph."
Unknown
}
"An entity that is part of the Endaoment protocol."
type NdaoEntity @entity {
"Contract address of the entity."
id: Bytes!
"The type of the entity."
entityType: EntityType!
"The EIN of the entity. Only applicable to Orgs."
ein: String
"Manager of the entity."
entityManager: Bytes!
"USDC Balance that has been formally recognized by the entity."
recognizedUsdcBalance: BigInt!
"Total amount of native ETH that was transferred to the entity."
totalEthReceived: BigInt!
"""
Amount USDC that has been donated to this entity, after fees. Any recognized inbound asset transfer from addresses
outside the Endaoment protocol is considered a Donation.
"""
totalUsdcDonationsReceived: BigInt!
"Amount of fees that have been collected from donations to this entity."
totalUsdcDonationFees: BigInt!
"Amount of USDC that has been granted to this entity, after fees. Any Fund -> Org transfer is considered a grant."
totalUsdcGrantsReceived: BigInt!
"Amount of fees that have been paid by grantors for grants to this entity."
totalUsdcGrantInFees: BigInt!
"Amount of USDC that has been donated or granted to this entity, after fees."
totalUsdcContributionsReceived: BigInt!
"Amount of fees that have been collected from donations or grants to this entity."
totalUsdcContributionFees: BigInt!
"""
Amount of USDC that has been transferred to this entity. This includes only transfers that are not considered grants.
Example: (Org -> Org, Fund -> Fund, Org -> Fund)
"""
totalUsdcTransfersReceived: BigInt!
"Amount of USDC that has been paid in fees for transfers to this entity."
totalUsdcTransferInFees: BigInt!
"Amount of USDC that has been migrated to this entity from Endaoment V1."
totalUsdcMigrated: BigInt!
"Amount of USDC that has been received by this entity using any Endaoment V2 Entity method, including V1 migration."
totalUsdcReceived: BigInt!
"Amount of USDC that has been paid in fee for all inbound USDC transactions to this entity."
totalUsdcReceivedFees: BigInt!
"""
Amount of USDC that has been granted out to other Endaoment entities by this entity, net of fees.
Any Fund -> Org transfer is considered a grant.
"""
totalUsdcGrantedOut: BigInt!
"Amount of fees that have been paid by this entity for grants to other Endaoment entities."
totalUsdcGrantedOutFees: BigInt!
"""
Amount of USDC that has been transferred out of this entity, net of fees. This includes only transfers that are not
considered grants. Example: (Org -> Org, Fund -> Fund, Org -> Fund)
"""
totalUsdcTransferredOut: BigInt!
"Amount of USDC that has been paid in fees for transfers out of this entity."
totalUsdcTransferredOutFees: BigInt!
"Amount of USDC that has been paid out to accounts or wallets owned by the entity outside the Endaoment Protocol."
totalUsdcPaidOut: BigInt!
"Amount of USDC that has been paid in fees for payouts from this entity"
totalUsdcPaidOutFees: BigInt!
"""
Flag indicating whether the entity has been fully initialized with V1 migration data. For this to occur, the entity
must have emitted at least 1 event in 2 separate blocks.
Entities that are not fully initialized will account for migrated funds in its balance but not include them in the
following fields:
> * totalUsdcMigrated
> * totalUsdcReceived
"""
initialized: Boolean!
"""
USDC Balance that the entity has invested in Portfolios belonging to the Endaoment protocol.
> * This is the sum of all USDC invested in all portfolios and NOT the current USDC value of the portfolio shares.
> * Fees are included in the amount, since it tracks the entire sum sent to portfolio contracts.
> * When shares are redeemed, this amount is reduced proportionally to the amount of shares redeemed.
"""
investedUsdc: BigInt!
"Positions owned by the entity in various portfolios."
positions: [PortfolioPosition!]! @derivedFrom(field: "entity")
}
"A position taken by an Endaoment entity in a portfolio approved by Endaoment"
type PortfolioPosition @entity {
"""
Id of the position, which is a concatenation of the portfolio address and the entity address.
Format: <0xPortfolio_address>|<0xEntity_address>
"""
id: ID!
"Address of the entity that owns this position."
entity: NdaoEntity!
"Address of the portfolio that invested by the entity."
portfolio: Bytes!
"Shares of the portfolio that are owned by the entity."
shares: BigInt!
"Amount of USDC invested by the entity in the portfolio."
investedUsdc: BigInt!
}
"Entity representing the Endaoment Protocol Registry."
type Registry @entity {
"ID of the registry, which is the constant string '1'"
id: String!
"Address of the Endaoment Registry contract."
address: Bytes!
"Owner of the Endaoment Registry contract."
owner: Bytes!
"Address of the Entity Factories approved on the registry."
entityFactories: [Bytes!]!
"Address of the swap wrappers approved on the registry."
swapWrappers: [Bytes!]!
"Address of the portfolios approved on the registry."
portfolios: [Bytes!]!
}
"Address that has a special authority in the Endaoment protocol."
type AuthorityUser @entity {
"Address of the authority user."
id: Bytes!
"Roles of the authority user."
roles: [RoleUser!]! @derivedFrom(field: "user")
}
"Role assigned to an authority user."
type RoleUser @entity {
"""
Address of the role user.
Format: <user_address>|<role_id>
"""
id: ID!
"User that has the role."
user: AuthorityUser!
"Role assigned to the user."
role: Role!
}
"Role that can invoke capabilities."
type Role @entity {
"ID of the role - String representation of the role's integer id."
id: String!
"Users associated with the role."
users: [RoleUser!]! @derivedFrom(field: "role")
"Capabilities of the role."
capabilities: [RoleCapability!]! @derivedFrom(field: "role")
}
"Capability that can be invoked by a role."
type RoleCapability @entity {
"""
ID of the role capability.
Format: <role_id>|<capability_id>
"""
id: ID!
"Role that can invoke the capability."
role: Role!
"Capability that can be invoked by the role."
capability: Capability!
}
"Capability that can be invoked publicly or via a role."
type Capability @entity {
"""
ID of the capability.
Format: <target>|<signature>
"""
id: ID!
"Target of the capability."
target: Bytes!
"Signature that can be invoked on the target of the capability."
signature: Bytes!
"Indicates if the capability can be invoked by any address publicly."
isPublic: Boolean!
"Roles that can invoke the capability."
roles: [RoleCapability!]! @derivedFrom(field: "capability")
}
"""
Helper metadata entity to track migration information of an NdaoEntity. Not meant to be queried directly, as the
information here only useful for internal indexing logic. As soon as an entity is fully initialized, this entity
is not longer updated.
"""
type NdaoEntityFirstIndexedBlock @entity {
# Contract address of the entity.
id: Bytes!
# Balance of the entity at the end of the first block it emitted and event.
endOfBlockBalance: BigInt!
# Number of the initial block that was processed.
blockNumber: BigInt!
# Balance delta due to events emitted in the initial block.
eventBalanceDelta: BigInt!
}