@@ -47,9 +47,6 @@ type Token @entity {
47
47
"dispensers using this token"
48
48
dispensers : [Dispenser ! ] @derivedFrom (field :"token" )
49
49
50
- "pools, only available for datatokens"
51
- pools : [Pool ! ] @derivedFrom (field :"datatoken" )
52
-
53
50
"block time datatoken was created"
54
51
createdTimestamp : Int !
55
52
@@ -115,133 +112,6 @@ type Nft @entity{
115
112
orderCount : BigInt !
116
113
}
117
114
118
- type Pool @entity {
119
- "pool address"
120
- id : ID !
121
-
122
- "owner address, pool controller"
123
- controller : String !
124
-
125
- "only finalized pools are relevant to us"
126
- isFinalized : Boolean !
127
-
128
- "pool token symbol"
129
- symbol : String
130
-
131
- "pool token name"
132
- name : String
133
-
134
- "maximum supply if any, converted from wei"
135
- cap : BigDecimal
136
-
137
- baseToken : Token !
138
- baseTokenLiquidity : BigDecimal !
139
- baseTokenWeight : BigDecimal !
140
-
141
- datatoken : Token !
142
- datatokenLiquidity : BigDecimal !
143
- datatokenWeight : BigDecimal !
144
-
145
- "publisher market fee value"
146
- publishMarketSwapFee : BigDecimal !
147
- "publisher market fee total amount"
148
- publishMarketSwapFeeAmount : BigDecimal
149
-
150
- "Liquidty provider fee value"
151
- liquidityProviderSwapFee : BigDecimal
152
- "liquidity provider fee total amount"
153
- liquidityProviderSwapFeeAmount : BigDecimal !
154
-
155
- "total pool token shares"
156
- totalShares : BigDecimal !
157
-
158
- "total tokens that were swaped"
159
- totalSwapVolume : [TokenValuePair ! ]!
160
-
161
- spotPrice : BigDecimal !
162
-
163
- "count for when liquidity has been added"
164
- joinCount : BigInt !
165
-
166
- "count for when liquidity has been removed"
167
- exitCount : BigInt !
168
-
169
- "count for when tokens were swapped"
170
- swapCount : BigInt !
171
-
172
- "number of transactions in this pool involving liquidity changes"
173
- transactionCount : BigInt !
174
-
175
- "block time when pool was created"
176
- createdTimestamp : Int !
177
- "pool creation transaction id"
178
- tx : String !
179
- "block number when it was created"
180
- block : Int
181
-
182
- shares : [PoolShare ! ] @derivedFrom (field : " pool" )
183
- transactions : [PoolTransaction ! ] @derivedFrom (field : " pool" )
184
-
185
- "address of the market where the datatoken was created. This address collects market fees."
186
- publishMarketFeeAddress : String
187
-
188
-
189
-
190
-
191
- }
192
-
193
- # we will need to track pool share tx between users - bpool transfer tx event
194
- type PoolShare @entity {
195
- "poolAddress + userAddress"
196
- id : ID !
197
- user : User !
198
- pool : Pool !
199
- shares : BigDecimal !
200
- }
201
-
202
- enum PoolTransactionType {
203
- JOIN ,
204
- EXIT ,
205
- SWAP ,
206
- SETUP
207
- }
208
-
209
- type PoolTransaction @entity {
210
- "tx address + caller address"
211
- id : ID !
212
- "pool related to this tx"
213
- pool : Pool !
214
- "user that initiates the tx"
215
- user : User !
216
- type : PoolTransactionType !
217
-
218
- "number of shares transfered"
219
- sharesTransferAmount : BigDecimal !
220
-
221
- "block time when pool was created"
222
- timestamp : Int !
223
- "pool creation transaction id"
224
- tx : String !
225
- "block number when it was created"
226
- block : Int
227
-
228
- gasLimit : BigDecimal !
229
- "price expressed in eth"
230
- gasPrice : BigDecimal !
231
-
232
- "base tokens transfered"
233
- baseToken : Token
234
-
235
- "number of base tokens transfered, for type SWAP if value is negative it means it was removed"
236
- baseTokenValue : BigDecimal
237
-
238
- "datatokens transfered"
239
- datatoken : Token
240
-
241
- "number of datatokens transfered, for type SWAP if value is negative it means it was removed"
242
- datatokenValue : BigDecimal
243
- }
244
-
245
115
type OrderReuse @entity {
246
116
id : ID !
247
117
order : Order !
@@ -250,7 +120,6 @@ type OrderReuse @entity {
250
120
tx : String !
251
121
block : BigInt !
252
122
providerFee : String
253
- providerFeeValidUntil : BigInt
254
123
}
255
124
type Order @entity {
256
125
"transaction hash - token address - from address"
@@ -268,7 +137,6 @@ type Order @entity {
268
137
publishingMarketToken : Token #
269
138
publishingMarketAmmount : BigDecimal #call contract to get fee amount
270
139
providerFee : String
271
- providerFeeValidUntil : BigInt
272
140
273
141
consumerMarket : User
274
142
consumerMarketToken : Token #
@@ -301,9 +169,7 @@ type TokenTransaction @entity {
301
169
302
170
type User @entity {
303
171
id : ID !
304
- sharesOwned : [PoolShare ! ] @derivedFrom (field : " user" )
305
172
tokenBalancesOwned : [TokenValuePair ! ]
306
- poolTransactions : [PoolTransaction ! ] @derivedFrom (field : " user" )
307
173
orders : [Order ! ] @derivedFrom (field : " payer" )
308
174
freSwaps : [FixedRateExchangeSwap ! ] @derivedFrom (field : " by" )
309
175
@@ -421,28 +287,6 @@ type DispenserTransaction @entity {
421
287
tx : String !
422
288
}
423
289
424
- type PoolSnapshot @entity {
425
- id : ID !
426
- pool : Pool !
427
- "total pool shares at the end of the 24h interval"
428
- totalShares : BigDecimal !
429
- "swap value 24h"
430
- swapVolume : BigDecimal !
431
- "swap fee value 24h"
432
- swapFees : BigDecimal !
433
- "date without time"
434
- date : Int !
435
- "last spot price in the 24h interval"
436
- spotPrice : BigDecimal !
437
-
438
- baseToken : Token !
439
- baseTokenLiquidity : BigDecimal !
440
-
441
- datatoken : Token !
442
- datatokenLiquidity : BigDecimal !
443
-
444
- }
445
-
446
290
"utility type"
447
291
type GlobalTotalLiquidityPair @entity {
448
292
"address of the token"
@@ -452,15 +296,6 @@ type GlobalTotalLiquidityPair @entity {
452
296
value : BigDecimal!
453
297
}
454
298
455
- "utility type"
456
- type GlobalTotalPoolSwapPair @entity {
457
- "address of the token"
458
- id : ID!
459
- globalStatistic : GlobalStatistic !
460
- token : Token!
461
- value : BigDecimal!
462
- count : BigInt !
463
- }
464
299
"utility type"
465
300
type GlobalTotalFixedSwapPair @entity {
466
301
"address of the token"
@@ -471,25 +306,18 @@ type GlobalTotalFixedSwapPair @entity {
471
306
count : BigInt !
472
307
}
473
308
type GlobalStatistic @entity {
474
- id : ID !
475
-
476
- "total liquidity for each base token in pools"
477
- totalLiquidity : [GlobalTotalLiquidityPair ! ]! @derivedFrom (field : " globalStatistic" )
478
- "total swap volume for each base token in pools"
479
- totalPoolSwapVolume : [GlobalTotalPoolSwapPair ! ]! @derivedFrom (field : " globalStatistic" )
309
+ id : ID !
480
310
481
311
"total swap volume for each base token in fixed rate exchanges"
482
312
totalFixedSwapVolume : [GlobalTotalFixedSwapPair ! ] @derivedFrom (field : " globalStatistic" )
483
313
484
- "number of total orders. pool orders + fixed rate exchange orders + dispenser orders"
314
+ "number of total orders. fixed rate exchange orders + dispenser orders"
485
315
orderCount : Int !
486
316
487
317
"total nfts(erc721) created"
488
318
nftCount : Int !
489
319
"total datatokens (tokens with isDatatoken = true) created"
490
- datatokenCount :Int !
491
- "number of pools"
492
- poolCount : Int !
320
+ datatokenCount :Int !
493
321
494
322
"number of fixed rate exchanges"
495
323
fixedCount : Int !
0 commit comments