-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
100 lines (93 loc) · 2.35 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
type ProxyTrade @entity {
"This object is a summary of one or more trades handled through reserves."
id: ID!
trader: User!
"From token address"
src: String!
"To token address"
dest: String!
"From token amount in wei"
actualSrcAmount: BigInt!
"To token amount in wei"
actualDestAmount: BigInt!
createdAtBlockTimestamp: BigInt!
createdAtBlockNumber: BigInt!
createdAtLogIndex: BigInt!
createdAtTransactionHash: String!
}
type ReserveTrade @entity {
"This object is a single trade handled by a specific reserve - the result of which is also counted in ProxyTrade."
id: ID!
"From token address"
src: String!
"To token address"
dest: String!
"From token amount (wei)"
srcAmount: BigInt!
"To token amount (wei)"
destAmount: BigInt!
reserve: Reserve!
createdAtBlockTimestamp: BigInt!
createdAtBlockNumber: BigInt!
createdAtLogIndex: BigInt!
createdAtTransactionHash: String!
}
type User @entity {
"Ethereum address"
id: ID!
"Trades by user"
trades: [ProxyTrade!] @derivedFrom(field: "trader")
}
type Reserve @entity {
"Ethereum address"
id: ID!
isPermissionless: Boolean!
isRemoved: Boolean!
isTradeEnabled: Boolean!
network: Network!
"Exchange rate contract (if applicable)"
rateContract: String
"Sanity rate contract (if applicable)"
sanityContract: String
"Reserve balances"
tokenBalances: [ReserveTokenBalance!] @derivedFrom(field: "reserve")
"Reserve trading pairs"
tradingPairs: [TradingPair!] @derivedFrom(field: "reserve")
"Trades through this reserve"
trades: [ReserveTrade!] @derivedFrom(field: "reserve")
createdAtBlockTimestamp: BigInt!
createdAtBlockNumber: BigInt!
createdAtLogIndex: BigInt!
createdAtTransactionHash: String!
}
type Network @entity {
"Ethereum address"
id: ID!
proxy: String!
isCurrentNetwork: Boolean!
isEnabled: Boolean!
"Reserves on this network"
reserves: [Reserve!] @derivedFrom(field: "network")
}
type TradingPair @entity {
id: ID!
reserve: Reserve!
"From token address"
src: String!
"To token address"
dest: String!
isTradingPairEnabled: Boolean!
}
type Token @entity {
"Ethereum address"
id: ID!
"Reserve balances of this token"
reserveBalances: [ReserveTokenBalance!] @derivedFrom(field: "token")
}
type ReserveTokenBalance @entity {
id: ID!
"Token amount (wei)"
amount: BigInt!
reserve: Reserve!
token: Token!
}