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
5f334a26
Commit
5f334a26
authored
Dec 24, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
38119f4b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
collateralizedb.go
plugin/dapp/collateralize/executor/collateralizedb.go
+3
-3
collateralize.go
plugin/dapp/collateralize/types/collateralize.go
+2
-2
collateralize.pb.go
plugin/dapp/collateralize/types/collateralize.pb.go
+0
-0
issuancedb.go
plugin/dapp/issuance/executor/issuancedb.go
+1
-1
issuance.go
plugin/dapp/issuance/types/issuance.go
+1
-1
issuance.pb.go
plugin/dapp/issuance/types/issuance.pb.go
+0
-0
No files found.
plugin/dapp/collateralize/executor/collateralizedb.go
View file @
5f334a26
...
...
@@ -475,7 +475,7 @@ func getBtyNumToFrozen(value int64, price int64, ratio int64) (int64, error) {
// 计算清算价格
// value:借出ccny数量, colValue:抵押物数量, price:抵押物价格
func
calcLiquidationPrice
(
value
int64
,
colValue
int64
)
int64
{
return
(
value
*
pty
.
CollateralizePreLiquidationRatio
)
/
colValue
return
(
value
*
pty
.
CollateralizePreLiquidationRatio
)
/
colValue
}
// 获取最近抵押物价格
...
...
@@ -615,7 +615,7 @@ func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*typ
borrowRecord
.
StartTime
=
action
.
blocktime
borrowRecord
.
CollateralPrice
=
lastPrice
borrowRecord
.
DebtValue
=
borrow
.
GetValue
()
borrowRecord
.
LiquidationPrice
=
(
coll
.
LiquidationRatio
*
lastPrice
*
pty
.
CollateralizePreLiquidationRatio
)
/
1e8
borrowRecord
.
LiquidationPrice
=
(
coll
.
LiquidationRatio
*
lastPrice
*
pty
.
CollateralizePreLiquidationRatio
)
/
1e8
borrowRecord
.
Status
=
pty
.
CollateralizeUserStatusCreate
borrowRecord
.
ExpireTime
=
action
.
blocktime
+
coll
.
Period
...
...
@@ -678,7 +678,7 @@ func (action *Action) CollateralizeRepay(repay *pty.CollateralizeRepay) (*types.
}
// 借贷金额+利息
fee
:=
(
borrowRecord
.
DebtValue
*
coll
.
StabilityFeeRatio
)
/
1e4
fee
:=
(
borrowRecord
.
DebtValue
*
coll
.
StabilityFeeRatio
)
/
1e4
realRepay
:=
borrowRecord
.
DebtValue
+
fee
// 检查
...
...
plugin/dapp/collateralize/types/collateralize.go
View file @
5f334a26
...
...
@@ -334,8 +334,8 @@ func CreateRawCollateralizeManageTx(cfg *types.Chain33Config, parm *Collateraliz
v
:=
&
CollateralizeManage
{
DebtCeiling
:
int64
(
math
.
Trunc
((
parm
.
DebtCeiling
+
0.0000001
)
*
1e4
))
*
1e4
,
LiquidationRatio
:
int64
(
math
.
Trunc
((
parm
.
LiquidationRatio
+
0.0000001
)
*
1e4
)),
StabilityFeeRatio
:
int64
(
math
.
Trunc
((
parm
.
StabilityFeeRatio
+
0.0000001
)
*
1e4
)),
LiquidationRatio
:
int64
(
math
.
Trunc
((
parm
.
LiquidationRatio
+
0.0000001
)
*
1e4
)),
StabilityFeeRatio
:
int64
(
math
.
Trunc
((
parm
.
StabilityFeeRatio
+
0.0000001
)
*
1e4
)),
Period
:
parm
.
Period
,
TotalBalance
:
int64
(
math
.
Trunc
((
parm
.
TotalBalance
+
0.0000001
)
*
1e4
))
*
1e4
,
}
...
...
plugin/dapp/collateralize/types/collateralize.pb.go
View file @
5f334a26
This diff is collapsed.
Click to expand it.
plugin/dapp/issuance/executor/issuancedb.go
View file @
5f334a26
...
...
@@ -581,7 +581,7 @@ func (action *Action) IssuanceDebt(debt *pty.IssuanceDebt) (*types.Receipt, erro
debtRecord
.
StartTime
=
action
.
blocktime
debtRecord
.
CollateralPrice
=
lastPrice
debtRecord
.
DebtValue
=
debt
.
Value
debtRecord
.
LiquidationPrice
=
(
issu
.
LiquidationRatio
*
lastPrice
*
pty
.
IssuancePreLiquidationRatio
)
/
1e8
debtRecord
.
LiquidationPrice
=
(
issu
.
LiquidationRatio
*
lastPrice
*
pty
.
IssuancePreLiquidationRatio
)
/
1e8
debtRecord
.
Status
=
pty
.
IssuanceUserStatusCreate
debtRecord
.
ExpireTime
=
action
.
blocktime
+
issu
.
Period
...
...
plugin/dapp/issuance/types/issuance.go
View file @
5f334a26
...
...
@@ -146,7 +146,7 @@ func CreateRawIssuanceCreateTx(cfg *types.Chain33Config, parm *IssuanceCreateTx)
v
:=
&
IssuanceCreate
{
TotalBalance
:
int64
(
math
.
Trunc
((
parm
.
TotalBalance
+
0.0000001
)
*
1e4
))
*
1e4
,
DebtCeiling
:
int64
(
math
.
Trunc
((
parm
.
DebtCeiling
+
0.0000001
)
*
1e4
))
*
1e4
,
LiquidationRatio
:
int64
(
math
.
Trunc
((
parm
.
LiquidationRatio
+
0.0000001
)
*
1e4
)),
LiquidationRatio
:
int64
(
math
.
Trunc
((
parm
.
LiquidationRatio
+
0.0000001
)
*
1e4
)),
Period
:
parm
.
Period
,
}
create
:=
&
IssuanceAction
{
...
...
plugin/dapp/issuance/types/issuance.pb.go
View file @
5f334a26
This diff is collapsed.
Click to expand it.
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