Skip to content

Commit 818c6ec

Browse files
author
Jiri Malek
committed
Log every price check inside the oracle price feed.
1 parent aaa319a commit 818c6ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/modules/pricefeed/pricefeed.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ func (pro *PriceOracle) checkPrice() {
137137
// we always use positive delta percentage since we only need an absolute value
138138
var pct = 100.0
139139
if pro.currentPrice != 0 {
140-
pct = math.Abs(price-pro.currentPrice) / pro.currentPrice
140+
pct = (math.Abs(price-pro.currentPrice) / pro.currentPrice) * 100.0
141141
}
142142

143+
// log the status
144+
pro.sup.Log().Debugf("current price of %s is %0.8f (%0.4f%%)", pro.cfg.Symbol, price, pct)
145+
143146
// is the delta over the barrier
144147
if pct >= pro.cfg.WriteBarrierPct {
145148
// we are on a different price from now on

0 commit comments

Comments
 (0)