1
1
type PoolFactory @entity {
2
2
id : ID !
3
- totalValueLocked : [TokenValuePair ] # total value locked represented in the base token
4
- totalLiquidity : [TokenValuePair ] # total liquidity for each base token
5
- totalSwapVolume : [TokenValuePair ] # total swap volume for each base token
6
- totalSwapFee : [TokenValuePair ] # All the swap fee in Ocean
3
+ totalValueLocked : [TokenValue ] # total value locked represented in the base token
4
+ totalLiquidity : [TokenValue ] # total liquidity for each base token
5
+ totalSwapVolume : [TokenValue ] # total swap volume for each base token
6
+ totalSwapFee : [TokenValue ] # All the swap fee in Ocean
7
7
8
8
poolCount : Int ! # Number of pools
9
9
finalizedPoolCount : Int ! # Number of finalized pools
@@ -30,7 +30,7 @@ type Global @entity {
30
30
}
31
31
32
32
33
- type TokenValuePair @entity {
33
+ type TokenValue @entity {
34
34
35
35
token : Token!
36
36
value : BigDecimal!
@@ -63,8 +63,6 @@ type Token @entity {
63
63
block : Int # Block number when it was created
64
64
}
65
65
66
-
67
-
68
66
type Pool @entity {
69
67
id : ID ! # Pool address
70
68
poolFactory : PoolFactory ! # Pool factory
@@ -103,9 +101,7 @@ type Pool @entity {
103
101
104
102
tokens : [PoolToken ! ] @derivedFrom (field : " poolId" )
105
103
shares : [PoolShare ! ] @derivedFrom (field : " poolId" )
106
- transactions : [PoolTransaction ! ] @derivedFrom (field : " poolAddress" )
107
- //this doesn 't make sens , probably here because we had to link to pool
108
- transactionsTokenValues : [PoolTransactionTokenValues ! ] @derivedFrom (field : " poolAddress" )
104
+ transactions : [PoolTransaction ! ] @derivedFrom (field : " pool" )
109
105
}
110
106
111
107
//PoolToken - all good as it is
@@ -122,7 +118,6 @@ type PoolToken @entity {
122
118
decimals : Int # should we keep this, it is found on token?
123
119
}
124
120
125
-
126
121
type PoolShare @entity {
127
122
id : ID ! # poolId + userAddress
128
123
user : User !
@@ -132,63 +127,31 @@ type PoolShare @entity {
132
127
133
128
// Will be replaced with a generic PoolTokenValue WIP
134
129
135
- type PoolTransactionTokenValues @entity {
136
- id : ID ! # pool tx + tokenAddress
137
- txId : PoolTransaction !
138
130
139
- // should be an array of PoolToken
140
- poolToken : PoolToken !
141
- // not sure if needed
142
- poolAddress : Pool !
143
- //not sure if needed
144
- userAddress : User !
131
+ type PoolTransaction @entity {
132
+ id : ID ! # pool tx
133
+ pool : Pool # Pool related to this tx
134
+ user : User # User that initiates the swap
145
135
146
- // we will have the poolToken array , what will this be?
147
- tokenAddress : String !
136
+ sharesTransferAmount : BigDecimal ! # Number of shares transfered
137
+ sharesBalance : BigDecimal ! # TODO: what is this?
148
138
149
- // value of what ?
150
- value : BigDecimal !
151
139
152
- // should be an array if we keep this
153
- tokenReserve : BigDecimal !
154
- feeValue : BigDecimal ! # Swap fee value in OCEAN
155
- type : String !
156
- }
157
-
158
- type PoolTransaction @entity {
159
- id : ID ! # pool tx
160
- poolAddress --> pool : Pool
161
- userAddress --> user : User # User address that initiates the swap
162
- poolAddressStr --> poolAddress : String !
163
- userAddressStr --> userAddress : String !
164
-
165
- sharesTransferAmount : BigDecimal ! #
166
- sharesBalance : BigDecimal !
167
-
168
- spotPrice : BigDecimal !
169
- // should not be here
170
- consumePrice : BigDecimal !
171
140
tx : Bytes !
172
141
event : String
173
142
block : Int !
174
143
timestamp : Int !
175
144
gasUsed : BigDecimal !
176
145
gasPrice : BigDecimal !
177
146
178
- // should be an array , we will not have only ocean, it will be the tokens array
179
- oceanReserve : BigDecimal !
180
- datatokenReserve : BigDecimal !
181
-
182
- tokens : [PoolTransactionTokenValues ! ] @derivedFrom (field : " txId" )
147
+ tokens : [TokenValue ! ] # tokens transfered
183
148
}
184
149
185
150
186
- // we will have 2 dt factories ?
187
151
type DatatokenFactory @entity {
188
152
id : ID !
189
-
190
153
tokenCount : Int ! # Number of datatokens
191
- datatokens : [Datatoken ! ] @derivedFrom (field : " factoryID " )
154
+ datatokens : [Tokens ! ] @derivedFrom (field : " factory " )
192
155
}
193
156
194
157
0 commit comments