Skip to content

Commit 95ae4f8

Browse files
committed
Increase currency validation error threshold
1 parent 0fc29f3 commit 95ae4f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/code/currency/validation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ func validateCurrencyLaunchpadClientExchangeData(ctx context.Context, data code_
119119
coreMintSellValueInUnits := float64(coreMintSellValueInQuarks) / float64(coreMintQuarksPerUnit)
120120
potentialNativeAmount := otherExchangeRateRecord.Rate * coreMintSellValueInUnits / usdExchangeRateRecord.Rate
121121
percentDiff := math.Abs(proto.NativeAmount-potentialNativeAmount) / potentialNativeAmount
122-
if percentDiff > 0.0001 {
122+
if percentDiff > 0.001 {
123123
continue
124124
}
125125

126126
// For the valid native amount, is the exchange rate calculated correctly?
127127
otherMintUnits := float64(proto.Quarks) / float64(otherMintQuarksPerUnit)
128128
expectedRate := potentialNativeAmount / otherMintUnits
129129
percentDiff = math.Abs(proto.ExchangeRate-expectedRate) / expectedRate
130-
if percentDiff > 0.0001 {
130+
if percentDiff > 0.001 {
131131
continue
132132
}
133133

0 commit comments

Comments
 (0)