Skip to content

Commit

Permalink
fix: do not spam the DB
Browse files Browse the repository at this point in the history
  • Loading branch information
karlem committed Oct 16, 2023
1 parent 5949477 commit 960d44d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/execution/common/liquidity_provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ func (m *MarketLiquidity) OnEpochEnd(ctx context.Context, t time.Time) {
m.calculateAndDistribute(ctx, t)

// report liquidity fees allocation stats
m.broker.Send(events.NewPaidLiquidityFeesStatsEvent(ctx, m.liquidityEngine.PaidLiquidityFeesStats().ToProto(m.marketID, m.asset)))
feeStats := m.liquidityEngine.PaidLiquidityFeesStats()
if !feeStats.TotalFeesPaid.IsZero() {
m.broker.Send(events.NewPaidLiquidityFeesStatsEvent(ctx, feeStats.ToProto(m.marketID, m.asset)))
}
}

func (m *MarketLiquidity) OnMarketClosed(ctx context.Context, t time.Time) {
Expand Down

0 comments on commit 960d44d

Please sign in to comment.