-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathschema.graphql
More file actions
35 lines (32 loc) · 844 Bytes
/
Copy pathschema.graphql
File metadata and controls
35 lines (32 loc) · 844 Bytes
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
# SubQuery Schema definition for TrustLend events
# TODO (SubQuery Indexer Migration):
# Define schema mappings for Deposit, Borrow, and Liquidation events.
type Deposit @entity {
id: ID! # Transaction Hash + Event Index
poolId: String! @index
lenderAddress: String! @index
amount: BigInt!
ledgerHeight: Int!
timestamp: Date!
}
type Borrow @entity {
id: ID! # Transaction Hash + Event Index
loanId: String! @index
borrowerAddress: String! @index
amount: BigInt!
durationDays: Int!
interestRateBps: Int!
totalDue: BigInt!
ledgerHeight: Int!
timestamp: Date!
}
type Liquidation @entity {
id: ID! # Transaction Hash + Event Index
loanId: String! @index
borrowerAddress: String! @index
liquidatorAddress: String!
repaidAmount: BigInt!
collateralSeized: BigInt!
ledgerHeight: Int!
timestamp: Date!
}