@@ -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
@@ -76,7 +73,7 @@ type Nft @entity{
76
73
id : ID !
77
74
symbol : String !
78
75
name : String !
79
- tokenUri : String !
76
+ tokenUri : String
80
77
81
78
"address of the owner of the nft"
82
79
owner : String !
@@ -115,134 +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 + eventIndex"
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
- eventIndex : BigInt
226
- "block number when it was created"
227
- block : Int
228
-
229
- gasLimit : BigDecimal !
230
- "price expressed in eth"
231
- gasPrice : BigDecimal !
232
-
233
- "base tokens transfered"
234
- baseToken : Token
235
-
236
- "number of base tokens transfered, for type SWAP if value is negative it means it was removed"
237
- baseTokenValue : BigDecimal
238
-
239
- "datatokens transfered"
240
- datatoken : Token
241
-
242
- "number of datatokens transfered, for type SWAP if value is negative it means it was removed"
243
- datatokenValue : BigDecimal
244
- }
245
-
246
115
type OrderReuse @entity {
247
116
id : ID !
248
117
order : Order !
@@ -253,6 +122,7 @@ type OrderReuse @entity {
253
122
providerFee : String
254
123
providerFeeValidUntil : BigInt
255
124
}
125
+
256
126
type Order @entity {
257
127
"transaction hash - token address - from address"
258
128
id : ID !
@@ -286,25 +156,9 @@ type Order @entity {
286
156
estimatedUSDValue : BigDecimal !
287
157
}
288
158
289
- # to be removed, mabye for pool shares only
290
- type TokenTransaction @entity {
291
- id : ID ! # Log ID
292
- event : String
293
- token : Token
294
- user : User
295
-
296
- block : Int !
297
- gasUsed : BigDecimal !
298
- gasPrice : BigDecimal !
299
- createdTimestamp : Int !
300
- tx : String !
301
- }
302
-
303
159
type User @entity {
304
160
id : ID !
305
- sharesOwned : [PoolShare ! ] @derivedFrom (field : " user" )
306
161
tokenBalancesOwned : [TokenValuePair ! ]
307
- poolTransactions : [PoolTransaction ! ] @derivedFrom (field : " user" )
308
162
orders : [Order ! ] @derivedFrom (field : " payer" )
309
163
freSwaps : [FixedRateExchangeSwap ! ] @derivedFrom (field : " by" )
310
164
@@ -422,28 +276,6 @@ type DispenserTransaction @entity {
422
276
tx : String !
423
277
}
424
278
425
- type PoolSnapshot @entity {
426
- id : ID !
427
- pool : Pool !
428
- "total pool shares at the end of the 24h interval"
429
- totalShares : BigDecimal !
430
- "swap value 24h"
431
- swapVolume : BigDecimal !
432
- "swap fee value 24h"
433
- swapFees : BigDecimal !
434
- "date without time"
435
- date : Int !
436
- "last spot price in the 24h interval"
437
- spotPrice : BigDecimal !
438
-
439
- baseToken : Token !
440
- baseTokenLiquidity : BigDecimal !
441
-
442
- datatoken : Token !
443
- datatokenLiquidity : BigDecimal !
444
-
445
- }
446
-
447
279
"utility type"
448
280
type GlobalTotalLiquidityPair @entity {
449
281
"address of the token"
@@ -453,15 +285,6 @@ type GlobalTotalLiquidityPair @entity {
453
285
value : BigDecimal!
454
286
}
455
287
456
- "utility type"
457
- type GlobalTotalPoolSwapPair @entity {
458
- "address of the token"
459
- id : ID!
460
- globalStatistic : GlobalStatistic !
461
- token : Token!
462
- value : BigDecimal!
463
- count : BigInt !
464
- }
465
288
"utility type"
466
289
type GlobalTotalFixedSwapPair @entity {
467
290
"address of the token"
@@ -472,25 +295,18 @@ type GlobalTotalFixedSwapPair @entity {
472
295
count : BigInt !
473
296
}
474
297
type GlobalStatistic @entity {
475
- id : ID !
476
-
477
- "total liquidity for each base token in pools"
478
- totalLiquidity : [GlobalTotalLiquidityPair ! ]! @derivedFrom (field : " globalStatistic" )
479
- "total swap volume for each base token in pools"
480
- totalPoolSwapVolume : [GlobalTotalPoolSwapPair ! ]! @derivedFrom (field : " globalStatistic" )
298
+ id : ID !
481
299
482
300
"total swap volume for each base token in fixed rate exchanges"
483
301
totalFixedSwapVolume : [GlobalTotalFixedSwapPair ! ] @derivedFrom (field : " globalStatistic" )
484
302
485
- "number of total orders. pool orders + fixed rate exchange orders + dispenser orders"
303
+ "number of total orders. fixed rate exchange orders + dispenser orders"
486
304
orderCount : Int !
487
305
488
306
"total nfts(erc721) created"
489
307
nftCount : Int !
490
308
"total datatokens (tokens with isDatatoken = true) created"
491
- datatokenCount :Int !
492
- "number of pools"
493
- poolCount : Int !
309
+ datatokenCount :Int !
494
310
495
311
"number of fixed rate exchanges"
496
312
fixedCount : Int !
@@ -524,7 +340,7 @@ type OPC @entity {
524
340
525
341
type NftUpdate @entity {
526
342
id : ID ! # update tx + nft address
527
- tokenUri : String !
343
+ tokenUri : String
528
344
nft : Nft !
529
345
530
346
"provider url that can decrypt the ddo"
0 commit comments