mirror of
https://github.com/uniwhale-io/DefiLlama-yield-server.git
synced 2026-01-12 17:12:21 +08:00
oswap remove dupes
This commit is contained in:
@@ -2,29 +2,30 @@ const utils = require('../utils');
|
||||
|
||||
const OSWAP_STATS_ENDPOINT = 'https://v2-stats.oswap.io/api/v1';
|
||||
const LIQUIDITY_PROVIDER_ENDPOINT = 'https://liquidity.obyte.org';
|
||||
const COMMON_DATA = { chain: "Obyte", project: 'oswap' };
|
||||
const COMMON_DATA = { chain: 'Obyte', project: 'oswap' };
|
||||
|
||||
const poolsFunction = async () => {
|
||||
const poolsData = await utils.getData(
|
||||
`${OSWAP_STATS_ENDPOINT}/yield`
|
||||
);
|
||||
const poolsData = await utils.getData(`${OSWAP_STATS_ENDPOINT}/yield`);
|
||||
|
||||
const apyRewards = await utils.getData(
|
||||
`${LIQUIDITY_PROVIDER_ENDPOINT}/mining-apy`
|
||||
);
|
||||
const apyRewards = await utils.getData(
|
||||
`${LIQUIDITY_PROVIDER_ENDPOINT}/mining-apy`
|
||||
);
|
||||
|
||||
return poolsData.map(({ address, pool, apyBase, ...rest }) => ({
|
||||
url: `https://oswap.io/#/swap/${address}`,
|
||||
apyReward: apyRewards[address] || null,
|
||||
apyBase,
|
||||
rewardTokens: ['GBYTE'],
|
||||
pool: `${address}-obyte`.toLowerCase(),
|
||||
...rest,
|
||||
...COMMON_DATA
|
||||
})).filter(({ apyBase }) => apyBase !== null);
|
||||
return poolsData
|
||||
.map(({ address, pool, apyBase, ...rest }) => ({
|
||||
url: `https://oswap.io/#/swap/${address}`,
|
||||
apyReward: apyRewards[address] || null,
|
||||
apyBase,
|
||||
rewardTokens: ['GBYTE'],
|
||||
pool: `${address}-obyte`.toLowerCase(),
|
||||
...rest,
|
||||
...COMMON_DATA,
|
||||
}))
|
||||
.filter(({ apyBase }) => apyBase !== null)
|
||||
.filter((p) => p.symbol !== 'O-GBYTE-WBTC-WBTC');
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
timetravel: false,
|
||||
apy: poolsFunction,
|
||||
};
|
||||
timetravel: false,
|
||||
apy: poolsFunction,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user