generated from subsquid-labs/squid-substrate-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
87 lines (77 loc) · 1.7 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
type Swap @entity {
timestamp: BigInt
fromCurrency: Currency
toCurrency: Currency
fromAmount: BigInt
toAmount: BigInt
}
type LiquidityChange @entity {
id: ID!
timestamp: BigInt!
blockNumber: Int!
eventIdx: Int!
step: Int!
reason: LiquidityChangeReason!
currencyZero: String!
currencyOne: String!
amountZero: BigInt!
amountOne: BigInt!
balanceZero: BigInt!
balanceOne: BigInt!
# currencies: [Currency]
}
enum LiquidityChangeReason {
INIT
SWAP
ADD
REMOVE
}
type Currency @entity {
currencyName: String! @index
decimals: Int
volumeDayHistory: [CurrVolumeDay] @derivedFrom(field: "currency")
liquidityHistory: [CurrLiquidity] @derivedFrom(field: "currency")
priceHistory: [CurrPrice] @derivedFrom(field: "currency")
# transactions: [LiquidityChange!]!
}
type CurrPrice @entity {
currency: Currency
usdPrice: Float
timestamp: DateTime
}
type CurrVolumeDay @entity {
currency: Currency
timestamp: DateTime
volumeDayNative: BigInt
volumeDayUSD: Float
}
type CurrLiquidity @entity {
currency: Currency
timestamp: DateTime
liquidity: BigInt
liquidityUSD: Float
}
type Pool @entity {
currency0: String!
currency1: String!
volumeDaysDay: [PoolVolumeDay] @derivedFrom(field: "pool")
liquidityHistory: [PoolLiquidity] @derivedFrom(field: "pool")
# poolOperations: [LiquidityChange] @derivedFrom(field: "pool")
}
type PoolVolumeDay @entity {
pool: Pool
timestamp: DateTime
volumeDayUSD: Float
}
type PoolLiquidity @entity {
pool: Pool
timestamp: DateTime
token0Liquidity: BigInt
token1Liquidity: BigInt
usdTotalLiquidity: Float
}
type OverviewHistory @entity {
totalLiquidity: BigInt
totalVolumeDay: BigInt
timestamp: DateTime
}