Skip to content

Commit

Permalink
Fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyvega committed May 15, 2021
1 parent 5c2ab06 commit c9f7146
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bot/normal/normal.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,17 @@ func (b *Bot) checkInitialMargin() error {
avail := int64(float64(b.balanceGeneral) * b.strategy.OrdersFraction)
cost := int64(float64(shapeMarginCost))
if avail < cost {
var missing_percent string
var missingPercent string
if avail == 0 {
missing_percent = "Inf"
missingPercent = "Inf"
} else {
missing_percent = fmt.Sprintf("%.2f%%", float32((cost-avail)*100)/float32(avail))
missingPercent = fmt.Sprintf("%.2f%%", float32((cost-avail)*100)/float32(avail))
}
b.log.WithFields(log.Fields{
"available": avail,
"cost": cost,
"missing": avail - cost,
"missing_percent": missing_percent,
"available": avail,
"cost": cost,
"missing": avail - cost,
"missingPercent": missingPercent,
}).Error("Not enough collateral to safely keep orders up given current price, risk parameters and supplied default shapes.")
return errors.New("not enough collateral")
}
Expand Down

0 comments on commit c9f7146

Please sign in to comment.