-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathLoanStruct.sol
30 lines (28 loc) · 1.28 KB
/
LoanStruct.sol
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
/**
* Copyright 2017-2021, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.17;
/**
* @title The Loan Object.
* @notice This contract code comes from bZx. bZx is a protocol for tokenized
* margin trading and lending https://bzx.network similar to the dYdX protocol.
*
* This contract contains the storage structure of the Loan Object.
* */
contract LoanStruct {
struct Loan {
bytes32 id; /// ID of the loan.
bytes32 loanParamsId; /// The linked loan params ID.
bytes32 pendingTradesId; /// The linked pending trades ID.
bool active; /// If false, the loan has been fully closed.
uint256 principal; /// Total borrowed amount outstanding.
uint256 collateral; /// Total collateral escrowed for the loan.
uint256 startTimestamp; /// Loan start time.
uint256 endTimestamp; /// For active loans, this is the expected loan end time, for in-active loans, is the actual (past) end time.
uint256 startMargin; /// Initial margin when the loan opened.
uint256 startRate; /// Reference rate when the loan opened for converting collateralToken to loanToken.
address borrower; /// Borrower of this loan.
address lender; /// Lender of this loan.
}
}