-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
86 lines (62 loc) · 2.66 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
type HubPool @entity {
" Set to 1 because it is unique"
id: ID!
" List of user entities that provided liquidity"
cumulativeUniqueLiquidityProviders: [User!]
" Number of user entities that provided liquidity"
cumulativeUniqueLiquidityProvidersCount: BigInt!
}
type User @entity {
" Address of the liquidity provider"
id: ID!
" List of liquidityAdded entities by the user"
addedLiquidities: [AddedLiquidity!] @derivedFrom(field:"liquidityProvider")
" List of liquidityRemoved entities by the user"
removedLiquidities: [RemovedLiquidity!] @derivedFrom(field:"liquidityProvider")
" Number of liquidityAdded entities by the user, also used as index to produce id for liquidityAdded entities"
addedLiquidityCount: BigInt!
" Number of liquidityRemoved entities by the user, also used as index to produce id for liquidityRemoved entities"
removedLiquidityCount: BigInt!
}
type AddedLiquidity @entity {
# { Smart contract address of the l1 token } - { Address of the liquidity provider } - { index }
# where index is the index of the liquidity added by this address to Hub Pool v2
# @notice that one address can provide liquidity for different
# l1Tokens hence some l1-address-index id combinations might not exist
id: ID!
" L1 token that is added to the the HubPool"
l1Token: L1Token!
" Amount of the l1 token added as liquidity"
amount: BigInt!
" Amount of the lp tokens minted"
lpTokensMinted: BigInt!
" Address of the liquidity provider"
liquidityProvider: User!
}
type RemovedLiquidity @entity {
# { Smart contract address of the l1 token } - { Address of the liquidity provider } - { index }
# where index is the index of the liquidity removed by this address from Hub Pool v2
# @notice that one address can removed liquidity for different
# l1Tokens hence some l1-address-index id combinations might not exist
id: ID!
" L1 token that is removed from the HubPool"
l1Token: L1Token!
" Amount of the l1 token removed"
amount: BigInt!
" Amount of the lp tokens burnt"
lpTokensBurnt: BigInt!
" Address of the liquidity provider"
liquidityProvider: User!
}
type L1Token @entity {
" Smart contract address of the l1 token"
id: ID!
" Amount of this l1Token in the HubPool"
amount: BigInt!
" List of user entities that provided this l1Token as liquidity"
cumulativeUniqueLiquidityProviders: [AddedLiquidity!] @derivedFrom(field:"liquidityProvider")
" List of user entities that has active liquidity of l1Token in the HubPool"
activeLiquidityProviders: [AddedLiquidity!] @derivedFrom(field:"liquidityProviders")
}
# TODO hourly snapshot of the HubPool
# TODO daility snapshot of the HubPool