forked from enviodev/velodrome-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
159 lines (151 loc) · 7.9 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
type LiquidityPoolNew {
id: ID! # pool address
chainID: BigInt! # chain id of the pool
name: String! # name of the pool
token0: Token! # token0 entity
token1: Token! # token1 entity
isStable: Boolean! # whether the pool is a stable AMM or a volatile AMM
reserve0: BigInt! # reserve of token0 in token units
reserve1: BigInt! # reserve of token1 in token units
totalLiquidityUSD: BigInt! # total liquidity of the swap pool in USD
totalVolume0: BigInt! # total swap volume of token0 in token units
totalVolume1: BigInt! # total swap volume of token1 in token units
totalVolumeUSD: BigInt! # total swap volume of the pool in USD
totalFees0: BigInt! # total fees collected in token0 units
totalFees1: BigInt! # total fees collected in token1 units
totalFeesUSD: BigInt! # total fees collected in USD
numberOfSwaps: BigInt! # total number of swaps in the pool
token0Price: BigInt! # price of token0 relative to token1
token1Price: BigInt! # price of token1 relative to token0
totalEmissions: BigInt! # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! # total emissions for the pool in USD
totalBribesUSD: BigInt! # total bribes for the pool in USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
liquidityPoolHourlySnapshots: [LiquidityPoolHourlySnapshot!]! # hourly snapshots of the pool
@derivedFrom(field: "pool")
liquidityPoolDailySnapshots: [LiquidityPoolDailySnapshot!]! # daily snapshots of the pool
@derivedFrom(field: "pool")
liquidityPoolWeeklySnapshots: [LiquidityPoolWeeklySnapshot!]! # weekly snapshots of the pool
@derivedFrom(field: "pool")
}
# Entity for tracking a unique address in the `to` or `from` of a swap event
# Other liquidity pools don't count as users
type User {
id: ID! # user address
numberOfSwaps: BigInt! # total number of swaps the user has made
joined_at_timestamp: BigInt! # timestamp of the user's first swap (or being swapped to), Not accurate if run in multihead unordered mode.
}
# Hourly snapshot of the LiquidityPool entity
type LiquidityPoolHourlySnapshot {
id: ID! # address of the pool - number of days since unix epoch time
chainID: BigInt! # chain id of the pool
pool: String! # address of the pool
name: String! # name of the pool
reserve0: BigInt! # reserve of token0 in token units
reserve1: BigInt! # reserve of token1 in token units
totalLiquidityUSD: BigInt! # total liquidity of the swap pool in USD
totalVolume0: BigInt! # total swap volume of token0 in token units
totalVolume1: BigInt! # total swap volume of token1 in token units
totalVolumeUSD: BigInt! # total swap volume of the pool in USD
totalFees0: BigInt! # total fees collected in token0 units
totalFees1: BigInt! # total fees collected in token1 units
totalFeesUSD: BigInt! # total fees collected in USD
numberOfSwaps: BigInt! # total number of swaps in the pool
token0Price: BigInt! # price of token0 relative to token1
token1Price: BigInt! # price of token1 relative to token0
totalEmissions: BigInt! # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! # total emissions for the pool in USD
totalBribesUSD: BigInt! # total bribes for the pool in USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}
# Daily snapshot of the LiquidityPool entity
type LiquidityPoolDailySnapshot {
id: ID! # address of the pool - number of days since unix epoch time
chainID: BigInt! # chain id of the pool
pool: String! # address of the pool
name: String! # name of the pool
reserve0: BigInt! # reserve of token0 in token units
reserve1: BigInt! # reserve of token1 in token units
totalLiquidityUSD: BigInt! # total liquidity of the swap pool in USD
totalVolume0: BigInt! # total swap volume of token0 in token units
totalVolume1: BigInt! # total swap volume of token1 in token units
totalVolumeUSD: BigInt! # total swap volume of the pool in USD
totalFees0: BigInt! # total fees collected in token0 units
totalFees1: BigInt! # total fees collected in token1 units
totalFeesUSD: BigInt! # total fees collected in USD
numberOfSwaps: BigInt! # total number of swaps in the pool
token0Price: BigInt! # price of token0 relative to token1
token1Price: BigInt! # price of token1 relative to token0
totalEmissions: BigInt! # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! # total emissions for the pool in USD
totalBribesUSD: BigInt! # total bribes for the pool in USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}
# Weekly snapshot of the LiquidityPool entity
type LiquidityPoolWeeklySnapshot {
id: ID! # address of the pool - number of weeks since unix epoch time
chainID: BigInt! # chain id of the pool
pool: String! # address of the pool
name: String! # name of the pool
reserve0: BigInt! # reserve of token0 in token units
reserve1: BigInt! # reserve of token1 in token units
# totalLiquidityETH: BigInt! # total liquidity of the swap pool in ETH
totalLiquidityUSD: BigInt! # total liquidity of the swap pool in USD
totalVolume0: BigInt! # total swap volume of token0 in token units
totalVolume1: BigInt! # total swap volume of token1 in token units
totalVolumeUSD: BigInt! # total swap volume of the pool in USD
totalFees0: BigInt! # total fees collected in token0 units
totalFees1: BigInt! # total fees collected in token1 units
totalFeesUSD: BigInt! # total fees collected in USD
numberOfSwaps: BigInt! # total number of swaps in the pool
token0Price: BigInt! # price of token0 relative to token1
token1Price: BigInt! # price of token1 relative to token0
totalEmissions: BigInt! # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! # total emissions for the pool in USD
totalBribesUSD: BigInt! # total bribes for the pool in USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}
# Entity that tracks the latest state of the token entity
# By nature this entity saves the latest state of the token, and its state at different times should be attained from the snapshot entities
type Token {
id: ID! # token address
symbol: String! # token symbol
name: String! # token name
chainID: BigInt! # chain id of the token
decimals: BigInt! # number of decimals
pricePerUSDNew: BigInt! # price of token per USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
tokenHourlySnapshots: [TokenHourlySnapshot!]! @derivedFrom(field: "token") # hourly snapshots of the token
tokenDailySnapshots: [TokenDailySnapshot!]! @derivedFrom(field: "token") # daily snapshots of the token
tokenWeeklySnapshots: [TokenWeeklySnapshot!]! @derivedFrom(field: "token") # weekly snapshots of the token
}
# Hourly snapshot of the LiquidityPool entity
type TokenHourlySnapshot {
id: ID! # address of the token - number of weeks since unix epoch time
symbol: String! # token symbol
name: String! # token name
chainID: BigInt! # chain id of the token
token: String! # token address
pricePerUSDNew: BigInt! # price of token per USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}
# Daily snapshot of the LiquidityPool entity
type TokenDailySnapshot {
id: ID! # address of the token - number of weeks since unix epoch time
symbol: String! # token symbol
name: String! # token name
chainID: BigInt! # chain id of the token
token: String! # token address
pricePerUSDNew: BigInt! # price of token per USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}
# Weekly snapshot of the LiquidityPool entity
type TokenWeeklySnapshot {
id: ID! # address of the token - number of weeks since unix epoch time
symbol: String! # token symbol
name: String! # token name
chainID: BigInt! # chain id of the token
token: String! # token address
pricePerUSDNew: BigInt! # price of token per USD
lastUpdatedTimestamp: BigInt! # timestamp of last update
}