@gearbox-protocol/sdk 8.2.0 → 8.2.1
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.
|
@@ -204,6 +204,12 @@ class RouterV300Contract extends import_AbstractRouterContract.AbstractRouterCon
|
|
|
204
204
|
leftover,
|
|
205
205
|
connectors
|
|
206
206
|
});
|
|
207
|
+
const force = ca.tokens.some(
|
|
208
|
+
(b) => b.token.toLowerCase() === import_sdk_gov_legacy.tokenDataByNetwork.Mainnet.stkcvxRLUSDUSDC.toLowerCase() && b.balance > 10n
|
|
209
|
+
);
|
|
210
|
+
if (force) {
|
|
211
|
+
this.logger?.warn("applying stkcvxRLUSDUSDC workaround");
|
|
212
|
+
}
|
|
207
213
|
let results = [];
|
|
208
214
|
for (const po of pathOptions) {
|
|
209
215
|
const { result: result2 } = await this.contract.simulate.findBestClosePath(
|
|
@@ -215,7 +221,7 @@ class RouterV300Contract extends import_AbstractRouterContract.AbstractRouterCon
|
|
|
215
221
|
BigInt(slippage),
|
|
216
222
|
po,
|
|
217
223
|
BigInt(LOOPS_PER_TX),
|
|
218
|
-
|
|
224
|
+
force
|
|
219
225
|
],
|
|
220
226
|
{
|
|
221
227
|
gas: GAS_PER_BLOCK
|
|
@@ -2,7 +2,7 @@ import { encodeFunctionData, getContract } from "viem";
|
|
|
2
2
|
import { iRouterV300Abi, iSwapperV300Abi } from "../../abi/routerV300.js";
|
|
3
3
|
import { iCreditFacadeV300MulticallAbi } from "../../abi/v300.js";
|
|
4
4
|
import { PERCENTAGE_FACTOR } from "../constants/index.js";
|
|
5
|
-
import { getConnectors } from "../sdk-gov-legacy/index.js";
|
|
5
|
+
import { getConnectors, tokenDataByNetwork } from "../sdk-gov-legacy/index.js";
|
|
6
6
|
import { AbstractRouterContract } from "./AbstractRouterContract.js";
|
|
7
7
|
import { assetsMap, balancesMap, compareRouterResults } from "./helpers.js";
|
|
8
8
|
import { PathOptionFactory } from "./PathOptionFactory.js";
|
|
@@ -181,6 +181,12 @@ class RouterV300Contract extends AbstractRouterContract {
|
|
|
181
181
|
leftover,
|
|
182
182
|
connectors
|
|
183
183
|
});
|
|
184
|
+
const force = ca.tokens.some(
|
|
185
|
+
(b) => b.token.toLowerCase() === tokenDataByNetwork.Mainnet.stkcvxRLUSDUSDC.toLowerCase() && b.balance > 10n
|
|
186
|
+
);
|
|
187
|
+
if (force) {
|
|
188
|
+
this.logger?.warn("applying stkcvxRLUSDUSDC workaround");
|
|
189
|
+
}
|
|
184
190
|
let results = [];
|
|
185
191
|
for (const po of pathOptions) {
|
|
186
192
|
const { result: result2 } = await this.contract.simulate.findBestClosePath(
|
|
@@ -192,7 +198,7 @@ class RouterV300Contract extends AbstractRouterContract {
|
|
|
192
198
|
BigInt(slippage),
|
|
193
199
|
po,
|
|
194
200
|
BigInt(LOOPS_PER_TX),
|
|
195
|
-
|
|
201
|
+
force
|
|
196
202
|
],
|
|
197
203
|
{
|
|
198
204
|
gas: GAS_PER_BLOCK
|