We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 450274c commit c23a021Copy full SHA for c23a021
src/shared/post-processors/exchange-rates/price-routing-mainnet.ts
@@ -148,7 +148,7 @@ export const translateMainnetSymbol = (symbol: MainnetCurrency): MainnetCurrency
148
return symbol
149
}
150
151
-export const invertRate = (rate: bigint, decimals = 18) => 10n ** BigInt(2 * decimals) / rate
+export const invertRate = (rate: bigint, decimals = 18) => (rate > 0n ? 10n ** BigInt(2 * decimals) / rate : 0n)
152
export const twoWay = <Base extends CurrencySymbol, Quote extends CurrencySymbol>(
153
base: Base,
154
quote: Quote,
0 commit comments