-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathschema.graphql
164 lines (152 loc) · 3.79 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
enum CyclePhase {
INTERMISSION
MANAGE
}
enum VoteDirection {
EMPTY
FOR
AGAINST
}
type Manager @entity {
id: ID! # address
kairoBalance: BigDecimal!
kairoBalanceWithStake: BigDecimal!
baseStake: BigDecimal!
riskTaken: BigDecimal!
riskThreshold: BigDecimal!
lastCommissionRedemption: BigInt!
basicOrders: [BasicOrder!]!
compoundOrders: [CompoundOrder!]!
fulcrumOrders: [FulcrumOrder!]!
commissionHistory: [CommissionRedemption!]!
totalCommissionReceived: BigDecimal!
roiHistory: [ManagerROI!]!
upgradeSignal: Boolean!
votes: [VoteDirection!]!
}
type BasicOrder @entity {
id: ID! # index in userInvestments[user] array + cycleNumber
idx: BigInt!
tokenAddress: String!
cycleNumber: BigInt!
stake: BigDecimal!
tokenAmount: BigDecimal!
rawTokenAmount: BigInt!
buyPrice: BigDecimal!
sellPrice: BigDecimal!
buyTime: BigInt!
sellTime: BigInt!
isSold: Boolean!
owner: String!
txHash: String! # transaction hash of order creation
}
type CompoundOrder @entity {
id: ID! # index in userCompoundOrders[user] array + cycleNumber
idx: BigInt!
tokenAddress: String!
cycleNumber: BigInt!
stake: BigDecimal!
collateralAmountInDAI: BigDecimal!
collateralRatio: BigDecimal!
currProfit: BigDecimal!
currCollateral: BigDecimal!
currBorrow: BigDecimal!
currCash: BigDecimal!
marketCollateralFactor: BigDecimal!
outputAmount: BigDecimal!
buyTokenPrice: BigDecimal! # the buy price of the token being traded (e.g. ETH, WBTC)
buyTime: BigInt!
sellTime: BigInt!
isSold: Boolean!
isShort: Boolean!
orderAddress: String!
owner: String!
txHash: String! # transaction hash of order creation
}
type FulcrumOrder @entity {
id: ID! # index in userInvestments[user] array + cycleNumber
idx: BigInt!
tokenAddress: String!
cycleNumber: BigInt!
stake: BigDecimal!
tokenAmount: BigDecimal!
rawTokenAmount: BigInt!
buyPrice: BigDecimal!
buyTokenPrice: BigDecimal! # the buy price of the token being traded (e.g. ETH, WBTC)
sellPrice: BigDecimal! # unit is underlyingToken/pToken
liquidationPrice: BigDecimal! # unit is underlyingToken/pToken
buyTime: BigInt!
sellTime: BigInt!
isSold: Boolean!
isShort: Boolean!
owner: String!
txHash: String! # transaction hash of order creation
}
type CommissionRedemption @entity {
id: ID! # tx hash
timestamp: BigInt!
cycleNumber: BigInt!
amountInDAI: BigDecimal!
txHash: String!
}
type Investor @entity {
id: ID! # address
sharesBalance: BigDecimal!
depositWithdrawHistory: [DepositWithdraw!]!
}
type DepositWithdraw @entity {
id: ID! # tx hash
timestamp: BigInt!
isDeposit: Boolean!
amountInDAI: BigDecimal!
txHash: String!
}
type Fund @entity {
id: ID! # always BetokenFund
address: String!
cycleNumber: BigInt!
cyclePhase: CyclePhase!
startTimeOfCyclePhase: BigInt!
totalFundsInDAI: BigDecimal!
totalFundsAtPhaseStart: BigDecimal!
kairoPrice: BigDecimal!
kairoTotalSupply: BigDecimal!
sharesPrice: BigDecimal!
sharesTotalSupply: BigDecimal!
sharesPriceHistory: [DataPoint!]!
aum: BigDecimal!
aumHistory: [DataPoint!]!
cycleTotalCommission: BigDecimal!
managers: [Manager!]!
lastProcessedBlock: BigInt!
cycleROIHistory: [BigDecimal!]!
# upgrade governance related
hasFinalizedNextVersion: Boolean!
upgradeVotingActive: Boolean!
nextVersion: String!
proposers: [String!]!
candidates: [String!]!
forVotes: [BigDecimal!]!
againstVotes: [BigDecimal!]!
upgradeSignalStrength: BigDecimal!
versionNum: BigInt!
}
type DataPoint @entity {
id: ID! # timestamp
timestamp: BigInt!
value: BigDecimal!
}
type ManagerROI @entity {
id: ID!
manager: String!
cycle: BigInt!
roi: BigDecimal!
kairoBalance: BigDecimal!
}
type TokenPrice @entity {
id: ID!
tokenSymbol: String!
tokenAddress: String!
priceInDAI: BigDecimal!
timestamp: BigInt!
}