Skip to content

Commit 0b8f6e1

Browse files
committed
Removing pools from schema
1 parent 6f96246 commit 0b8f6e1

File tree

1 file changed

+3
-175
lines changed

1 file changed

+3
-175
lines changed

schema.graphql

+3-175
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ type Token @entity {
4747
"dispensers using this token"
4848
dispensers: [Dispenser!] @derivedFrom(field:"token")
4949

50-
"pools, only available for datatokens"
51-
pools: [Pool!] @derivedFrom(field:"datatoken")
52-
5350
"block time datatoken was created"
5451
createdTimestamp: Int!
5552

@@ -115,133 +112,6 @@ type Nft @entity{
115112
orderCount: BigInt!
116113
}
117114

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-
245115
type OrderReuse @entity {
246116
id: ID!
247117
order: Order!
@@ -250,7 +120,6 @@ type OrderReuse @entity {
250120
tx: String!
251121
block: BigInt!
252122
providerFee: String
253-
providerFeeValidUntil: BigInt
254123
}
255124
type Order @entity {
256125
"transaction hash - token address - from address"
@@ -268,7 +137,6 @@ type Order @entity {
268137
publishingMarketToken: Token #
269138
publishingMarketAmmount: BigDecimal #call contract to get fee amount
270139
providerFee: String
271-
providerFeeValidUntil: BigInt
272140

273141
consumerMarket: User
274142
consumerMarketToken: Token #
@@ -301,9 +169,7 @@ type TokenTransaction @entity {
301169

302170
type User @entity {
303171
id: ID!
304-
sharesOwned: [PoolShare!] @derivedFrom(field: "user")
305172
tokenBalancesOwned: [TokenValuePair!]
306-
poolTransactions: [PoolTransaction!] @derivedFrom(field: "user")
307173
orders: [Order!] @derivedFrom(field: "payer")
308174
freSwaps: [FixedRateExchangeSwap!] @derivedFrom(field: "by")
309175

@@ -421,28 +287,6 @@ type DispenserTransaction @entity {
421287
tx: String!
422288
}
423289

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-
446290
"utility type"
447291
type GlobalTotalLiquidityPair @entity {
448292
"address of the token"
@@ -452,15 +296,6 @@ type GlobalTotalLiquidityPair @entity {
452296
value : BigDecimal!
453297
}
454298

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-
}
464299
"utility type"
465300
type GlobalTotalFixedSwapPair @entity {
466301
"address of the token"
@@ -471,25 +306,18 @@ type GlobalTotalFixedSwapPair @entity {
471306
count: BigInt!
472307
}
473308
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!
480310

481311
"total swap volume for each base token in fixed rate exchanges"
482312
totalFixedSwapVolume: [GlobalTotalFixedSwapPair!] @derivedFrom(field: "globalStatistic")
483313

484-
"number of total orders. pool orders + fixed rate exchange orders + dispenser orders"
314+
"number of total orders. fixed rate exchange orders + dispenser orders"
485315
orderCount: Int!
486316

487317
"total nfts(erc721) created"
488318
nftCount: Int!
489319
"total datatokens (tokens with isDatatoken = true) created"
490-
datatokenCount:Int!
491-
"number of pools"
492-
poolCount: Int!
320+
datatokenCount:Int!
493321

494322
"number of fixed rate exchanges"
495323
fixedCount: Int!

0 commit comments

Comments
 (0)