-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
76 lines (71 loc) · 1.33 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
type DepositOrWithdraw @entity {
id: ID!
vault: Bytes!
user: Bytes!
hash: Bytes!
amount: BigInt!
type: String!
balance: BigInt!
pps: BigInt!
ts: BigInt!
blockNumber: BigInt!
}
type Transaction @entity {
id: ID!
vault: Bytes!
from: Bytes!
to: Bytes!
hash: Bytes!
amount: BigInt!
fromBalance: BigInt!
toBalance: BigInt!
type: String!
pps: BigInt!
ts: BigInt!
blockNumber: BigInt!
}
type StrategyReport @entity {
id: ID!
vault: Bytes!
strategy: Bytes!
from: Bytes!
hash: Bytes!
gain: BigInt!
loss: BigInt!
debtPaid: BigInt!
totalGain: BigInt!
totalLoss: BigInt!
debtAdded: BigInt!
debtRatio: BigInt!
tokenPrice: BigInt!
mgmtFee: BigInt!
performanceFee: BigInt!
strategistFee: BigInt!
mgmtFeePaid: BigInt!
performanceFeePaid: BigInt!
strategistFeePaid: BigInt!
pps: BigInt!
ts: BigInt!
blockNumber: BigInt!
}
type User @entity {
id: ID! # address:vault
addr: Bytes!
vault: Bytes!
sumDeposits: BigInt!
sumWithdrawals: BigInt!
balance: BigInt!
profits: BigInt! # balanceOf(user) + sumWithdrawals - sumDeposits
transactions: [UserTransaction!]! @derivedFrom(field: "user")
}
type UserTransaction @entity {
id: ID! # address:vault
hash: Bytes!
user: User
from: Bytes!
to: Bytes!
value: BigInt!
tokenValue: BigInt!
type: String!
pps: BigInt!
}