-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
76 lines (71 loc) · 1.58 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# this implies MarketContractMPX
type MarketContract @entity {
id: ID!
creator: Bytes
name: String
collateralTokenAddress: Bytes
collateralPoolAddress: Bytes
collateralPoolBalance: BigInt
priceFloor: BigInt
priceCap: BigInt
priceDecimalPlaces: BigInt
qtyMultiplier: BigInt
expirationTimestamp: BigInt
collateralPerUnit: BigInt
collateralTokenFeePerUnit: BigInt
mktTokenFeePerUnit: BigInt
settlementDelay: BigInt
shortPositionToken: PositionToken
longPositionToken: PositionToken
lastPrice: BigInt
settlementPrice: BigInt
settlementTimeStamp: BigInt
isSettled: Boolean
isWhitelisted: Boolean
factoryAddress: Bytes
oracleUrl: String
oracleStatistic: String
oracleHubAddress: Bytes
}
enum MarketSide {
Long
Short
Unknown
}
type PositionToken @entity {
id: ID!
name: String
symbol: String
decimals: Int
marketSide: MarketSide
marketContract: MarketContract
isMintable: Boolean
}
# I can get a list of all tokens this person owns
type PositionTokenOwner @entity {
id: ID! # owner+token Address
owner: Bytes!
token: PositionToken!
balance: BigInt
}
# log records of minting actions
type PositionTokenMintedEvent @entity {
id: ID!
qtyMinted: BigInt!
marketContract: MarketContract!
owner: Bytes!
collateralLocked: BigInt!
fee: BigInt!
feeTokenAddress: Bytes!
timestamp: BigInt!
}
# log records of redeeming actions
type PositionTokenRedeemedEvent @entity {
id: ID!
longQtyRedeemed: BigInt!
shortQtyRedeemed: BigInt!
marketContract: MarketContract!
owner: Bytes!
collateralUnlocked: BigInt!
timestamp: BigInt!
}