Skip to content

Commit 5a3e936

Browse files
committed
clean up strategies and sources config
1 parent 16117db commit 5a3e936

38 files changed

+57
-327
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const pipeline = [
136136
},
137137
},
138138
{
139-
strategy: StrategyBalmySDK.name(),
139+
strategy: StrategyAggregators.name(),
140140
config: {
141141
sourcesFilter: {
142142
includeSources: ["pendle", "li-fi"],
@@ -145,7 +145,7 @@ const pipeline = [
145145
match: { isPendlePT: true },
146146
},
147147
{
148-
strategy: StrategyBalmySDK.name(),
148+
strategy: StrategyAggregators.name(),
149149
config: {
150150
sourcesFilter: {
151151
includeSources: ["1inch", "li-fi"],
@@ -155,7 +155,7 @@ const pipeline = [
155155
]
156156
```
157157

158-
Additionally there is a script to generate auxiliary config files, executed by `pnpm run generate-config`. Currently it fetches the list of supported [Pendle aggregators](./src/swapService/strategies/balmySDK/sources/pendle/pendleAggregators.json) for all chains
158+
Additionally there is a script to generate auxiliary config files, executed by `pnpm run generate-config`. Currently it fetches the list of supported [Pendle aggregators](./src/swapService/strategies/aggregators/sources/pendle/pendleAggregators.json) for all chains
159159

160160
## Tokenlists
161161
The router relies on tokenlists for all swapped tokens. They can be fetched from `TOKENLIST_URL` or read from JSON files in `tokenLists` folder if the configuration is missing. Note the files are not updated currently. Please reach out on [Euler discord](https://discord.com/invite/pTTnr7b4mT) if you need access to the tokenlist endpoint.

scripts/generateConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require("node:path")
33

44
const PENDLE_CONFIG_PATH = path.join(
55
__dirname,
6-
"../src/swapService/strategies/balmySDK/sources/pendle/pendleAggregators.json",
6+
"../src/swapService/strategies/aggregators/sources/pendle/pendleAggregators.json",
77
)
88

99
async function run() {

src/swapService/config/arbitrum.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
22
import {
3-
StrategyBalmySDK,
3+
StrategyAggregators,
44
StrategyERC4626Wrapper,
55
StrategyRepayWrapper,
66
} from "../strategies"
@@ -24,27 +24,7 @@ const arbitrumRoutingConfig: ChainRoutingConfig = [
2424
},
2525
// DEFAULTS
2626
{
27-
strategy: StrategyBalmySDK.name(),
28-
config: {
29-
sourcesFilter: {
30-
includeSources: [
31-
"kyberswap",
32-
"paraswap",
33-
"odos",
34-
"1inch",
35-
"li-fi",
36-
"open-ocean",
37-
"uniswap",
38-
"oku",
39-
"magpie",
40-
"enso",
41-
"okx-dex",
42-
"pendle",
43-
"0x",
44-
],
45-
},
46-
},
47-
match: {},
27+
strategy: StrategyAggregators.name(),
4828
},
4929
]
5030

src/swapService/config/avalanche.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
22
import {
3-
StrategyBalmySDK,
3+
StrategyAggregators,
44
StrategyERC4626Wrapper,
55
StrategyElixir,
66
StrategyPendleCrossChainPT,
@@ -28,7 +28,6 @@ const avalancheRoutingConfig: ChainRoutingConfig = [
2828
},
2929
{
3030
strategy: StrategyPendleCrossChainPT.name(),
31-
match: {},
3231
},
3332
{
3433
strategy: StrategyERC4626Wrapper.name(),
@@ -38,24 +37,7 @@ const avalancheRoutingConfig: ChainRoutingConfig = [
3837
},
3938
// DEFAULTS
4039
{
41-
strategy: StrategyBalmySDK.name(),
42-
config: {
43-
sourcesFilter: {
44-
includeSources: [
45-
"kyberswap",
46-
"paraswap",
47-
"odos",
48-
"1inch",
49-
"li-fi",
50-
"open-ocean",
51-
"uniswap",
52-
"oku",
53-
"magpie",
54-
"enso",
55-
],
56-
},
57-
},
58-
match: {},
40+
strategy: StrategyAggregators.name(),
5941
},
6042
]
6143

src/swapService/config/base.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
22
import {
3-
StrategyBalmySDK,
4-
StrategyERC4626Wrapper,
3+
StrategyAggregators,
54
StrategyMidas,
65
StrategyRepayWrapper,
76
} from "../strategies"
8-
// const YOUSD_BASE = "0x0000000f2eB9f69274678c76222B35eEc7588a65"
9-
// const YOETH_BASE = "0x3A43AEC53490CB9Fa922847385D82fe25d0E9De7"
10-
// const YOBTC_BASE = "0xbCbc8cb4D1e8ED048a6276a5E94A3e952660BcbC"
117

128
const baseRoutingConfig: ChainRoutingConfig = [
139
// WRAPPERS
@@ -21,34 +17,10 @@ const baseRoutingConfig: ChainRoutingConfig = [
2117
// SPECIAL CASE TOKENS
2218
{
2319
strategy: StrategyMidas.name(),
24-
match: {}, // supports function will match mTokens
2520
},
26-
// {
27-
// strategy: StrategyERC4626Wrapper.name(),
28-
// match: {
29-
// tokensInOrOut: [YOUSD_BASE, YOETH_BASE, YOBTC_BASE],
30-
// },
31-
// },
3221
// DEFAULTS
3322
{
34-
strategy: StrategyBalmySDK.name(),
35-
config: {
36-
sourcesFilter: {
37-
includeSources: [
38-
"kyberswap",
39-
"paraswap",
40-
"odos",
41-
"1inch",
42-
"li-fi",
43-
"open-ocean",
44-
"uniswap",
45-
"magpie",
46-
"pendle",
47-
"enso",
48-
],
49-
},
50-
},
51-
match: {},
23+
strategy: StrategyAggregators.name(),
5224
},
5325
]
5426

src/swapService/config/berachain.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
22
import {
3-
StrategyBalmySDK,
3+
StrategyAggregators,
44
StrategyERC4626Wrapper,
55
StrategyRepayWrapper,
66
} from "../strategies"
@@ -26,20 +26,7 @@ const berachainRoutingConfig: ChainRoutingConfig = [
2626
},
2727
// DEFAULTS
2828
{
29-
strategy: StrategyBalmySDK.name(),
30-
config: {
31-
sourcesFilter: {
32-
includeSources: [
33-
"oogabooga",
34-
"li-fi",
35-
"magpie",
36-
"open-ocean",
37-
"enso",
38-
"pendle",
39-
],
40-
},
41-
},
42-
match: {},
29+
strategy: StrategyAggregators.name(),
4330
},
4431
// FALLBACKS
4532
{

src/swapService/config/bob.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
2-
import { StrategyBalmySDK, StrategyRepayWrapper } from "../strategies"
2+
import { StrategyAggregators, StrategyRepayWrapper } from "../strategies"
33

44
const bobRoutingConfig: ChainRoutingConfig = [
55
// WRAPPERS
@@ -12,13 +12,7 @@ const bobRoutingConfig: ChainRoutingConfig = [
1212
},
1313
// DEFAULTS
1414
{
15-
strategy: StrategyBalmySDK.name(),
16-
config: {
17-
sourcesFilter: {
18-
includeSources: ["oku_bob_icecreamswap", "oku_bob_uniswap"],
19-
},
20-
},
21-
match: {},
15+
strategy: StrategyAggregators.name(),
2216
},
2317
]
2418

src/swapService/config/bsc.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
2-
import { StrategyBalmySDK, StrategyRepayWrapper } from "../strategies"
2+
import { StrategyAggregators, StrategyRepayWrapper } from "../strategies"
33

44
const bscRoutingConfig: ChainRoutingConfig = [
55
// WRAPPERS
@@ -12,26 +12,7 @@ const bscRoutingConfig: ChainRoutingConfig = [
1212
},
1313
// DEFAULTS
1414
{
15-
strategy: StrategyBalmySDK.name(),
16-
config: {
17-
sourcesFilter: {
18-
includeSources: [
19-
"kyberswap",
20-
"paraswap",
21-
"odos",
22-
"1inch",
23-
"li-fi",
24-
"open-ocean",
25-
"uniswap",
26-
"oku",
27-
"magpie",
28-
"enso",
29-
"pendle",
30-
"okx-dex",
31-
],
32-
},
33-
},
34-
match: {},
15+
strategy: StrategyAggregators.name(),
3516
},
3617
]
3718

src/swapService/config/default.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
2-
import { StrategyBalmySDK, StrategyRepayWrapper } from "../strategies"
2+
import { StrategyAggregators, StrategyRepayWrapper } from "../strategies"
33

44
const defaultRoutingConfig: ChainRoutingConfig = [
55
// WRAPPERS
@@ -12,27 +12,7 @@ const defaultRoutingConfig: ChainRoutingConfig = [
1212
},
1313
// DEFAULTS
1414
{
15-
strategy: StrategyBalmySDK.name(),
16-
config: {
17-
sourcesFilter: {
18-
includeSources: [
19-
"kyberswap",
20-
"paraswap",
21-
"odos",
22-
"1inch",
23-
"li-fi",
24-
"open-ocean",
25-
"uniswap",
26-
"oku",
27-
"magpie",
28-
"enso",
29-
"okx-dex",
30-
"pendle",
31-
"0x",
32-
],
33-
},
34-
},
35-
match: {},
15+
strategy: StrategyAggregators.name(),
3616
},
3717
]
3818

src/swapService/config/mainnet.ts

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ChainRoutingConfig, SwapperMode } from "../interface"
22
import {
3-
StrategyBalmySDK,
3+
StrategyAggregators,
44
StrategyCombinedUniswap,
55
StrategyCurveLPNG,
66
StrategyERC4626Wrapper,
@@ -57,7 +57,6 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
5757
},
5858
{
5959
strategy: StrategyStrata.name(),
60-
match: {},
6160
},
6261
{
6362
strategy: StrategyERC4626Wrapper.name(),
@@ -80,27 +79,6 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
8079
],
8180
},
8281
},
83-
// WUSDL with paraswap
84-
{
85-
strategy: StrategyBalmySDK.name(),
86-
config: {
87-
sourcesFilter: {
88-
includeSources: [
89-
"kyberswap",
90-
"paraswap",
91-
"odos",
92-
"1inch",
93-
"li-fi",
94-
"open-ocean",
95-
"magpie",
96-
"okx-dex",
97-
],
98-
},
99-
},
100-
match: {
101-
tokensInOrOut: [WUSDL_MAINNET],
102-
},
103-
},
10482
{
10583
strategy: StrategyMidas.name(),
10684
match: {
@@ -121,25 +99,7 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
12199
},
122100
// DEFAULTS
123101
{
124-
strategy: StrategyBalmySDK.name(),
125-
config: {
126-
sourcesFilter: {
127-
includeSources: [
128-
"kyberswap",
129-
"paraswap",
130-
"odos",
131-
"1inch",
132-
"li-fi",
133-
"open-ocean",
134-
"magpie",
135-
"enso",
136-
"pendle",
137-
"okx-dex",
138-
"0x",
139-
"spectra",
140-
],
141-
},
142-
},
102+
strategy: StrategyAggregators.name(),
143103
match: {
144104
swapperModes: [SwapperMode.EXACT_IN],
145105
},
@@ -161,24 +121,7 @@ const mainnetRoutingConfig: ChainRoutingConfig = [
161121
// FALLBACKS
162122
// Binary search overswap for target debt
163123
{
164-
strategy: StrategyBalmySDK.name(),
165-
config: {
166-
sourcesFilter: {
167-
includeSources: [
168-
"paraswap",
169-
"kyberswap",
170-
"odos",
171-
"1inch",
172-
"li-fi",
173-
"open-ocean",
174-
"magpie",
175-
"enso",
176-
"pendle",
177-
"0x",
178-
"spectra",
179-
],
180-
},
181-
},
124+
strategy: StrategyAggregators.name(),
182125
match: {
183126
swapperModes: [SwapperMode.TARGET_DEBT],
184127
},

0 commit comments

Comments
 (0)