Reset all aggregation field so we don't double on reconfirmations

This commit is contained in:
Kevin Cotugno 2017-11-16 20:34:14 -08:00
parent c84c01f8d2
commit a7ef7fe697

View File

@ -2,6 +2,7 @@ package ops
import (
"github.com/kcotugno/tacitus"
"github.com/shopspring/decimal"
"sync"
"time"
@ -67,6 +68,10 @@ func (a *Aggregator) aggregate(product string, end time.Time, interval time.Dura
agg.Interval = int(interval.Seconds())
agg.Product = product
agg.Timestamp = end
agg.BuyVolume = decimal.Zero
agg.SellVolume = decimal.Zero
agg.BuyTransactions = 0
agg.SellTransactions = 0
for _, t := range trades {
agg.Price = t.Price