-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
97 lines (81 loc) · 2.08 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
"""
A token is a representation of a fungible asset on the blockchain
as specified by the ERC20 standard.
"""
type Token @entity(immutable: true) {
"token address"
id: Bytes!
"The token symbol"
symbol: String
"The token name"
name: String
"The number of decimals the token uses"
decimals: BigInt!
"Holder list of the token"
balances: [TokenBalance!]! @derivedFrom(field: "token")
"Token statistics"
statistics: [TokenStatistic!]! @derivedFrom(field: "token")
}
"""
Token statistics. This entity is updated by the subgraph.
"""
type TokenStatistic @entity {
"Token address"
id: Bytes!
"Token"
token: Token!
"The total supply of the token"
totalSupply: BigInt!
"How many holders this token has. With balance > 0"
holderCount: BigInt!
}
"""
A contract where transfers from/to are ignored
This is used to account for contracts that are not ERC20 compliant
but allow staking one token like beefy boosts
"""
type IgnoredContract @entity(immutable: true) {
id: Bytes!
}
"""
An holder account. Can be a user or a contract
"""
type Account @entity(immutable: true) {
"Account address"
id: Bytes!
"Account balance"
balances: [TokenBalance!]! @derivedFrom(field: "account")
}
"""
A token balance represents the amount of a specific token that an account holds
"""
type TokenBalance @entity {
"Account address + Token address"
id: Bytes!
"The token that this balance is for"
token: Token!
"Account that holds the token"
account: Account!
"""
Amount: the amount of the token this account holds.
This amount is what is available on chain.
@deprecated(reason: "use rawAmount instead")
"""
amount: BigInt!
"""
Raw amount: does not account for ignored contracts which can be buggy.
Raw amount is what is available on chain.
"""
rawAmount: BigInt!
}
"""
A debug entity to track how we discover contracts and avoid double counting
"""
type Contract @entity {
"The contract address"
id: Bytes!
"True if the contract was discovered via a factory"
factory: Boolean!
"True if the contract was enforced by a config file"
config: Boolean!
}