-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
49 lines (43 loc) · 1.05 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
type User @entity {
id: ID! #ray tokenId
address: String!
portfolioId: Bytes!
tokenValue: BigInt! # deposited token value
tokenAddr: String! # which token is this, eth, dai?
isERC20: Boolean
}
type RayToken @entity {
id: ID! # tokenId
owner: User!
}
type Opportunity @entity {
id: ID!
opportunityTokenId: Bytes! # generated when portfolio lends to a opportunityId
portfolioId: Bytes!
}
type RayMint @entity {
id: ID!
value: BigInt! # in wei
rayTokenId: Bytes!
portfolioId: Bytes!
owner: String!
}
type RayDeposit @entity {
id: ID!
value: BigInt!
previousValue: BigInt!
rayTokenId: Bytes!
}
type RayWithdraw @entity {
id: ID!
valueAfterFee: BigInt! # value withdrawn, fees included
rayTokenId: Bytes!
totalValue: BigInt! # Total value of the position before withdrawal
}
type RayBurn @entity {
id: ID!
owner: String! # who will receive the value of this ray token
rayTokenId: Bytes!
value: BigInt! # amount transferred to owner (worth of token - fees)
worth: BigInt! # worth of the ray token, value without fees
}