-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
182 lines (174 loc) · 3.92 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
# Walnut summary data
type Walnut @entity {
id: ID!
# walnut TVL
tvl: BigInt!
# all staked assets
stakeAssets: [Bytes!]!
# all community tokens
cTokens: [Bytes!]!
# total revenue
revenue: BigInt!
# fee history
feeHistory: [FeeHistory!]!
# propriation history
propriationHistory: [AppropriationHistory!]!
# all created communities
communities: [Community!]! # How to query this fields length
# all communities counts
totalCommunities: Int!
# all users counts
totalUsers: Int!
# all pools counts
totalPools: Int!
# all gauge counts
totalGauges: Int!
}
type FeeHistory @entity {
id: ID!
timestamp: BigInt!
feeType: String!
community: Community!
pool: Pool!
payer: User!
amount: BigInt!
}
type AppropriationHistory @entity {
id: ID!
timestamp: BigInt!
recipient: Bytes!
amount: BigInt!
tx: Bytes!
}
# Community info
type Community @entity {
id: ID!
createdAt: BigInt!
# owner of community
owner: User!
# dao fund address
daoFund: Bytes!
# community dao fund
feeRatio: Int!
# cToken address
cToken: Bytes!
# treasury address
treasury: Bytes
# total distributed ctoken amount
distributedCToken: BigInt!
# total dao fund
revenue: BigInt!
# retainedRevenue
retainedRevenue: BigInt!
# all members
users: [User!]!
# all pool info
pools: [Pool!]!
# total users count
usersCount: Int!
# total pools count
poolsCount: Int!
# actived pool count
activedPoolCount: Int!
# all community admin operate history
operationHistory: [UserOperationHistory!]!
# all operate count include all user staking history within community
operationCount: Int!
}
type Pool @entity {
id: ID!
# pool index in activedPools
poolIndex: Int!
createdAt: BigInt!
status: PoolStatus!
# pool name
name: String!
# pool factory contract
poolFactory: Bytes!
# belong to community
community: Community!
# pool ratio
ratio: Int!
# staked asset address ,delegatee, cosmos delgatee
asset: Bytes!
# foreign chain id steem:1 hive:2 cosmos: 3
chainId: Int
# totalStakedAmount
totalAmount: BigInt!
# optional
tvl: BigInt
# all staker list
stakers: [User!]!
# all user count
stakersCount: Int!
# gauge
# 0: not create gauge; 1: create gauge
hasCreateGauge: Int!
# all voter list
voters: [User!]!
# all voter count
votersCount: Int!
# total voted amount
votedAmount: BigInt!
}
enum PoolStatus {
OPENED
CLOSED
}
type User @entity {
id: ID!
createdAt: BigInt!
address: Bytes!
inCommunities: [Community!]!
inPools: [Pool!]!
inGauges: [Pool!]!
# all user's operate history
operationHistory: [UserOperationHistory!]!
# total operation counts
operationCount: Int!
}
enum UserOpertationHistoryType {
DEPOSIT
WITHDRAW
HARVEST
HARVESTALL
VOTE
UNVOTE
WITHDRAWGAUGECTOKEN
WITHDRAWGAUGENUT
ADMINCREATE
ADMINSETFEE
ADMINADDPOOL
ADMINCLOSEPOOL
ADMINSETRATIO
ADMINSETDAOFUND
ADMINWITHDRAWNREVENUE
ADMINCREATENEWGAUGE
ADMINWITHDRAWGAUGENUT
REDEEMFROMTREASURY
ADMINCREATETREASURY
}
type UserOperationHistory @entity {
id: ID!
type: UserOpertationHistoryType!
community: Community!
# pool factory contract
poolFactory: Bytes
# pool: withdraw all pools if this field is null
pool: Pool
# user address
user: Bytes!
# foreign chain id: steem:1, hive:2
chainId: Int
# DEPOSIT/WITHDRAW: stake asset
# HARVEST/HARVESTALL: community token
# if this is from steem/hive delegate, it will be delegatee
# if revenue withdrawn, asset mean dao fund address
asset: Bytes
# operated asset amount
amount: BigInt
# opertate time
timestamp: BigInt!
# transaction hash
tx: Bytes!
}