-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
64 lines (61 loc) · 1.43 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
type Trade @entity {
id: ID!
block: Int! @index
trader: String! @index
subject: String! @index
isBuy: Boolean!
shareAmount: BigInt!
ethAmount: BigInt!
protocolEthAmount: BigInt!
subjectEthAmount: BigInt!
supply: BigInt!
txnHash: String! @index
}
type Subject @entity {
id: ID! # same as address
address: String! @index
firstTradeBlock: Int! @index
supply: BigInt!
totalTrades: Int!
totalEthVolume: BigInt!
totalEthBuyVolume: BigInt!
totalEthSellVolume: BigInt!
totalShareVolume: BigInt!
totalShareBuyVolume: BigInt!
totalShareSellVolume: BigInt!
subjectEthTotal: BigInt!
ownShareVolume: BigInt!
ownShareBought: BigInt!
ownShareSold: BigInt!
ethPaidForOwnShare: BigInt!
ethReceivedForOwnShare: BigInt!
ownShareTradingProfit: BigInt!
ultimateSubjectProfit: BigInt!
}
type BlockStats @entity {
id: ID! # `${block}`
block: Int! @index
trades: Int!
numInvolvedSubjects: Int!
ethVolume: BigInt!
ethBuyVolume: BigInt!
ethSellVolume: BigInt!
shareVolume: BigInt!
shareBuyVolume: BigInt!
shareSellVolume: BigInt!
subjectEthTotal: BigInt!
protocolEthTotal: BigInt! # should be equal to the subject fees total
}
type AllTimeStats @entity {
id: ID!
trades: Int!
numSubjects: Int!
ethVolume: BigInt!
ethBuyVolume: BigInt!
ethSellVolume: BigInt!
shareVolume: BigInt!
shareBuyVolume: BigInt!
shareSellVolume: BigInt!
subjectEthTotal: BigInt!
protocolEthTotal: BigInt! # should be equal to the subject fees total
}