-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
142 lines (132 loc) · 2.91 KB
/
schema.graphql
File metadata and controls
142 lines (132 loc) · 2.91 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
enum InstrumentType {
deposit,
borrow
}
enum DepositState {
active,
inactive
}
enum LoanState {
active,
repaid,
inactive,
liquidated
}
type User @entity {
id: ID!
"Wallet address of user"
address: Bytes!
"Loans borrowed by the user"
loans: [Loan!]!
"Deposits made by the user"
deposits: [Deposit!]!
}
type Loan @entity {
id: ID!
"Market in which loan was borrowed"
initialMarket: String!
"Borrow amount in initialMarket asset"
initialAmount: BigInt!
"Loan minimum commitment in days"
commitment: String!
"Market in which loan is currently active"
currentMarket: String!
"Amount of currentMarket asset"
currentAmount: BigInt!
"Is loan swapped to secondary market"
isSwapped: Boolean!
"Loan current state"
state: LoanState!
"Collateral which was provided at the time of borrow"
collateral: Collateral!
"Total fee paid by user for this loan"
feePaid: BigInt!
"User who borrowed the loan"
user: User!
"Total interest accrued"
interestAccrued: BigInt!
createdAt: Int!
updatedAt: Int!
}
type Collateral @entity {
id: ID!
"Collateral market"
market: String!
"Collateral initial amount"
initialAmount: BigInt!
"Collateral current amount"
currentAmount: BigInt!
"Total fee paid by user for this loan"
feePaid: BigInt!
"Loan against which the collateral was deposited"
loan: Loan!
date: Int!
}
type Deposit @entity {
id: ID!
"Market in which deposit was made"
market: String!
"Amount for which deposit was made"
amount: BigInt!
"Current deposit amount"
currentAmount: BigInt!
"Minimum commitment for this deposit"
commitment: String!
"Interest accrued for this deposit"
interestAccrued: BigInt!
"State of deposit"
state: DepositState!
"Timelock started at in seconds since epoch"
lockedAt: Int
"Timelock validity in seconds since epoch"
lockValidity: Int
"Total fee paid for this deposit"
feePaid: BigInt
"User who made the deposit"
user: User!
createdAt: Int!
updatedAt: Int!
}
type Apr @entity {
id: ID!
"Insrument type for the apr record"
instrumentType: InstrumentType!
"Market to which the apr belongs"
market: String!
"Minimum commitment for the apr record"
commitment: String!
"Rate of interest"
interest: Int!
date: Int!
}
type SupportedMarket @entity {
id: ID!
"Symbol of the market in bytes32"
symbol: String!
"Token address"
address: Bytes!
"Minimum required amount for any operation"
minAmount: BigInt!
}
type Reserve @entity {
id: ID!
"Market of the reserve"
market: String!
"Minimum commitment for the reserve"
commitment: String!
"Amount in the reserve"
amount: BigInt!
"Insrument type for the reserve"
instrumentType: InstrumentType!
date: Int!
}
type Utilisation @entity {
id: ID!
"Market of loan utilisation"
market: String!
"Minimum commitment of loan utilisation"
commitment: String!
"Amount of loan utilised"
amount: BigInt!
date: Int!
}