-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
45 lines (43 loc) · 948 Bytes
/
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
"""
Asset stores all high level variables for a Token asset
"""
type Asset @entity {
"Token address"
id: ID!
"Name of the Token"
name: String!
"Token symbol"
symbol: String!
"Token decimals"
decimals: Int!
"Defi asset category"
category: String!
}
"""
Account is an ETH address, with a list of all Token assets the account has
"""
type Account @entity {
"User ETH address"
id: ID!
"Array of Tokens user is in"
tokens: [AccountToken!]! @derivedFrom(field: "account")
}
"""
AccountToken is a single account within a single Token asset
"""
type AccountToken @entity {
"Token address + User address"
id: ID!
"User address"
userID: String!
"Relation to asset"
asset: Asset!
"Symbol of the Token"
symbol: String!
"Relation to user"
account: Account!
"Defi asset category"
category: String!
"Token balance of the user"
balance: BigDecimal!
}