From a63749cdaabf17b05affb1635d041b8ea6e80982 Mon Sep 17 00:00:00 2001 From: Starsquid <108214377+starsquidnodes@users.noreply.github.com> Date: Sun, 14 Apr 2024 10:21:15 +0200 Subject: [PATCH 1/2] Raise spread threshold --- oracle/provider/finv2.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/oracle/provider/finv2.go b/oracle/provider/finv2.go index 129b262..7b2a752 100644 --- a/oracle/provider/finv2.go +++ b/oracle/provider/finv2.go @@ -135,8 +135,12 @@ func (p *FinV2Provider) Poll() error { high = base } - if high.GT(low.Mul(floatToDec(1.05))) { - p.logger.Error().Msg("spread too large") + spread := high.Sub(low) + + if high.GT(low.Mul(floatToDec(1.1))) { + p.logger.Error(). + Str("spread", spread.String()). + Msg("spread too large") continue } From d0f0281d94a0a9b32aa667bde332dcefe8c94c73 Mon Sep 17 00:00:00 2001 From: Starsquid <108214377+starsquidnodes@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:11:48 +0200 Subject: [PATCH 2/2] Log spread percentage on error --- oracle/provider/finv2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oracle/provider/finv2.go b/oracle/provider/finv2.go index 7b2a752..2925026 100644 --- a/oracle/provider/finv2.go +++ b/oracle/provider/finv2.go @@ -135,11 +135,11 @@ func (p *FinV2Provider) Poll() error { high = base } - spread := high.Sub(low) - if high.GT(low.Mul(floatToDec(1.1))) { + spread := high.Sub(low).Quo(low) p.logger.Error(). Str("spread", spread.String()). + Str("symbol", symbol). Msg("spread too large") continue }