Skip to content

Commit 973f4a2

Browse files
authored
Merge pull request #246 from curvefi/feat/router-llammas
Feat: llammas in router
2 parents 1f10e5c + 81c5a37 commit 973f4a2

File tree

3 files changed

+133
-3
lines changed

3 files changed

+133
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@curvefi/api",
3-
"version": "2.53.4",
3+
"version": "2.53.5",
44
"description": "JavaScript library for curve.fi",
55
"main": "lib/index.js",
66
"author": "Macket",

src/constants/pools/ethereum.ts

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,4 +1705,134 @@ export const LLAMMAS_DATA_ETHEREUM: IDict<IPoolData> = lowerCasePoolDataAddresse
17051705
swap_abi: LlammaABI,
17061706
gauge_abi: gaugeV5ABI,
17071707
},
1708+
"wsteth-llamma": {
1709+
name: "wsteth",
1710+
full_name: "wsteth",
1711+
symbol: "wsteth",
1712+
reference_asset: "CRYPTO",
1713+
swap_address: '0x37417b2238aa52d0dd2d6252d989e728e8f706e4',
1714+
token_address: '0x0000000000000000000000000000000000000000',
1715+
gauge_address: '0x0000000000000000000000000000000000000000',
1716+
is_crypto: true,
1717+
is_plain: true,
1718+
is_llamma: true,
1719+
underlying_coins: ['crvUSD', 'wstETH'],
1720+
wrapped_coins: ['crvUSD', 'wstETH'],
1721+
underlying_coin_addresses: [
1722+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1723+
'0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
1724+
],
1725+
wrapped_coin_addresses: [
1726+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1727+
'0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
1728+
],
1729+
underlying_decimals: [18, 18],
1730+
wrapped_decimals: [18, 18],
1731+
swap_abi: LlammaABI,
1732+
gauge_abi: gaugeV5ABI,
1733+
},
1734+
"wbtc-llamma": {
1735+
name: "wbtc",
1736+
full_name: "wbtc",
1737+
symbol: "wbtc",
1738+
reference_asset: "CRYPTO",
1739+
swap_address: '0xe0438eb3703bf871e31ce639bd351109c88666ea',
1740+
token_address: '0x0000000000000000000000000000000000000000',
1741+
gauge_address: '0x0000000000000000000000000000000000000000',
1742+
is_crypto: true,
1743+
is_plain: true,
1744+
is_llamma: true,
1745+
underlying_coins: ['crvUSD', 'WBTC'],
1746+
wrapped_coins: ['crvUSD', 'WBTC'],
1747+
underlying_coin_addresses: [
1748+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1749+
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
1750+
],
1751+
wrapped_coin_addresses: [
1752+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1753+
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
1754+
],
1755+
underlying_decimals: [18, 8],
1756+
wrapped_decimals: [18, 8],
1757+
swap_abi: LlammaABI,
1758+
gauge_abi: gaugeV5ABI,
1759+
},
1760+
"weth-llamma": {
1761+
name: "weth",
1762+
full_name: "weth",
1763+
symbol: "weth",
1764+
reference_asset: "CRYPTO",
1765+
swap_address: '0x1681195c176239ac5e72d9aebacf5b2492e0c4ee',
1766+
token_address: '0x0000000000000000000000000000000000000000',
1767+
gauge_address: '0x0000000000000000000000000000000000000000',
1768+
is_crypto: true,
1769+
is_plain: true,
1770+
is_llamma: true,
1771+
underlying_coins: ['crvUSD', 'WETH'],
1772+
wrapped_coins: ['crvUSD', 'WETH'],
1773+
underlying_coin_addresses: [
1774+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1775+
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
1776+
],
1777+
wrapped_coin_addresses: [
1778+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1779+
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
1780+
],
1781+
underlying_decimals: [18, 18],
1782+
wrapped_decimals: [18, 18],
1783+
swap_abi: LlammaABI,
1784+
gauge_abi: gaugeV5ABI,
1785+
},
1786+
"sfrxeth2-llamma": {
1787+
name: "sfrxeth2",
1788+
full_name: "sfrxeth2",
1789+
symbol: "sfrxeth2",
1790+
reference_asset: 'CRYPTO',
1791+
swap_address: '0xfa96ad0a9e64261db86950e2da362f5572c5c6fd',
1792+
token_address: '0x0000000000000000000000000000000000000000',
1793+
gauge_address: '0x0000000000000000000000000000000000000000',
1794+
is_crypto: true,
1795+
is_plain: true,
1796+
is_llamma: true,
1797+
underlying_coins: ['crvUSD', 'sfrxETH'],
1798+
wrapped_coins: ['crvUSD', 'sfrxETH'],
1799+
underlying_coin_addresses: [
1800+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1801+
'0xac3E018457B222d93114458476f3E3416Abbe38F',
1802+
],
1803+
wrapped_coin_addresses: [
1804+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1805+
'0xac3E018457B222d93114458476f3E3416Abbe38F',
1806+
],
1807+
underlying_decimals: [18, 18],
1808+
wrapped_decimals: [18, 18],
1809+
swap_abi: LlammaABI,
1810+
gauge_abi: gaugeV5ABI,
1811+
},
1812+
"tbtc-llamma": {
1813+
name: "tbtc",
1814+
full_name: "tbtc",
1815+
symbol: "tbtc",
1816+
reference_asset: "CRYPTO",
1817+
swap_address: '0xf9bd9da2427a50908c4c6d1599d8e62837c2bcb0',
1818+
token_address: '0x0000000000000000000000000000000000000000',
1819+
gauge_address: '0x0000000000000000000000000000000000000000',
1820+
is_crypto: true,
1821+
is_plain: true,
1822+
is_llamma: true,
1823+
underlying_coins: ['crvUSD', 'tBTC'],
1824+
wrapped_coins: ['crvUSD', 'tBTC'],
1825+
underlying_coin_addresses: [
1826+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1827+
'0x18084fba666a33d37592fa2633fd49a74dd93a88',
1828+
],
1829+
wrapped_coin_addresses: [
1830+
'0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
1831+
'0x18084fba666a33d37592fa2633fd49a74dd93a88',
1832+
],
1833+
underlying_decimals: [18, 18],
1834+
wrapped_decimals: [18, 18],
1835+
swap_abi: LlammaABI,
1836+
gauge_abi: gaugeV5ABI,
1837+
},
17081838
});

src/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const _buildRouteGraph = memoize(async (): Promise<IDict<IDict<IRouteStep[]>>> =
230230
}
231231
}
232232

233-
const ALL_POOLS = Object.entries(curve.getPoolsData()).filter(([id, _]) => id !== "crveth");
233+
const ALL_POOLS = Object.entries(curve.getPoolsData()).filter(([id, _]) => !["crveth", "y", "busd", "pax"].includes(id));
234234
const amplificationCoefficientDict = await _getAmplificationCoefficientsFromApi();
235235
for (const [poolId, poolData] of ALL_POOLS) {
236236
const wrappedCoinAddresses = poolData.wrapped_coin_addresses.map((a: string) => a.toLowerCase());
@@ -260,7 +260,7 @@ const _buildRouteGraph = memoize(async (): Promise<IDict<IDict<IRouteStep[]>>> =
260260
if (curve.chainId === 1 && tvl < 1000) continue;
261261
if (curve.chainId !== 1 && tvl < 100) continue;
262262

263-
const excludedUnderlyingSwaps = (poolId === 'aave' && curve.chainId === 1) || (poolId === 'geist' && curve.chainId === 250);
263+
const excludedUnderlyingSwaps = (poolId === 'ib' && curve.chainId === 1) || (poolId === 'geist' && curve.chainId === 250);
264264

265265
// Wrapped coin <-> LP "swaps" (actually add_liquidity/remove_liquidity_one_coin)
266266
if (!poolData.is_fake && !poolData.is_llamma && wrappedCoinAddresses.length < 6) {

0 commit comments

Comments
 (0)