-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
64 lines (49 loc) · 1.56 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
type Token @entity {
# token address
id: ID!
# mirrored from the smart contract
symbol: String!
name: String!
decimals: BigInt!
# used for other stats like marketcap
totalSupply: BigInt!
# token specific volume
tradeVolume: BigDecimal! # tradeVolume = SellBaseToken.payBase+BuyBaseToken.receiveBase
tradeVolumeUSD: BigDecimal! # SellBaseToken.receiveQuote+BuyBaseToken.payQuote
# untrackedVolumeUSD: BigDecimal!
# transactions across all pairs
txCount: BigInt!
# liquidity across all pairs
totalLiquidity: BigDecimal! # baseBalance + quoteBalance
# derived prices
# derivedETH: BigDecimal
}
type Pair @entity {
# pair address
id: ID!
# mirrored from the smart contract
baseToken: Token!
quoteToken: Token!
# reserve0: BigDecimal!
# reserve1: BigDecimal!
# totalSupply: BigDecimal!
# derived liquidity
# reserveETH: BigDecimal!
# reserveUSD: BigDecimal!
# trackedReserveETH: BigDecimal! # used for separating per pair reserves and global
# Price in terms of the asset pair
# token0Price: BigDecimal!
# token1Price: BigDecimal!
midPrice: BigDecimal!
# lifetime volume stats
volumeBaseToken: BigDecimal! # SellBaseToken.payBase+BuyBaseToken.receiveBase
volumeQuoteToken: BigDecimal! # SellBaseToken.receiveQuote+BuyBaseToken.payQuote
# volumeUSD: BigDecimal!
# untrackedVolumeUSD: BigDecimal!
txCount: BigInt!
# creation stats
createdAtTimestamp: BigInt!
createdAtBlockNumber: BigInt!
# Fields used to help derived relationship
# liquidityProviderCount: BigInt! # used to detect new exchanges
}