Skip to content

Commit

Permalink
add logging to tbs for volume liquidity ratio.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Aug 21, 2023
1 parent f19ab59 commit 129116f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/services/tradesBlockService/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/diadata-org/diadata/services/tradesBlockService
go 1.17

require (
github.com/diadata-org/diadata v1.4.329-rc-1
github.com/diadata-org/diadata v1.4.329-rc-2
github.com/segmentio/kafka-go v0.4.35
github.com/sirupsen/logrus v1.8.1
)
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/tradesBlockService/tradesBlockService.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func NewTradesBlockService(datastore models.Datastore, relDB models.RelDatastore
log.Info("normalX: ", normalX)
log.Info("tradeVolumeThreshold: ", tradeVolumeThreshold)
log.Info("tradeVolumeThresholdUSD: ", tradeVolumeThresholdUSD)
log.Info("volumeLiquidityRatio: ", volumeLiquidityRatio)

var err error
s.volumeCache, err = s.relDB.GetVolumesMap(time.Now().AddDate(0, 0, -7))
Expand Down Expand Up @@ -260,6 +261,7 @@ func (s *TradesBlockService) checkTrade(t dia.Trade) bool {
if err == nil {
liquidity, lowerBound := pool.GetPoolLiquidityUSD()
if quoteVolumeOk && !lowerBound && quoteVolume > volumeLiquidityRatio*liquidity {
log.Warn("discard trade due to volumeLiquidityRatio: ", t)
return false
}
}
Expand Down

0 comments on commit 129116f

Please sign in to comment.