-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.graphql
104 lines (96 loc) · 2.41 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
type Transfer @entity {
id: ID!
from: Account! # address
to: Account! # address
value: BigDecimal!
underlyingAmount: BigDecimal!
at: Checkpoint!
}
type Approval @entity {
id: ID!
owner: Account! # address
spender: Account! # address
value: BigDecimal!
at: Checkpoint!
}
type Mint @entity {
id: ID!
minter: Account! # address
dai: BigDecimal!
dDai: BigDecimal!
at: Checkpoint!
}
type Redeem @entity {
id: ID!
redeemer: Account! # address
dai: BigDecimal!
dDai: BigDecimal!
at: Checkpoint!
}
type Accrue @entity {
id: ID!
dDaiExchangeRate: BigDecimal!
cDaiExchangeRate: BigDecimal!
at: Checkpoint!
}
type CollectSurplus @entity {
id: ID!
dai: BigDecimal! # uint256
cDai: BigDecimal! # uint256
at: Checkpoint!
}
type Checkpoint @entity {
id: ID! # block number
version: Int!
totalSupply: BigDecimal!
totalSupplyUnderlying: BigDecimal!
exchangeRate: BigDecimal!
supplyRatePerBlock: BigDecimal!
estimatedAPR: String!
estimatedAPY: String!
cumulativeMintedDai: BigDecimal!
cumulativeRedeemedDai: BigDecimal!
cumulativeInterestEarned: BigDecimal!
lastAccrual: Int!
spreadPerBlock: BigDecimal!
currentCDaiSurplus: BigDecimal!
currentDaiSurplus: BigDecimal!
cumulativeCDaiSurplusPulled: BigDecimal!
cumulativeDaiSurplusPulled: BigDecimal!
cumulativeTransferredDai: BigDecimal!
mints: Int!
redeems: Int!
transfers: Int!
holders: Int!
blockNumber: Int!
blockTime: Int!
}
type Account @entity {
id: ID! # address
balance: BigDecimal! #
balanceUnderlying: BigDecimal!
totalInterestEarned: BigDecimal!
totalDaiTransferredIn: BigDecimal!
totalDaiTransferredOut: BigDecimal!
totalMintedDai: BigDecimal!
totalRedeemedDai: BigDecimal!
numberOfMints: Int!
numberOfRedeems: Int!
numberOfTransfersIn: Int!
numberOfTransfersOut: Int!
transfersIn: [Transfer!]! @derivedFrom(field: "to")
transfersOut: [Transfer!]! @derivedFrom(field: "from")
mintEvents: [Mint!]! @derivedFrom(field: "minter")
redeemEvents: [Redeem!]! @derivedFrom(field: "redeemer")
allowances: [Allowance!]! @derivedFrom(field: "spender")
approvals: [Allowance!]! @derivedFrom(field: "owner")
approvalEventsAsSpender: [Approval!]! @derivedFrom(field: "spender")
approvalEventsAsOwner: [Approval!]! @derivedFrom(field: "owner")
lastAction: Checkpoint!
}
type Allowance @entity {
id: ID!
owner: Account! # address
spender: Account! # address
value: BigDecimal!
}