@guru-fund/sdk 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/router/index.js +4 -2
- package/package.json +1 -1
package/dist/router/index.js
CHANGED
|
@@ -131,8 +131,10 @@ async function _priceViaDirectStablePool(token, oneToken, poolHelper, stable, st
|
|
|
131
131
|
.catch(() => null);
|
|
132
132
|
if (!route)
|
|
133
133
|
return null;
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
const amountToReceive = BigInt(route.data.amountToReceive);
|
|
135
|
+
if (amountToReceive === 0n)
|
|
136
|
+
return null;
|
|
137
|
+
return (amountToReceive * 10n ** 18n) / Token.unitFor(stableDecimals);
|
|
136
138
|
}
|
|
137
139
|
async function _priceViaV4Pools(token, oneToken, getWethUsd, ctx) {
|
|
138
140
|
const addresses = getGuruProtocolAddresses(ctx.chainId);
|