Skip to content

Commit

Permalink
Fix issues and add base, polygon, avalanche and fraxtal tracking (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreadinenno authored Dec 5, 2024
1 parent d41dbbc commit fc47233
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/adaptors/vaultcraft/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ const ADDRESSES = {
const CHAIN_TO_ID = {
ethereum: 1,
optimism: 10,
// polygon: 137,
polygon: 137,
arbitrum: 42161,
base: 8453,
avax: 43114,
fraxtal: 252
// bsc: 56,
};

Expand Down Expand Up @@ -72,14 +75,6 @@ const apy = async (timestamp = null) => {
})
).output.replace('pop-', '');

const decimals = (
await sdk.api.abi.call({
target: vault.asset,
abi: 'erc20:decimals',
chain,
})
).output;

const totalAssets = (
await sdk.api.abi.call({
target: vault.address,
Expand All @@ -89,8 +84,8 @@ const apy = async (timestamp = null) => {
).output;

const tvl =
(totalAssets * (await getTokenPrice(chain, vault.asset))) /
10 ** decimals;
(totalAssets * (await getTokenPrice(chain, vault.asset.address))) /
10 ** vault.asset.decimals;

const data = {
pool: `${vault.address}-${chain}`,
Expand All @@ -99,7 +94,7 @@ const apy = async (timestamp = null) => {
symbol,
tvlUsd: tvl,
apyBase: vault.baseApy,
underlyingTokens: [vault.asset],
underlyingTokens: [vault.asset.address],
};

if (vault.gaugeLowerApr) {
Expand Down

0 comments on commit fc47233

Please sign in to comment.