diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eda69a5..aba65f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - added: (LI.FI) Added unique parent contract addresses +- fixed: Division precision for Thorchain `toExchangeAmount` ## 2.8.1 (2024-10-02) diff --git a/src/swap/defi/thorchain/common.ts b/src/swap/defi/thorchain/common.ts index 980c1f98..ae213b1b 100644 --- a/src/swap/defi/thorchain/common.ts +++ b/src/swap/defi/thorchain/common.ts @@ -1,4 +1,4 @@ -import { add, div, gt, mul, round, sub } from 'biggystring' +import { add, gt, mul, round, sub } from 'biggystring' import { asArray, asBoolean, @@ -888,7 +888,7 @@ const calcSwapFrom = async ({ log(`toThorAmountWithSpread = limit: ${toThorAmountWithSpread}`) - const toExchangeAmount = div(toThorAmountWithSpread, THOR_LIMIT_UNITS) + const toExchangeAmount = div18(toThorAmountWithSpread, THOR_LIMIT_UNITS) log(`toExchangeAmount: ${toExchangeAmount}`) const toNativeAmountFloat = await toWallet.denominationToNative(