Skip to content

Commit e49fc82

Browse files
authored
Merge pull request #176 from ProofSuite/v1.0.0
fix trading stats bug
2 parents aec94f5 + fbd940d commit e49fc82

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

services/info.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ func (s *InfoService) GetExchangeStats() (*types.ExchangeStats, error) {
215215
mostTradedPair, _ := utils.MaxIntMap(pairTradeCounts)
216216
totalOrders = totalSellOrders + totalBuyOrders
217217
totalOrderAmount := totalBuyOrderAmount + totalSellOrderAmount
218-
tradeSuccessRatio := float64(totalTrades-erroredTradeCount) / float64(totalTrades)
218+
219+
tradeSuccessRatio := float64(1)
220+
if totalTrades > 0 {
221+
tradeSuccessRatio = float64(totalTrades-erroredTradeCount) / float64(totalTrades)
222+
}
219223

220224
stats := &types.ExchangeStats{
221225
TotalOrders: totalOrders,

tmp/runner-build

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)