-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
98 lines (87 loc) · 2.02 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
type Token @entity {
id: ID!
symbol: String!
name: String!
decimals: BigInt!
}
type Book @entity {
# bookId
id: ID!
base: Token!
quote: Token!
unitSize: BigInt!
makerPolicy: BigInt!
takerPolicy: BigInt!
hooks: String!
depths: [Depth!]! @derivedFrom(field: "book")
openOrders: [OpenOrder!]! @derivedFrom(field: "book")
latestTick: BigInt!
latestPrice: BigInt!
latestTimestamp: BigInt!
}
type Depth @entity {
# `${bookId}-${tick}`
id: ID!
book: Book!
tick: BigInt!
price: BigInt!
unitAmount: BigInt!
baseAmount: BigInt!
quoteAmount: BigInt!
}
type OrderIndex @entity {
# `${bookId}-${tick}`
id: ID!
book: Book!
tick: BigInt!
price: BigInt!
latestTakenOrderIndex: BigInt!
}
type OpenOrder @entity {
# orderId
id: ID!
book: Book!
tick: BigInt!
orderIndex: BigInt!
price: BigInt!
user: String!
txHash: String!
createdAt: BigInt!
unitAmount: BigInt!
baseAmount: BigInt!
quoteAmount: BigInt!
unitFilledAmount: BigInt!
baseFilledAmount: BigInt!
quoteFilledAmount: BigInt!
unitClaimedAmount: BigInt!
baseClaimedAmount: BigInt!
quoteClaimedAmount: BigInt!
unitClaimableAmount: BigInt!
baseClaimableAmount: BigInt!
quoteClaimableAmount: BigInt!
unitOpenAmount: BigInt!
baseOpenAmount: BigInt!
quoteOpenAmount: BigInt!
}
type ChartLog @entity {
# `${baseToken}/${quoteToekn}-${intervalType}-${timestamp}`
id: ID!
# `${baseToken}/${quoteToekn}`
marketCode: String!
# interval type: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 1d, 1w
intervalType: String!
# normalized candle timestamp of the block where this trade occurred (second)
timestamp: BigInt!
open: BigDecimal!
high: BigDecimal!
low: BigDecimal!
close: BigDecimal!
baseVolume: BigDecimal!
bidBookBaseVolume: BigDecimal!
askBookBaseVolume: BigDecimal!
}
type LatestBlock @entity {
id: ID!
blockNumber: BigInt!
timestamp: BigInt!
}