Skip to content

Commit 3f8787e

Browse files
committed
add exclude token filter; update config
1 parent 2f39921 commit 3f8787e

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

src/swapService/config/mainnet.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,6 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
4242
},
4343
match: { isPendlePT: true },
4444
},
45-
{
46-
strategy: StrategyBalmySDK.name(),
47-
config: {
48-
sourcesFilter: {
49-
includeSources: ["paraswap", "open-ocean", "li-fi", "odos", "1inch"],
50-
},
51-
tryExactOut: true,
52-
},
53-
match: {
54-
tokensInOrOut: [SUSDS_MAINNET],
55-
},
56-
},
57-
// Target debt RLP through Odos
58-
{
59-
strategy: StrategyBalmySDK.name(),
60-
config: {
61-
sourcesFilter: {
62-
includeSources: ["odos", "1inch"],
63-
},
64-
},
65-
match: {
66-
swapperModes: [SwapperMode.TARGET_DEBT],
67-
tokensInOrOut: [RLP_MAINNET],
68-
},
69-
},
70-
7145
// DEFAULTS
7246
{
7347
strategy: StrategyBalmySDK.name(),
@@ -92,6 +66,7 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
9266
strategy: StrategyCombinedUniswap.name(),
9367
match: {
9468
swapperModes: [SwapperMode.TARGET_DEBT],
69+
excludeTokensInOrOut: [RLP_MAINNET, SUSDS_MAINNET],
9570
},
9671
},
9772
// FALLBACKS

src/swapService/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface StrategyMatchConfig {
7070
isRepay?: boolean
7171
isPendlePT?: boolean
7272
tokensInOrOut?: Address[]
73+
excludeTokensInOrOut?: Address[]
7374
}
7475

7576
export interface RoutingItem {

src/swapService/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ export function matchParams(
6262
)
6363
return false
6464
}
65+
if (match.excludeTokensInOrOut) {
66+
if (
67+
match.excludeTokensInOrOut.some((token: Hex) => {
68+
return (
69+
isAddressEqual(swapParams.tokenIn.addressInfo, token) ||
70+
isAddressEqual(swapParams.tokenOut.addressInfo, token)
71+
)
72+
})
73+
)
74+
return false
75+
}
6576
if (match.isRepay) {
6677
if (swapParams.isRepay !== match.isRepay) return false
6778
}

0 commit comments

Comments
 (0)