Skip to content

Update move pools #1921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/adaptors/interest-curve/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ async function main() {
underlyingTokens: pool.coins,
url: `${INTEREST_DAPP_URL}/pools/details?address=${pool.poolId}`,
poolMeta: pool.isStable ? 'stable' : 'volatile',
volumeUsd1d: +pool.metrics.volume1D,
volumeUsd7d: +pool.metrics.volume7D,
};
})
.filter((pool) => pool.apyReward > 0); // Pools when farm APR is 0
Expand Down
1 change: 1 addition & 0 deletions src/adaptors/meridian-amm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async function main() {
rewardTokens,
symbol: coinNames,
tvlUsd: liquidityPool.tvl,
volumeUsd1d: +liquidityPool.volume1d,
underlyingTokens: liquidityPool.metadata.coinAddresses,
url: `${MERIDIAN_DAPP_URL}/pools/${liquidityPool.metadata.type}`,
});
Expand Down
1 change: 1 addition & 0 deletions src/adaptors/mosaic-amm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async function apy() {
tvlUsd: pool.stats.tvl_usd,
apyBase: pool.stats.apr_fees,
apyReward: pool.stats.apr_farming_rewards,
volumeUsd1d: +pool.stats.volume_24h_usd,
rewardTokens: rewardTokens,
underlyingTokens: [pool.metadata.token_x, pool.metadata.token_y],
url: `${MOSAIC_AMM_LIQUIDITY_POOL_URL}/add?pool=${pool.pool_address}`,
Expand Down
27 changes: 27 additions & 0 deletions src/adaptors/woofi-earn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const BigNumber = require('bignumber.js');
const utils = require('../utils');

const API_URL = 'https://fi-api.woo.org/yield';
const STATS_API_URL = 'https://api.woofi.com/token_stat';

const API_URLS = {
binance: `${API_URL}?network=bsc`,
Expand Down Expand Up @@ -31,7 +32,22 @@ const rewardTokensMapping = {
// sonic: '0xF3df0A31ec5EA438150987805e841F960b9471b6', // WOO
};

async function getStats() {
const stats = {}
for (const chain of Object.keys(API_URLS)) {
let woofiChain = chain;
if (chain === 'binance') woofiChain = 'bsc';
if (chain === 'avalanche') woofiChain = 'avax';
if (chain === 'era') woofiChain = 'zksync';

// don't know why woofi api return bsc data key for all chains here
stats[chain] = (await utils.getData(`${STATS_API_URL}?network=${woofiChain}`))['data']['bsc'];
}
return stats;
}

const main = async () => {
const stats = await getStats()
const datas = await Promise.all(
Object.entries(API_URLS).map(async ([chain, url]) => [
chain,
Expand Down Expand Up @@ -60,6 +76,16 @@ const main = async () => {
apyReward = 0;
rewardTokens = [];
}

let volumeUsd1d = 0;
if (stats[chain]) {
for (const token of stats[chain]) {
if (token.symbol === info['symbol']) {
volumeUsd1d = Number(token['24h_volume_usd']) / 1e18;
}
}
}

results.push({
pool: `${address}-${chain}`.toLowerCase(),
chain: utils.formatChain(chain),
Expand All @@ -69,6 +95,7 @@ const main = async () => {
tvlUsd: parseFloat(BigNumber(info['tvl']).div(10 ** decimals)),
apyBase: info['weighted_average_apr'],
apyReward: apyReward,
volumeUsd1d: volumeUsd1d,
rewardTokens: rewardTokens,
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/adaptors/yuzu-finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ async function main() {
new Set(pool.rewardInfos?.map((reward) => reward.tokenMetadata) || [])
),
underlyingTokens: [pool.token0, pool.token1],
volumeUsd1d: +pool.volume24h,
volumeUsd7d: +pool.volume7d,
};
})
.filter(Boolean); // Remove null entries
Expand Down
Loading