This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
forked from Desert-Defi/set-protocol-v2-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.graphql
142 lines (121 loc) · 4.8 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
type Controller @entity {
id: ID! # Controller ID (= "1")
address: String! # Controller contract address
# derived fields
setTokens: [SetToken!]! @derivedFrom(field: "controller")
}
type SetTokenCount @entity {
id: ID!
count: BigInt!
}
# Entity to keep track of templated addresses in order to prevent repeat
# instantiation attempts
type TemplateTracker @entity {
id: ID!
}
type Manager @entity {
# NOTE: This field is deprecated and will be removed
address: String!
id: ID! # manager address
type: String! # manager type
# derived fields
setTokens: [SetToken!]! @derivedFrom(field: "manager")
}
type DelegatedManager @entity {
id: ID! # contract address
owner: Owner # owner address
methodologist: Methodologist # methodologist address
setToken: SetToken! # linked SetToken (only 1-to-1)
operators: [Operator!] # Operator associations
}
type SetToken @entity {
# NOTE: This field is deprecated and will be removed
address: String!
id: ID! # contract address
controller: Controller! # associated Controller
inception: BigInt! # block timestamp
manager: Manager! # associated Manager
name: String! # name of Set
symbol: String! # symbol of Set
activityLog: ActivityLog! # log of events
}
type Owner @entity {
id: ID! # owner address
setTokens: [SetToken!] # associated SetToken addresses
}
type Methodologist @entity {
id: ID! # methodologist address
setTokens: [SetToken!] # associated SetToken addresses
}
type Operator @entity {
id: ID! # operator address
setTokens: [SetToken!] # associated SetToken addresses
}
type ActivityLog @entity {
id: ID! # SetToken address
# derived fields
feeRecipientUpdates: [FeeRecipientUpdate!] @derivedFrom(field: "activityLog")
managerUpdates: [ManagerUpdate!] @derivedFrom(field: "activityLog")
streamingFeeAccrues: [StreamingFeeAccrue!] @derivedFrom(field: "activityLog")
streamingFeeUpdates: [StreamingFeeUpdate!] @derivedFrom(field: "activityLog")
rebalanceTrades: [RebalanceTrade!] @derivedFrom(field: "activityLog")
ownerUpdates: [OwnerUpdate!] @derivedFrom(field: "activityLog")
methodologistUpdates: [MethodologistUpdate!] @derivedFrom(field: "activityLog")
operatorUpdates: [OperatorUpdate!] @derivedFrom(field: "activityLog")
}
type FeeRecipientUpdate @entity {
id: ID! # transaction hash
timestamp: BigInt! # timestamp of transaction
address: String! # address of new recipient
activityLog: ActivityLog! # associated ActivityLog
}
type ManagerUpdate @entity {
id: ID! # transaction hash
timestamp: BigInt! # timestamp of transaction
oldManager: String! # address of old manager
newManager: String! # address of new manager
activityLog: ActivityLog! # associated ActivityLog
}
type StreamingFeeAccrue @entity {
id: ID! # transaction hash
timestamp: BigInt! # timestamp of transaction
managerFee: BigInt! # amount of Sets accrued to manager as fee
protocolFee: BigInt! # amount of Sets accrued to protocol as fee
activityLog: ActivityLog! # associated ActivityLog
}
type StreamingFeeUpdate @entity {
id: ID! # transaction hash
timestamp: BigInt! # timestamp of transaction
fee: BigInt! # new streaming fee
activityLog: ActivityLog! # associated ActivityLog
}
type RebalanceTrade @entity {
id: ID! # transaction hash
timestamp: BigInt! # timestamp of transaction
exchange: String! # name of the exchange in integrations registry
sendToken: String! # address of token sent to exchange
receiveToken: String! # address of token received from exchange
totalSendAmount: BigInt! # net total tokens sent
totalReceiveAmount: BigInt! # net total tokens received
fee: BigInt! # protocol fee
activityLog: ActivityLog! # associated ActivityLog
}
type OwnerUpdate @entity {
id: ID! # transaction hash
address: String! # new owner address
timestamp: BigInt! # timestamp of transaction
activityLog: ActivityLog! # associated ActivityLog
}
type MethodologistUpdate @entity {
id: ID! # transaction hash
address: String! # new methodologist address
timestamp: BigInt! # timestamp of transaction
activityLog: ActivityLog! # associated ActivityLog
}
type OperatorUpdate @entity {
id: ID! # transaction hash
action: String! # "OperatorAdded" or "OperatorRemoved"
address: String! # target operator address
timestamp: BigInt! # timestamp of transaction
activityLog: ActivityLog! # associated ActivityLog
}