-
Notifications
You must be signed in to change notification settings - Fork 22
/
schema.graphql
148 lines (136 loc) · 3.7 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
# Stores easily-calculated metrics related to the Olympus protocol
type ProtocolMetric @entity(immutable: true) {
id: Bytes! # YYYY-MM-DD/<block>
block: BigInt!
currentAPY: BigDecimal!
currentIndex: BigDecimal!
date: String! # YYYY-MM-DD
gOhmPrice: BigDecimal!
gOhmSyntheticSupply: BigDecimal
gOhmTotalSupply: BigDecimal!
marketCap: BigDecimal
nextDistributedOhm: BigDecimal!
nextEpochRebase: BigDecimal!
ohmCirculatingSupply: BigDecimal
ohmFloatingSupply: BigDecimal
ohmPrice: BigDecimal!
ohmTotalSupply: BigDecimal!
sOhmCirculatingSupply: BigDecimal! # Returned by the sOHM contract, so can be included here
timestamp: BigInt! # Unix timestamp in UTC
totalValueLocked: BigDecimal!
treasuryLiquidBacking: BigDecimal
treasuryLiquidBackingPerGOhmSynthetic: BigDecimal
treasuryLiquidBackingPerOhmFloating: BigDecimal
treasuryMarketValue: BigDecimal
}
# Represents the balance of a specific token in the treasury
type TokenRecord @entity(immutable: true) {
id: Bytes! # YYYY-MM-DD/<block>/<source>/<token>
block: BigInt!
timestamp: BigInt! # Unix timestamp in UTC
date: String!
token: String!
tokenAddress: String!
source: String!
sourceAddress: String!
rate: BigDecimal!
balance: BigDecimal!
multiplier: BigDecimal!
value: BigDecimal! # Calculated
valueExcludingOhm: BigDecimal! # Calculated
category: String!
isLiquid: Boolean!
isBluechip: Boolean!
blockchain: String!
}
# Represents a balance that affects the supply of OHM
type TokenSupply @entity(immutable: true) {
id: Bytes! # YYYY-MM-DD/<block>/<token>/<type>/<pool>/<source>
block: BigInt!
timestamp: BigInt! # Unix timestamp in UTC
date: String! # YYYY-MM-DD
token: String!
tokenAddress: String!
pool: String
poolAddress: String
source: String # e.g. a wallet
sourceAddress: String
type: String! # e.g. total supply
balance: BigDecimal!
supplyBalance: BigDecimal! # may be negative to represent the token being taken out of circulation
}
type PriceSnapshot @entity(immutable: true) {
id: ID!
block: BigInt!
timestamp: BigInt!
date: String!
priceOhm: BigDecimal!
priceGOhm: BigDecimal!
}
# Should be a single entry
# Used for tracking markets
type GnosisAuctionRoot @entity {
id: ID!
markets: [BigInt!]!
}
type GnosisAuction @entity {
id: ID!
auctionOpenTimestamp: BigInt!
payoutCapacity: BigDecimal!
termSeconds: BigInt!
bidQuantity: BigDecimal # Is set later, so should not be required
auctionCloseTimestamp: BigInt
}
# Caching
type ERC20TokenSnapshot @entity(immutable: true) {
id: Bytes! # address/block
address: Bytes!
decimals: Int!
totalSupply: BigDecimal
}
# TODO migrate to PoolSnapshot
type BalancerPoolSnapshot @entity(immutable: true) {
id: Bytes! # pool id/block
block: BigInt!
pool: Bytes!
poolToken: Bytes!
decimals: Int!
totalSupply: BigDecimal!
tokens: [Bytes!]!
balances: [BigDecimal!]!
weights: [BigDecimal!]!
}
type PoolSnapshot @entity(immutable: true) {
id: Bytes! # pool/block
block: BigInt!
pool: Bytes!
poolToken: Bytes
decimals: Int!
totalSupply: BigDecimal!
tokens: [Bytes!]!
balances: [BigDecimal!]!
weights: [BigDecimal!]
}
type TokenPriceSnapshot @entity(immutable: true) {
id: Bytes! # address/block
block: BigInt!
token: Bytes!
price: BigDecimal!
}
type StakingPoolSnapshot @entity(immutable: true) {
id: Bytes! # address/block
block: BigInt!
contractAddress: Bytes!
stakingToken: Bytes # Will not be set if the call reverts
}
type BophadesModule @entity(immutable: true) {
id: Bytes! # module/block
block: BigInt!
keycode: String!
moduleAddress: Bytes!
}
type ClearinghouseAddress @entity(immutable: true) {
id: Bytes! # moduleAddress/block
block: BigInt!
addresses: [Bytes!]!
}