Skip to content

Commit 5b15374

Browse files
astroKoable1froot
authored
yel-finance: add sonic potions (#1703)
* Update calculation logic + new chain * Revert "Update calculation logic + new chain" This reverts commit 2e9019c. * Add 'Base' chain and assets supported on 'Base' chain * Add Fantom chain + Fantom potions * update potions address * update potions address * add sonic potions --------- Co-authored-by: able1f <able1f@tuta.io> Co-authored-by: root <root@VoyagerHost>
1 parent 849d482 commit 5b15374

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/adaptors/yel-finance/index.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const POTIONS_URL = 'https://yel.finance/potions';
1010
const CHAINS = {
1111
81457: 'Blast',
1212
8453: 'Base',
13-
250 : 'Fantom'
13+
250 : 'Fantom',
14+
146 : 'Sonic'
1415
};
1516

1617
const PROJECT_NAME = 'yel-finance';
@@ -21,19 +22,34 @@ const POTION_SINGLE_STAKING_LIST = {
2122
'0x795a85CD543D0E2d29F7e11e33a20a38A4b5121e': '0x4300000000000000000000000000000000000004', // lWETH / WETH
2223
'0x07BF0Bc908Ef4badF8ec0fB1f77A8dBFe33c33c0': '0xb1a5700fA2358173Fe465e6eA4Ff52E36e88E2ad', // lBLAST / Blast
2324
'0x7d2f5881F0C4B840fcFA2c49F4052d1A004eAf0d': '0x949185D3BE66775Ea648F4a306740EA9eFF9C567', // lYEL / YEL
25+
'0xC107e89b842403D3f3Be56D3b611a74388FF69dA': '0xe36072dd051ce26261bf50cd966311cab62c596e' // lTHRUST / THRUST
2426
},
2527
8453 : {
2628
// Potion Potion Base token
2729
'0x56a827776511689d6502c5213425c4BFBE3915d1' : '0x4200000000000000000000000000000000000006', // lWETH / WETH
2830
'0x8ca29479CECa6eE24539508B90A02ec1939B88c6' : '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // lUSDC / USDC
29-
'0x1DC50dA045Ad23812c22148e03D62C9691958B47' : '0x949185D3BE66775Ea648F4a306740EA9eFF9C567' // lYEL / YEL
31+
'0x1DC50dA045Ad23812c22148e03D62C9691958B47' : '0x949185D3BE66775Ea648F4a306740EA9eFF9C567', // lYEL / YEL
32+
'0x2c21bFc177E297A83EAa87793c29E592fe81CeAC': '0x79bbF4508B1391af3A0F4B30bb5FC4aa9ab0E07C' // lANON / ANON
3033
},
3134
250 : {
3235
// Potion Potion Base token
3336
'0x97bB72E43Dc056621cBeC637e558C654A5cDe7d2' : '0x949185D3BE66775Ea648F4a306740EA9eFF9C567', // lYEL / YEL
3437
'0x5FF262D0c0Ecd0923DE3d9C0be6308D86F1229B4' : '0x1B6382DBDEa11d97f24495C9A90b7c88469134a4', // laxlUSDC / axlUSDC
3538
'0x9F7908Fc313f7A276c8366C5892839a26e66B5Bc' : '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83' // lWFTM / lWFTM
36-
}
39+
},
40+
41+
146 : {
42+
'0x7Ba0abb5f6bDCbf6409BB2803CdF801215424490': '0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38', // LSONIC / SONIC
43+
'0x995171196618b7FE0F0C6D606D79583DD1c8ff60': '0x29219dd400f2Bf60E5a23d13Be72B486D4038894', // lUSDC / USDC
44+
'0x92Dd17b19F74E696502Ee9eD478901F24c5d9a9A': '0x79bbF4508B1391af3A0F4B30bb5FC4aa9ab0E07C', // lANON / ANON
45+
'0xecf1b589F47511D23b026eF53D16FEbB89Aa5f3A': '0x0e0Ce4D450c705F8a0B6Dd9d5123e3df2787D16B', // lWAGMI / WAGMI
46+
'0x6E074300A7Bf53af6e20f1f07dDDfeedAE5598A8': '0x949185D3BE66775Ea648F4a306740EA9eFF9C567', // lYEL / YEL -
47+
'0xdE31054Fb0ee7c6C39641db2e677011E276644aC': '0x9fDbC3f8Abc05Fa8f3Ad3C17D2F806c1230c4564', // lGOGLZ / GOGLZ
48+
'0x555733fBa1CA24ec45e7027E00C4B6c5065BaC96': '0xE5DA20F15420aD15DE0fa650600aFc998bbE3955', // lstS / stS
49+
'0x85262a5121B8aD219C521665787A6F21eCbBf679': '0x7A0C53F7eb34C5BC8B01691723669adA9D6CB384', // lBOO / BOO -
50+
'0x30Fb515Cf3e0C7fF94Aa923788B466F44768cAA4': '0x59524D5667B299c0813Ba3c99a11C038a3908fBC' // lYOKO / YOKO
51+
52+
}
3753
};
3854

3955
const formatNumber = (n, decimals) => {
@@ -54,8 +70,6 @@ const getAPY = async () => {
5470
};
5571

5672
const getData = async ({ chainId, address }) => {
57-
const baseToken = [POTION_SINGLE_STAKING_LIST[chainId][address]];
58-
const calls = [];
5973
const chain = CHAINS[chainId].toLowerCase();
6074

6175
const baseAsset = await sdk.api.abi.call({
@@ -114,8 +128,9 @@ const getData = async ({ chainId, address }) => {
114128
`${BASE_URL}${CHAINS[chainId]}:${baseAsset.output[0].token}`
115129
);
116130

117-
const baseTokenPrice =
118-
data.coins[`${CHAINS[chainId]}:${baseAsset.output[0].token}`].price;
131+
const baseTokenPrice =
132+
data.coins[`${CHAINS[chainId]}:${baseAsset.output[0].token}`]?.price || 0;
133+
119134
const baseAssetAmountFormated = formatNumber(
120135
baseAssetOnPotion.output,
121136
baseAssetDecimals.output

0 commit comments

Comments
 (0)