Skip to content

Commit 735c8f4

Browse files
committed
Decrease error threshold for validateCurrencyLaunchpadClientExchangeData
1 parent 59992ec commit 735c8f4

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
@@ -161,15 +161,15 @@ func validateCurrencyLaunchpadClientExchangeData(ctx context.Context, data code_
161161
coreMintSellValueInUnits := float64(coreMintSellValueInQuarks) / float64(coreMintQuarksPerUnit)
162162
potentialNativeAmount := otherExchangeRateRecord.Rate * coreMintSellValueInUnits / usdExchangeRateRecord.Rate
163163
percentDiff := math.Abs(proto.NativeAmount-potentialNativeAmount) / potentialNativeAmount
164-
if percentDiff > 0.001 {
164+
if percentDiff > 0.0001 {
165165
continue
166166
}
167167

168168
// For the valid native amount, is the exchange rate calculated correctly?
169169
otherMintUnits := float64(proto.Quarks) / float64(otherMintQuarksPerUnit)
170170
expectedRate := potentialNativeAmount / otherMintUnits
171171
percentDiff = math.Abs(proto.ExchangeRate-expectedRate) / expectedRate
172-
if percentDiff > 0.001 {
172+
if percentDiff > 0.0001 {
173173
continue
174174
}
175175

0 commit comments

Comments
 (0)