Skip to content

Commit 56041b2

Browse files
committed
add avalanche config
1 parent 5deefcc commit 56041b2

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

src/swapService/config/avalanche.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { type ChainRoutingConfig, SwapperMode } from "../interface"
2+
import {
3+
StrategyBalmySDK,
4+
StrategyERC4626Wrapper,
5+
StrategyRepayWrapper,
6+
} from "../strategies"
7+
8+
const SAVUSD_AVALANCHE = "0x06d47F3fb376649c3A9Dafe069B3D6E35572219E"
9+
10+
const avalancheRoutingConfig: ChainRoutingConfig = [
11+
// WRAPPERS
12+
{
13+
strategy: StrategyRepayWrapper.name(),
14+
match: {
15+
isRepay: true,
16+
swapperModes: [SwapperMode.EXACT_IN],
17+
},
18+
},
19+
// SPECIAL CASE
20+
{
21+
strategy: StrategyERC4626Wrapper.name(),
22+
match: {
23+
tokensInOrOut: [SAVUSD_AVALANCHE],
24+
},
25+
},
26+
27+
// DEFAULTS
28+
{
29+
strategy: StrategyBalmySDK.name(),
30+
config: {
31+
sourcesFilter: {
32+
includeSources: [
33+
"kyberswap",
34+
"paraswap",
35+
"odos",
36+
"1inch",
37+
"li-fi",
38+
"open-ocean",
39+
"uniswap",
40+
"oku",
41+
"magpie",
42+
"enso",
43+
],
44+
},
45+
},
46+
match: {},
47+
},
48+
]
49+
50+
export default avalancheRoutingConfig

src/swapService/config/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { base, mainnet } from "viem/chains"
1+
import { avalanche, base, mainnet } from "viem/chains"
22
import type { RoutingConfig } from "../interface"
3+
import avalancheRoutingConfig from "./avalanche"
34
import baseRoutingConfig from "./base"
45
import berachainRoutingConfig from "./berachain"
56
import bobRoutingConfig from "./bob"
@@ -11,6 +12,7 @@ import swellRoutingConfig from "./swell"
1112
const routingConfig: RoutingConfig = {
1213
[mainnet.id]: mainnetRoutingConfig,
1314
[base.id]: baseRoutingConfig,
15+
[avalanche.id]: avalancheRoutingConfig,
1416
[1923]: swellRoutingConfig,
1517
[80094]: berachainRoutingConfig,
1618
[60808]: bobRoutingConfig,

src/swapService/strategies/strategyERC4626Wrapper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ const defaultConfig: {
9191
asset: "0xdc035d45d973e3ec169d2276ddab16f1e407384f",
9292
assetDustEVault: "0x98238Ee86f2c571AD06B0913bef21793dA745F57",
9393
},
94+
{
95+
chainId: 43114,
96+
protocol: "savUSD",
97+
vault: "0x06d47F3fb376649c3A9Dafe069B3D6E35572219E",
98+
asset: "0x24dE8771bC5DdB3362Db529Fc3358F2df3A0E346",
99+
assetDustEVault: "0xa9C92715dfED67a1Eb841c02059D9D0f1d508648",
100+
},
94101
],
95102
}
96103

0 commit comments

Comments
 (0)