Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
fd703948
Commit
fd703948
authored
Oct 16, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#627 删除清算罚金;增加借贷超时时间和超时清算
parent
c9fbaf73
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
279 additions
and
190 deletions
+279
-190
collateralize.go
plugin/dapp/collateralize/executor/collateralize.go
+14
-0
collateralizedb.go
plugin/dapp/collateralize/executor/collateralizedb.go
+127
-36
query.go
plugin/dapp/collateralize/executor/query.go
+14
-5
collateralize.proto
plugin/dapp/collateralize/proto/collateralize.proto
+16
-19
collateralize.go
plugin/dapp/collateralize/types/collateralize.go
+0
-1
collateralize.pb.go
plugin/dapp/collateralize/types/collateralize.pb.go
+105
-127
tx.go
plugin/dapp/collateralize/types/tx.go
+1
-2
types.go
plugin/dapp/collateralize/types/types.go
+2
-0
No files found.
plugin/dapp/collateralize/executor/collateralize.go
View file @
fd703948
...
...
@@ -139,4 +139,17 @@ func (c *Collateralize) deleteCollateralizeRecordStatus(collateralizelog *pty.Re
kv
:=
&
types
.
KeyValue
{
Key
:
key
,
Value
:
nil
}
kvs
=
append
(
kvs
,
kv
)
return
kvs
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func
(
c
*
Collateralize
)
CheckReceiptExecOk
()
bool
{
return
true
}
// ExecutorOrder 设置localdb的EnableRead
func
(
c
*
Collateralize
)
ExecutorOrder
()
int64
{
if
types
.
IsFork
(
c
.
GetHeight
(),
"ForkLocalDBAccess"
)
{
return
drivers
.
ExecLocalSameTime
}
return
c
.
DriverBase
.
ExecutorOrder
()
}
\ No newline at end of file
plugin/dapp/collateralize/executor/collateralizedb.go
View file @
fd703948
...
...
@@ -23,13 +23,12 @@ const (
)
const
(
decimal
=
types
.
Coin
// 1e8
MaxDebtCeiling
=
10000
// 最大借贷限额
MinLiquidationRatio
=
0.3
// 最小质押比
MaxStabilityFee
=
1000
// 最大稳定费
MaxLiquidationPenalty
=
1000
// 最大清算罚金
MinCreatorAccount
=
1000000
// 借贷创建者账户最小ccny余额
PriceWarningRate
=
1.3
decimal
=
types
.
Coin
// 1e8
MaxDebtCeiling
=
10000
// 最大借贷限额
MinLiquidationRatio
=
0.3
// 最小质押比
MaxStabilityFee
=
1000
// 最大稳定费
PriceWarningRate
=
1.3
// 价格提前预警率
ExpireWarningTime
=
3600
*
24
*
10
// 提前10天超时预警
)
// CollateralizeDB def
...
...
@@ -193,6 +192,18 @@ func getLatestLiquidationPrice(coll *pty.Collateralize) float32 {
return
latest
}
func
getLatestExpireTime
(
coll
*
pty
.
Collateralize
)
int64
{
var
latest
int64
=
0x7fffffffffffffff
for
_
,
collRecord
:=
range
coll
.
BorrowRecords
{
if
collRecord
.
ExpireTime
<
latest
{
latest
=
collRecord
.
ExpireTime
}
}
return
latest
}
// CollateralizeCreate 创建借贷,持有一定数量ccny的用户可创建借贷,提供给其他用户借贷
func
(
action
*
Action
)
CollateralizeCreate
(
create
*
pty
.
CollateralizeCreate
)
(
*
types
.
Receipt
,
error
)
{
var
logs
[]
*
types
.
ReceiptLog
...
...
@@ -204,9 +215,7 @@ func (action *Action) CollateralizeCreate(create *pty.CollateralizeCreate) (*typ
// 参数校验
if
create
.
DebtCeiling
>
MaxDebtCeiling
||
create
.
DebtCeiling
<
0
||
create
.
LiquidationRatio
<
MinLiquidationRatio
||
create
.
LiquidationRatio
>=
1
||
create
.
StabilityFee
>
MaxStabilityFee
||
create
.
StabilityFee
<
0
||
create
.
LiquidationPenalty
>
MaxLiquidationPenalty
||
create
.
LiquidationPenalty
<
0
||
create
.
TotalBalance
<
MinCreatorAccount
{
create
.
StabilityFee
>
MaxStabilityFee
||
create
.
StabilityFee
<
0
{
return
nil
,
pty
.
ErrRiskParam
}
...
...
@@ -237,7 +246,6 @@ func (action *Action) CollateralizeCreate(create *pty.CollateralizeCreate) (*typ
coll
.
LiquidationRatio
=
create
.
LiquidationRatio
coll
.
TotalBalance
=
create
.
TotalBalance
coll
.
DebtCeiling
=
create
.
DebtCeiling
coll
.
LiquidationPenalty
=
create
.
LiquidationPenalty
coll
.
StabilityFee
=
create
.
StabilityFee
coll
.
Balance
=
create
.
TotalBalance
coll
.
CreateAddr
=
action
.
fromaddr
...
...
@@ -433,6 +441,7 @@ func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*typ
borrowRecord
.
DebtValue
=
borrow
.
Value
borrowRecord
.
LiquidationPrice
=
coll
.
LiquidationRatio
*
lastPrice
*
pty
.
CollateralizePreLiquidationRatio
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusCreate
borrowRecord
.
ExpireTime
=
action
.
blocktime
+
coll
.
Period
// 记录当前借贷的最高自动清算价格
if
coll
.
LatestLiquidationPrice
<
borrowRecord
.
LiquidationPrice
{
...
...
@@ -478,9 +487,12 @@ func (action *Action) CollateralizeRepay(repay *pty.CollateralizeRepay) (*types.
// 查找借出记录
var
borrowRecord
*
pty
.
BorrowRecord
for
_
,
record
:=
range
coll
.
BorrowRecords
{
var
index
int
for
i
,
record
:=
range
coll
.
BorrowRecords
{
if
record
.
AccountAddr
==
action
.
fromaddr
{
borrowRecord
=
record
index
=
i
break
}
}
...
...
@@ -527,7 +539,10 @@ func (action *Action) CollateralizeRepay(repay *pty.CollateralizeRepay) (*types.
// 保存
coll
.
Balance
+=
repay
.
Value
coll
.
BorrowRecords
=
append
(
coll
.
BorrowRecords
[
:
index
],
coll
.
BorrowRecords
[
index
+
1
:
]
...
)
coll
.
InvalidRecords
=
append
(
coll
.
InvalidRecords
,
borrowRecord
)
coll
.
LatestLiquidationPrice
=
getLatestLiquidationPrice
(
&
coll
.
Collateralize
)
coll
.
LatestExpireTime
=
getLatestExpireTime
(
&
coll
.
Collateralize
)
coll
.
Save
(
action
.
db
)
kv
=
append
(
kv
,
coll
.
GetKVSet
()
...
)
...
...
@@ -612,6 +627,7 @@ func (action *Action) CollateralizeAppend(cAppend *pty.CollateralizeAppend) (*ty
// 记录当前借贷的最高自动清算价格
coll
.
LatestLiquidationPrice
=
getLatestLiquidationPrice
(
&
coll
.
Collateralize
)
coll
.
LatestExpireTime
=
getLatestExpireTime
(
&
coll
.
Collateralize
)
coll
.
Save
(
action
.
db
)
kv
=
append
(
kv
,
coll
.
GetKVSet
()
...
)
...
...
@@ -691,43 +707,105 @@ func (action *Action) systemLiquidation(coll *pty.Collateralize, price float32)
var
kv
[]
*
types
.
KeyValue
collDB
:=
&
CollateralizeDB
{
*
coll
}
for
_
,
borrowRecord
:=
range
coll
.
BorrowRecords
{
for
index
,
borrowRecord
:=
range
coll
.
BorrowRecords
{
var
preStatus
int32
if
borrowRecord
.
LiquidationPrice
*
PriceWarningRate
>=
price
{
if
borrowRecord
.
LiquidationPrice
>=
price
{
getGuarantorAddr
,
err
:=
getGuarantorAddr
(
action
.
db
)
if
borrowRecord
.
LiquidationPrice
*
PriceWarningRate
<
price
{
continue
}
if
borrowRecord
.
LiquidationPrice
>=
price
{
getGuarantorAddr
,
err
:=
getGuarantorAddr
(
action
.
db
)
if
err
!=
nil
{
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Error
(
"systemLiquidation"
,
"getGuarantorAddr"
,
err
)
continue
}
clog
.
Error
(
"systemLiquidation"
,
"getGuarantorAddr"
,
err
)
continue
}
}
// 抵押物转移
receipt
,
err
:=
action
.
coinsAccount
.
ExecTransferFrozen
(
action
.
fromaddr
,
getGuarantorAddr
,
action
.
execaddr
,
borrowRecord
.
CollateralValue
)
if
err
!=
nil
{
clog
.
Error
(
"systemLiquidation"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
borrowRecord
.
CollateralValue
,
"err"
,
err
)
continue
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 抵押物转移
receipt
,
err
:=
action
.
coinsAccount
.
ExecTransferFrozen
(
action
.
fromaddr
,
getGuarantorAddr
,
action
.
execaddr
,
borrowRecord
.
CollateralValue
)
// 借贷记录清算
borrowRecord
.
LiquidateTime
=
action
.
blocktime
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusSystemLiquidate
coll
.
BorrowRecords
=
append
(
coll
.
BorrowRecords
[
:
index
],
coll
.
BorrowRecords
[
index
+
1
:
]
...
)
coll
.
InvalidRecords
=
append
(
coll
.
InvalidRecords
,
borrowRecord
)
}
else
{
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusWarning
}
log
:=
action
.
GetFeedReceiptLog
(
coll
,
borrowRecord
,
preStatus
)
logs
=
append
(
logs
,
log
)
}
// 保存
coll
.
LatestLiquidationPrice
=
getLatestLiquidationPrice
(
coll
)
coll
.
LatestExpireTime
=
getLatestExpireTime
(
coll
)
collDB
.
Save
(
action
.
db
)
kv
=
append
(
kv
,
collDB
.
GetKVSet
()
...
)
receipt
:=
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
kv
,
Logs
:
logs
}
return
receipt
,
nil
}
// 超时清算
func
(
action
*
Action
)
expireLiquidation
(
coll
*
pty
.
Collateralize
)
(
*
types
.
Receipt
,
error
)
{
var
logs
[]
*
types
.
ReceiptLog
var
kv
[]
*
types
.
KeyValue
collDB
:=
&
CollateralizeDB
{
*
coll
}
for
index
,
borrowRecord
:=
range
coll
.
BorrowRecords
{
var
preStatus
int32
if
borrowRecord
.
ExpireTime
-
ExpireWarningTime
>
action
.
blocktime
{
continue
}
if
borrowRecord
.
ExpireTime
>=
action
.
blocktime
{
getGuarantorAddr
,
err
:=
getGuarantorAddr
(
action
.
db
)
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Error
(
"systemLiquidation"
,
"
addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
borrowRecord
.
CollateralValue
,
"er
r"
,
err
)
clog
.
Error
(
"systemLiquidation"
,
"
getGuarantorAdd
r"
,
err
)
continue
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 借贷记录清算
borrowRecord
.
LiquidateTime
=
action
.
blocktime
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusSystemLiquidate
}
else
{
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusWarning
}
log
:=
action
.
GetFeedReceiptLog
(
coll
,
borrowRecord
,
preStatus
)
logs
=
append
(
logs
,
log
)
// 抵押物转移
receipt
,
err
:=
action
.
coinsAccount
.
ExecTransferFrozen
(
action
.
fromaddr
,
getGuarantorAddr
,
action
.
execaddr
,
borrowRecord
.
CollateralValue
)
if
err
!=
nil
{
clog
.
Error
(
"systemLiquidation"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
borrowRecord
.
CollateralValue
,
"err"
,
err
)
continue
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 借贷记录清算
borrowRecord
.
LiquidateTime
=
action
.
blocktime
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusSystemLiquidate
coll
.
BorrowRecords
=
append
(
coll
.
BorrowRecords
[
:
index
],
coll
.
BorrowRecords
[
index
+
1
:
]
...
)
coll
.
InvalidRecords
=
append
(
coll
.
InvalidRecords
,
borrowRecord
)
}
else
{
preStatus
=
borrowRecord
.
Status
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusWarning
}
log
:=
action
.
GetFeedReceiptLog
(
coll
,
borrowRecord
,
preStatus
)
logs
=
append
(
logs
,
log
)
}
// 保存
coll
.
LatestLiquidationPrice
=
getLatestLiquidationPrice
(
coll
)
coll
.
LatestExpireTime
=
getLatestExpireTime
(
coll
)
collDB
.
Save
(
action
.
db
)
kv
=
append
(
kv
,
collDB
.
GetKVSet
()
...
)
...
...
@@ -760,6 +838,7 @@ func (action *Action) CollateralizeFeed(feed *pty.CollateralizeFeed) (*types.Rec
return
nil
,
types
.
ErrInvalidParam
}
// 是否后台管理用户
if
!
isRightPriceFeed
(
action
.
fromaddr
,
action
.
db
)
{
clog
.
Error
(
"CollateralizePriceFeed"
,
"addr"
,
action
.
fromaddr
,
"error"
,
"Address has no permission to feed price"
)
return
nil
,
pty
.
ErrPriceFeedPermissionDeny
...
...
@@ -784,7 +863,8 @@ func (action *Action) CollateralizeFeed(feed *pty.CollateralizeFeed) (*types.Rec
continue
}
if
coll
.
LatestLiquidationPrice
>=
price
{
// 系统清算判断
if
coll
.
LatestLiquidationPrice
*
PriceWarningRate
>=
price
{
receipt
,
err
:=
action
.
systemLiquidation
(
coll
,
price
)
if
err
!=
nil
{
clog
.
Error
(
"CollateralizePriceFeed"
,
"Collateralize ID"
,
coll
.
CollateralizeId
,
"system liquidation error"
,
err
)
...
...
@@ -793,6 +873,17 @@ func (action *Action) CollateralizeFeed(feed *pty.CollateralizeFeed) (*types.Rec
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
}
// 超时清算判断
if
coll
.
LatestExpireTime
-
ExpireWarningTime
<=
action
.
blocktime
{
receipt
,
err
:=
action
.
expireLiquidation
(
coll
)
if
err
!=
nil
{
clog
.
Error
(
"CollateralizePriceFeed"
,
"Collateralize ID"
,
coll
.
CollateralizeId
,
"expire liquidation error"
,
err
)
continue
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
}
}
var
priceRecord
pty
.
AssetPriceRecord
...
...
plugin/dapp/collateralize/executor/query.go
View file @
fd703948
...
...
@@ -21,7 +21,6 @@ func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInf
TotalBalance
:
coll
.
TotalBalance
,
DebtCeiling
:
coll
.
DebtCeiling
,
LiquidationRatio
:
coll
.
LiquidationRatio
,
LiquidationPenalty
:
coll
.
LiquidationPenalty
,
StabilityFee
:
coll
.
StabilityFee
,
CreateAddr
:
coll
.
CreateAddr
,
Balance
:
coll
.
Balance
,
...
...
@@ -42,7 +41,6 @@ func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeIn
TotalBalance
:
coll
.
TotalBalance
,
DebtCeiling
:
coll
.
DebtCeiling
,
LiquidationRatio
:
coll
.
LiquidationRatio
,
LiquidationPenalty
:
coll
.
LiquidationPenalty
,
StabilityFee
:
coll
.
StabilityFee
,
CreateAddr
:
coll
.
CreateAddr
,
Balance
:
coll
.
Balance
,
...
...
@@ -89,6 +87,7 @@ func (c *Collateralize) Query_CollateralizeBorrowInfoByAddr(req *pty.ReqCollater
return
nil
,
err
}
ret
:=
&
pty
.
RepCollateralizeBorrowInfos
{}
for
_
,
record
:=
range
records
{
if
record
.
CollateralizeId
==
req
.
CollateralizeId
{
coll
,
err
:=
queryCollateralizeByID
(
c
.
GetStateDB
(),
record
.
CollateralizeId
)
...
...
@@ -99,9 +98,13 @@ func (c *Collateralize) Query_CollateralizeBorrowInfoByAddr(req *pty.ReqCollater
for
_
,
borrowRecord
:=
range
coll
.
BorrowRecords
{
if
borrowRecord
.
AccountAddr
==
req
.
Addr
{
ret
:=
&
pty
.
RepCollateralizeBorrowInfo
{}
ret
.
Record
=
borrowRecord
return
ret
,
nil
ret
.
Record
=
append
(
ret
.
Record
,
borrowRecord
)
}
}
for
_
,
borrowRecord
:=
range
coll
.
InvalidRecords
{
if
borrowRecord
.
AccountAddr
==
req
.
Addr
{
ret
.
Record
=
append
(
ret
.
Record
,
borrowRecord
)
}
}
}
...
...
@@ -130,6 +133,12 @@ func (c *Collateralize) Query_CollateralizeBorrowInfoByStatus(req *pty.ReqCollat
ret
.
Record
=
append
(
ret
.
Record
,
borrowRecord
)
}
}
for
_
,
borrowRecord
:=
range
coll
.
InvalidRecords
{
if
borrowRecord
.
Status
==
req
.
Status
{
ret
.
Record
=
append
(
ret
.
Record
,
borrowRecord
)
}
}
}
return
ret
,
nil
...
...
plugin/dapp/collateralize/proto/collateralize.proto
View file @
fd703948
...
...
@@ -4,18 +4,20 @@ package types;
// 借贷信息
message
Collateralize
{
string
collateralizeId
=
1
;
//借贷ID,一期借贷对应一个ID
int64
totalBalance
=
2
;
//当期可借贷的总金额(ccny)
int64
debtCeiling
=
3
;
//单用户可借出的限额(ccny)
float
liquidationRatio
=
4
;
//清算比例
int64
stabilityFee
=
5
;
//稳定费
int64
liquidationPenalty
=
6
;
//清算罚金
string
createAddr
=
7
;
//创建人地址
int64
balance
=
8
;
//剩余可借贷金额(ccny)
repeated
BorrowRecord
borrowRecords
=
9
;
//借贷记录
int32
status
=
10
;
//当期借贷的状态,是否关闭
int32
collType
=
11
;
//质押资产类型(1,bty,2,btc,3,eth...)
float
latestLiquidationPrice
=
12
;
//最大清算价格
string
collateralizeId
=
1
;
//借贷ID,一期借贷对应一个ID
int64
totalBalance
=
2
;
//当期可借贷的总金额(ccny)
int64
debtCeiling
=
3
;
//单用户可借出的限额(ccny)
float
liquidationRatio
=
4
;
//清算比例
int64
stabilityFee
=
5
;
//稳定费
string
createAddr
=
6
;
//创建人地址
int64
balance
=
7
;
//剩余可借贷金额(ccny)
repeated
BorrowRecord
borrowRecords
=
8
;
//借贷记录
repeated
BorrowRecord
InvalidRecords
=
9
;
//失效的借贷记录
int32
status
=
10
;
//当期借贷的状态,是否关闭
int32
collType
=
11
;
//质押资产类型(1,bty,2,btc,3,eth...)
float
latestLiquidationPrice
=
12
;
//最高清算价格
int64
period
=
13
;
//借贷最大期限
int64
latestExpireTime
=
14
;
//最近超期时间
}
// 借出记录
...
...
@@ -28,6 +30,7 @@ message BorrowRecord {
float
liquidationPrice
=
6
;
//抵押物清算价格
int32
status
=
7
;
//抵押状态,是否被清算
int64
liquidateTime
=
8
;
//清算时间
int64
expireTime
=
9
;
//超时清算时间
}
// 资产价格记录
...
...
@@ -57,8 +60,7 @@ message CollateralizeCreate {
int64
debtCeiling
=
1
;
//单用户可借出的限额(ccny)
float
liquidationRatio
=
2
;
//清算比例
int64
stabilityFee
=
3
;
//稳定费
int64
liquidationPenalty
=
4
;
//清算罚金
int64
totalBalance
=
5
;
//可借贷总金额
int64
totalBalance
=
4
;
//可借贷总金额
}
// 质押借出
...
...
@@ -162,11 +164,6 @@ message ReqCollateralizeBorrowInfoByAddr {
string
addr
=
2
;
}
// 返回借贷记录
message
RepCollateralizeBorrowInfo
{
BorrowRecord
record
=
1
;
}
// 根据状态和借贷ID混合查询具体借贷记录
message
ReqCollateralizeBorrowInfoByStatus
{
string
collateralizeId
=
1
;
...
...
plugin/dapp/collateralize/types/collateralize.go
View file @
fd703948
...
...
@@ -137,7 +137,6 @@ func CreateRawCollateralizeCreateTx(parm *CollateralizeCreateTx) (*types.Transac
DebtCeiling
:
parm
.
DebtCeiling
,
LiquidationRatio
:
parm
.
LiquidationRatio
,
StabilityFee
:
parm
.
StabilityFee
,
LiquidationPenalty
:
parm
.
LiquidationPenalty
,
TotalBalance
:
parm
.
TotalBalance
,
}
create
:=
&
CollateralizeAction
{
...
...
plugin/dapp/collateralize/types/collateralize.pb.go
View file @
fd703948
...
...
@@ -27,13 +27,15 @@ type Collateralize struct {
DebtCeiling
int64
`protobuf:"varint,3,opt,name=debtCeiling,proto3" json:"debtCeiling,omitempty"`
LiquidationRatio
float32
`protobuf:"fixed32,4,opt,name=liquidationRatio,proto3" json:"liquidationRatio,omitempty"`
StabilityFee
int64
`protobuf:"varint,5,opt,name=stabilityFee,proto3" json:"stabilityFee,omitempty"`
LiquidationPenalty
int64
`protobuf:"varint,6,opt,name=liquidationPenalty,proto3" json:"liquidationPenalty
,omitempty"`
CreateAddr
string
`protobuf:"bytes,7,opt,name=createAddr,proto3" json:"createAddr
,omitempty"`
B
alance
int64
`protobuf:"varint,8,opt,name=balance,proto3" json:"balance
,omitempty"`
BorrowRecords
[]
*
BorrowRecord
`protobuf:"bytes,9,rep,name=borrowRecords,proto3" json:"borrow
Records,omitempty"`
CreateAddr
string
`protobuf:"bytes,6,opt,name=createAddr,proto3" json:"createAddr
,omitempty"`
Balance
int64
`protobuf:"varint,7,opt,name=balance,proto3" json:"balance
,omitempty"`
B
orrowRecords
[]
*
BorrowRecord
`protobuf:"bytes,8,rep,name=borrowRecords,proto3" json:"borrowRecords
,omitempty"`
InvalidRecords
[]
*
BorrowRecord
`protobuf:"bytes,9,rep,name=InvalidRecords,proto3" json:"Invalid
Records,omitempty"`
Status
int32
`protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"`
CollType
int32
`protobuf:"varint,11,opt,name=collType,proto3" json:"collType,omitempty"`
LatestLiquidationPrice
float32
`protobuf:"fixed32,12,opt,name=latestLiquidationPrice,proto3" json:"latestLiquidationPrice,omitempty"`
Period
int64
`protobuf:"varint,13,opt,name=period,proto3" json:"period,omitempty"`
LatestExpireTime
int64
`protobuf:"varint,14,opt,name=latestExpireTime,proto3" json:"latestExpireTime,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -99,13 +101,6 @@ func (m *Collateralize) GetStabilityFee() int64 {
return
0
}
func
(
m
*
Collateralize
)
GetLiquidationPenalty
()
int64
{
if
m
!=
nil
{
return
m
.
LiquidationPenalty
}
return
0
}
func
(
m
*
Collateralize
)
GetCreateAddr
()
string
{
if
m
!=
nil
{
return
m
.
CreateAddr
...
...
@@ -127,6 +122,13 @@ func (m *Collateralize) GetBorrowRecords() []*BorrowRecord {
return
nil
}
func
(
m
*
Collateralize
)
GetInvalidRecords
()
[]
*
BorrowRecord
{
if
m
!=
nil
{
return
m
.
InvalidRecords
}
return
nil
}
func
(
m
*
Collateralize
)
GetStatus
()
int32
{
if
m
!=
nil
{
return
m
.
Status
...
...
@@ -148,6 +150,20 @@ func (m *Collateralize) GetLatestLiquidationPrice() float32 {
return
0
}
func
(
m
*
Collateralize
)
GetPeriod
()
int64
{
if
m
!=
nil
{
return
m
.
Period
}
return
0
}
func
(
m
*
Collateralize
)
GetLatestExpireTime
()
int64
{
if
m
!=
nil
{
return
m
.
LatestExpireTime
}
return
0
}
// 借出记录
type
BorrowRecord
struct
{
AccountAddr
string
`protobuf:"bytes,1,opt,name=accountAddr,proto3" json:"accountAddr,omitempty"`
...
...
@@ -158,6 +174,7 @@ type BorrowRecord struct {
LiquidationPrice
float32
`protobuf:"fixed32,6,opt,name=liquidationPrice,proto3" json:"liquidationPrice,omitempty"`
Status
int32
`protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"`
LiquidateTime
int64
`protobuf:"varint,8,opt,name=liquidateTime,proto3" json:"liquidateTime,omitempty"`
ExpireTime
int64
`protobuf:"varint,9,opt,name=expireTime,proto3" json:"expireTime,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -244,6 +261,13 @@ func (m *BorrowRecord) GetLiquidateTime() int64 {
return
0
}
func
(
m
*
BorrowRecord
)
GetExpireTime
()
int64
{
if
m
!=
nil
{
return
m
.
ExpireTime
}
return
0
}
// 资产价格记录
type
AssetPriceRecord
struct
{
RecordTime
int64
`protobuf:"varint,1,opt,name=recordTime,proto3" json:"recordTime,omitempty"`
...
...
@@ -470,8 +494,7 @@ type CollateralizeCreate struct {
DebtCeiling
int64
`protobuf:"varint,1,opt,name=debtCeiling,proto3" json:"debtCeiling,omitempty"`
LiquidationRatio
float32
`protobuf:"fixed32,2,opt,name=liquidationRatio,proto3" json:"liquidationRatio,omitempty"`
StabilityFee
int64
`protobuf:"varint,3,opt,name=stabilityFee,proto3" json:"stabilityFee,omitempty"`
LiquidationPenalty
int64
`protobuf:"varint,4,opt,name=liquidationPenalty,proto3" json:"liquidationPenalty,omitempty"`
TotalBalance
int64
`protobuf:"varint,5,opt,name=totalBalance,proto3" json:"totalBalance,omitempty"`
TotalBalance
int64
`protobuf:"varint,4,opt,name=totalBalance,proto3" json:"totalBalance,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -523,13 +546,6 @@ func (m *CollateralizeCreate) GetStabilityFee() int64 {
return
0
}
func
(
m
*
CollateralizeCreate
)
GetLiquidationPenalty
()
int64
{
if
m
!=
nil
{
return
m
.
LiquidationPenalty
}
return
0
}
func
(
m
*
CollateralizeCreate
)
GetTotalBalance
()
int64
{
if
m
!=
nil
{
return
m
.
TotalBalance
...
...
@@ -1345,47 +1361,7 @@ func (m *ReqCollateralizeBorrowInfoByAddr) GetAddr() string {
return
""
}
// 返回借贷记录
type
RepCollateralizeBorrowInfo
struct
{
Record
*
BorrowRecord
`protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
}
func
(
m
*
RepCollateralizeBorrowInfo
)
Reset
()
{
*
m
=
RepCollateralizeBorrowInfo
{}
}
func
(
m
*
RepCollateralizeBorrowInfo
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
RepCollateralizeBorrowInfo
)
ProtoMessage
()
{}
func
(
*
RepCollateralizeBorrowInfo
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_a988fb4a61381972
,
[]
int
{
21
}
}
func
(
m
*
RepCollateralizeBorrowInfo
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_RepCollateralizeBorrowInfo
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
RepCollateralizeBorrowInfo
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_RepCollateralizeBorrowInfo
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
RepCollateralizeBorrowInfo
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_RepCollateralizeBorrowInfo
.
Merge
(
m
,
src
)
}
func
(
m
*
RepCollateralizeBorrowInfo
)
XXX_Size
()
int
{
return
xxx_messageInfo_RepCollateralizeBorrowInfo
.
Size
(
m
)
}
func
(
m
*
RepCollateralizeBorrowInfo
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_RepCollateralizeBorrowInfo
.
DiscardUnknown
(
m
)
}
var
xxx_messageInfo_RepCollateralizeBorrowInfo
proto
.
InternalMessageInfo
func
(
m
*
RepCollateralizeBorrowInfo
)
GetRecord
()
*
BorrowRecord
{
if
m
!=
nil
{
return
m
.
Record
}
return
nil
}
// 根据地址和借贷ID混合查询具体借贷记录
// 根据状态和借贷ID混合查询具体借贷记录
type
ReqCollateralizeBorrowInfoByStatus
struct
{
CollateralizeId
string
`protobuf:"bytes,1,opt,name=collateralizeId,proto3" json:"collateralizeId,omitempty"`
Status
int32
`protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
...
...
@@ -1398,7 +1374,7 @@ func (m *ReqCollateralizeBorrowInfoByStatus) Reset() { *m = ReqCollatera
func
(
m
*
ReqCollateralizeBorrowInfoByStatus
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ReqCollateralizeBorrowInfoByStatus
)
ProtoMessage
()
{}
func
(
*
ReqCollateralizeBorrowInfoByStatus
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_a988fb4a61381972
,
[]
int
{
2
2
}
return
fileDescriptor_a988fb4a61381972
,
[]
int
{
2
1
}
}
func
(
m
*
ReqCollateralizeBorrowInfoByStatus
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
...
@@ -1445,7 +1421,7 @@ func (m *RepCollateralizeBorrowInfos) Reset() { *m = RepCollateralizeBor
func
(
m
*
RepCollateralizeBorrowInfos
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
RepCollateralizeBorrowInfos
)
ProtoMessage
()
{}
func
(
*
RepCollateralizeBorrowInfos
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_a988fb4a61381972
,
[]
int
{
2
3
}
return
fileDescriptor_a988fb4a61381972
,
[]
int
{
2
2
}
}
func
(
m
*
RepCollateralizeBorrowInfos
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
...
@@ -1495,7 +1471,6 @@ func init() {
proto
.
RegisterType
((
*
ReqCollateralizeByAddr
)(
nil
),
"types.ReqCollateralizeByAddr"
)
proto
.
RegisterType
((
*
RepCollateralizeIDs
)(
nil
),
"types.RepCollateralizeIDs"
)
proto
.
RegisterType
((
*
ReqCollateralizeBorrowInfoByAddr
)(
nil
),
"types.ReqCollateralizeBorrowInfoByAddr"
)
proto
.
RegisterType
((
*
RepCollateralizeBorrowInfo
)(
nil
),
"types.RepCollateralizeBorrowInfo"
)
proto
.
RegisterType
((
*
ReqCollateralizeBorrowInfoByStatus
)(
nil
),
"types.ReqCollateralizeBorrowInfoByStatus"
)
proto
.
RegisterType
((
*
RepCollateralizeBorrowInfos
)(
nil
),
"types.RepCollateralizeBorrowInfos"
)
}
...
...
@@ -1503,67 +1478,70 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"collateralize.proto"
,
fileDescriptor_a988fb4a61381972
)
}
var
fileDescriptor_a988fb4a61381972
=
[]
byte
{
// 990 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xe4
,
0x57
,
0xcd
,
0x6e
,
0xe4
,
0x44
,
0x10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xba
,
0x0d
,
0xd6
,
0xae
,
0x81
,
0xf5
,
0x57
,
0xdd
,
0x57
,
0xd7
,
0xc4
,
0x29
,
0x8d
,
0x9c
,
0xbd
,
0xff
,
0xc8
,
0x79
,
0x33
,
0xc2
,
0xff
,
0xbe
,
0x3e
,
0xf9
,
0x37
,
0x00
,
0x00
,
0xff
,
0xff
,
0x40
,
0x4f
,
0xe4
,
0x50
,
0x94
,
0x0d
,
0x00
,
0x00
,
// 1037 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xcc
,
0x57
,
0xdd
,
0x6e
,
0xe3
,
0x44
,
0x14
,
0x5e
,
0xdb
,
0xf9
,
0x69
,
0x4e
,
0xb6
,
0xa5
,
0x4c
,
0x4b
,
0x65
,
0x4a
,
0xb5
,
0x8a
,
0x46
,
0x48
,
0x44
,
0x80
,
0x22
,
0x11
,
0x56
,
0x08
,
0x84
,
0x84
,
0x68
,
0xb3
,
0xac
,
0x36
,
0x68
,
0x2f
,
0x90
,
0xb7
,
0x20
,
0x6e
,
0x90
,
0x70
,
0xec
,
0x29
,
0x58
,
0xf2
,
0xda
,
0xde
,
0xf1
,
0xa4
,
0xac
,
0x79
,
0x25
,
0xb8
,
0xe1
,
0x82
,
0x97
,
0xe0
,
0x41
,
0x78
,
0x00
,
0x9e
,
0x00
,
0xcd
,
0x99
,
0x49
,
0xec
,
0x19
,
0x3b
,
0x55
,
0x96
,
0xbd
,
0xe1
,
0x26
,
0xf2
,
0x9c
,
0x9f
,
0x39
,
0xe7
,
0x7c
,
0xe7
,
0x9b
,
0x33
,
0x13
,
0x38
,
0x89
,
0xf2
,
0x34
,
0x0d
,
0x05
,
0xe3
,
0x61
,
0x9a
,
0xfc
,
0xca
,
0x66
,
0x05
,
0xcf
,
0x45
,
0x4e
,
0xfa
,
0xa2
,
0x2a
,
0x58
,
0x49
,
0xff
,
0xe8
,
0xc1
,
0xe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
,
0x61
,
0xac
,
0x3a
,
0x3a
,
0x0a
,
0x5a
,
0x72
,
0xfa
,
0x3d
,
0x5c
,
0xdc
,
0x81
,
0x7d
,
0x49
,
0x3e
,
0x95
,
0x14
,
0xba
,
0xc9
,
0x37
,
0x94
,
0xa0
,
0x9a
,
0x12
,
0x77
,
0xf8
,
0x04
,
0xca
,
0x81
,
0xce
,
0xc1
,
0xb7
,
0xd3
,
0xbb
,
0xaa
,
0xf4
,
0x39
,
0xd9
,
0xd1
,
0x52
,
0xfa
,
0x21
,
0x9c
,
0xb5
,
0x7d
,
0x10
,
0x86
,
0x0d
,
0xbd
,
0x9d
,
0x9a
,
0xde
,
0xf4
,
0x3d
,
0x38
,
0xb1
,
0xf3
,
0x58
,
0x3e
,
0x2a
,
0xc9
,
0x31
,
0x78
,
0xcb
,
0x47
,
0x9b
,
0x8a
,
0xe5
,
0x27
,
0xfd
,
0x11
,
0x26
,
0xad
,
0x6d
,
0xf1
,
0x2e
,
0x90
,
0xf9
,
0xea
,
0x00
,
0xaf
,
0x75
,
0xd2
,
0xe8
,
0x0d
,
0xd0
,
0xbb
,
0x22
,
0xe8
,
0xb2
,
0xf7
,
0x8f
,
0x51
,
0x03
,
0xe4
,
0x1a
,
0x00
,
0x7d
,
0xdd
,
0x3e
,
0x2a
,
0x75
,
0x9c
,
0x92
,
0x7c
,
0x00
,
0x03
,
0x75
,
0x2e
,
0x75
,
0xbb
,
0x3a
,
0x5f
,
0xfa
,
0xda
,
0x64
,
0x35
,
0xc0
,
0xff
,
0x5c
,
0x1f
,
0xff
,
0x1b
,
0x00
,
0x00
,
0xff
,
0xff
,
0xbb
,
0xc2
,
0xae
,
0xcc
,
0x8a
,
0x0d
,
0x00
,
0x00
,
}
plugin/dapp/collateralize/types/tx.go
View file @
fd703948
...
...
@@ -9,7 +9,6 @@ type CollateralizeCreateTx struct {
DebtCeiling
int64
`json:"debtCeiling"`
LiquidationRatio
float32
`json:"liquidationRatio"`
StabilityFee
int64
`json:"stabilityFee"`
LiquidationPenalty
int64
`json:"liquidationPenalty"`
TotalBalance
int64
`json:"totalBalance"`
Fee
int64
`json:"fee"`
}
...
...
@@ -37,7 +36,7 @@ type CollateralizeAppendTx struct {
// CollateralizeFeedTx for construction
type
CollateralizeFeedTx
struct
{
Price
[]
int64
`json:"price"`
Price
[]
float32
`json:"price"`
Volume
[]
int64
`json:"volume"`
Fee
int64
`json:"fee"`
}
...
...
plugin/dapp/collateralize/types/types.go
View file @
fd703948
...
...
@@ -45,5 +45,6 @@ const (
CollateralizeUserStatusCreate
=
1
+
iota
CollateralizeUserStatusWarning
CollateralizeUserStatusSystemLiquidate
CollateralizeUserStatusExpire
CollateralizeUserStatusClose
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment