-
Notifications
You must be signed in to change notification settings - Fork 4
/
MarginModels.go
55 lines (49 loc) · 1.3 KB
/
MarginModels.go
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
package goghostex
type LoanStatus int
const (
LOAN_UNFINISH LoanStatus = iota
LOAN_PART_FINISH
LOAN_FINISH
_
_
_
LOAN_FAIL
LOAN_REPAY
)
type MarginAccount struct {
Pair Pair
SubAccount map[string]MarginSubAccount
LiquidationPrice float64 //预计爆仓价格
RiskRate float64
MarginRatio float64
}
type MarginSubAccount struct {
Currency Currency
// Amount = AmountNet + AmountLoaned = AmountAvail + AmountFrozen
Amount float64
// 可用额度
AmountAvail float64
// 冻结额度
AmountFrozen float64
// 净值额度
AmountNet float64
// 已借贷额度
AmountLoaned float64
// 当前借贷费用
LoaningFee float64
}
type Loan struct {
Pair Pair // The loan currency pair
Currency Currency // Currency
Amount float64 // Loan amount
AmountLoaned float64 // Loaned amount
AmountInterest float64 // Loan interest
Status LoanStatus // The loan record status
LoanId string // Remote loan record id
LoanTimestamp int64 // Loan timestamp
LoanDate string // Loan date
RepayId string // Remote loan record repay id
RepayTimestamp int64 // Repay Timestamp
RepayDate string // Repay Date
RepayDeadlineDate string // Repay Deadline Date
}