Skip to content

Commit 2e0f4b9

Browse files
committed
schema
1 parent 1b5ef43 commit 2e0f4b9

File tree

1 file changed

+35
-23
lines changed

1 file changed

+35
-23
lines changed

schema.graphql

+35-23
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ type Token @entity {
5050

5151
factory: DatatokenFactory #
5252

53-
creator: String # TODO
54-
publisher: String # TODO
55-
minter: String # TODO
56-
editor: String # TODO
53+
creator: String # TODO:
54+
publisher: String # TODO:
55+
minter: String # TODO:
56+
editor: String # TODO:
5757

5858
holderCount: BigInt # Number of addresses holding a balance of datatoken
5959
orderCount: BigInt # Number of orders executed for this datatoken
@@ -67,37 +67,26 @@ type Token @entity {
6767

6868
type Pool @entity {
6969
id: ID! # Pool address
70-
factoryID --> poolFactory: PoolFactory!
70+
poolFactory: PoolFactory! # Pool factory
7171
controller: Bytes! # Controller address
72-
publicSwap --> isPublicSwap: Boolean! # isPublicSwap
73-
finalized --> isFinalized: Boolean! # isFinalized
72+
isPublicSwap: Boolean! # TODO : what is this?
73+
isFinalized: Boolean! # only finalized pools are relevant to us
7474

75-
// will be able to change in v4, set by market or maybe by user
7675
symbol: String # Pool token symbol
77-
// will be a user inputed name
7876
name: String # Pool token name
7977
cap: BigInt # Maximum supply if any
80-
active --> isActive: Boolean! # isActive
78+
isActive: Boolean! #
8179
swapFee: BigDecimal! # Swap Fees
8280

83-
totalWeight: BigDecimal!
81+
totalWeight: BigDecimal! # TODO: What is this?
8482
totalShares: BigDecimal! # Total pool token shares
8583
totalSwapVolume: BigDecimal! # Total swap volume in main token
86-
totalSwapFee: BigDecimal! # Total swap fee in main token
84+
totalSwapFee: BigDecimal! # TODO: is this correct ? Total swap fee in main token
8785

88-
valueLocked: BigDecimal! # value locked in pool expressed in main token (captures both Ocean and Datatoken)
89-
//will be on token
90-
datatokenReserve: BigDecimal! # Total pool reserve of Datatoken
91-
// will be on token
92-
mainTokenReserve: BigDecimal! # Total pool reserve of main token
86+
totalValueLocked: BigDecimal! # value locked in pool expressed in main token (captures both Ocean and Datatoken)
9387

9488
spotPrice: BigDecimal!
95-
consumePrice: BigDecimal!
96-
97-
// remove
98-
tokenCount: BigInt! # Number of tokens in the pool
99-
// remove
100-
holderCount: BigInt! # Number of addresses holding a positive balance of pool shares
89+
consumePrice: BigDecimal! # TODO: still need?
10190

10291
// what is the point of the counts, we never used them => remove
10392
joinCount: BigInt! # liquidity has been added
@@ -388,3 +377,26 @@ type DispenserTransaction @entity {
388377
tx: Bytes!
389378
type: String!
390379
}
380+
381+
382+
type PoolSnapshotTokenValue @entity {
383+
id: ID! # pool tx + tokenAddress
384+
tokenAddress: String!
385+
value: BigDecimal!
386+
tokenReserve: BigDecimal!
387+
feeValue: BigDecimal! # Swap fee value in OCEAN
388+
type: String!
389+
poolSnapshot: PoolSnapshot!
390+
}
391+
392+
393+
type PoolSnapshot @entity {
394+
id: ID!
395+
pool: Pool!
396+
totalShares: BigDecimal!
397+
swapVolume: BigDecimal!
398+
swapFees: BigDecimal!
399+
timestamp: Int!
400+
tokens: [PoolSnapshotTokenValue!] @derivedFrom(field: "poolSnapshot")
401+
}
402+

0 commit comments

Comments
 (0)