Skip to content

Commit

Permalink
Disable Kava, Canto, Manta, Real apys
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-monk committed Jan 2, 2025
1 parent 2c0fff8 commit 13463cd
Show file tree
Hide file tree
Showing 28 changed files with 21 additions and 1,790 deletions.
20 changes: 0 additions & 20 deletions src/api/stats/canto/getCvmApys.js

This file was deleted.

41 changes: 5 additions & 36 deletions src/api/stats/canto/getVelocimeterApys.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
const { CANTO_CHAIN_ID: chainId } = require('../../../constants');
import { getEDecimals } from '../../../utils/getEDecimals';

const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys');
const stablePools = require('../../../data/canto/velocimeterStableLpPools.json');
const volatilePools = require('../../../data/canto/velocimeterLpPools.json');
const stableV2Pools = require('../../../data/canto/velocimeterV2StableLpPools.json');
const volatileV2Pools = require('../../../data/canto/velocimeterV2LpPools.json');

import { addressBook } from '../../../../packages/address-book/src/address-book';

const {
canto: {
tokens: { FLOWV1, FLOW },
tokens: { FLOW },
},
} = addressBook;

const pools = [...stablePools, ...volatilePools];
const poolsV2 = [...stableV2Pools, ...volatileV2Pools];
const poolsV2 = [...volatileV2Pools];
const getVelocimeterApys = async () => {
const gaugeApys = getSolidlyGaugeApys({
chainId: chainId,
pools: pools,
oracleId: 'FLOWV1',
oracle: 'tokens',
decimals: getEDecimals(FLOWV1.decimals),
reward: FLOWV1.address,
boosted: false,
// log: true,
});

const gaugeV2Apys = getSolidlyGaugeApys({
return getSolidlyGaugeApys({
chainId: chainId,
pools: poolsV2,
oracleId: 'FLOW',
Expand All @@ -37,24 +24,6 @@ const getVelocimeterApys = async () => {
boosted: false,
// log: true,
});

let apys = {};
let apyBreakdowns = {};

const results = await Promise.allSettled([gaugeApys, gaugeV2Apys]);
for (const result of results) {
if (result.status !== 'fulfilled') {
console.warn('getVelocimeterApys error', result.reason);
} else {
apys = { ...apys, ...result.value.apys };
apyBreakdowns = { ...apyBreakdowns, ...result.value.apyBreakdowns };
}
}

return {
apys,
apyBreakdowns,
};
};

module.exports = getVelocimeterApys;
10 changes: 0 additions & 10 deletions src/api/stats/canto/getVelocimeterStablePrices.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/api/stats/canto/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const getCantoLpApys = require('./getCantoLpApys');
const getVelocimeterApys = require('./getVelocimeterApys');
const getCvmApys = require('./getCvmApys');

const getApys = [getCantoLpApys, getVelocimeterApys, getCvmApys];
const getApys = [getCantoLpApys, getVelocimeterApys];

const getCantoApys = async () => {
const start = Date.now();
Expand Down
28 changes: 12 additions & 16 deletions src/api/stats/fuse/getVoltageApys.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const BigNumber = require('bignumber.js');
import { fetchPrice } from '../../../utils/fetchPrice';
const voltageLpPools = require('../../../data/fuse/voltageLpPools.json');
const voltageStableLpPools = require('../../../data/fuse/voltageStableLpPools.json');
const { BASE_HPY, FUSE_CHAIN_ID } = require('../../../constants');
const { getTradingFeeApr } = require('../../../utils/getTradingFeeApr');
import { getFarmWithTradingFeesApy } from '../../../utils/getFarmWithTradingFeesApy';
Expand Down Expand Up @@ -45,21 +44,18 @@ const getVoltageApys = async () => {

const tokenPriceA = await fetchPrice({ oracle: oracleA, id: oracleIdA });

const pools = [...voltageLpPools, ...voltageStableLpPools, ...xVOLT];

const [
{ rewardPerSecond, totalAllocPoint },
tradingAprs,
{ balances, allocPoints, tokenPerSecData },
] = await Promise.all([
getMasterChefData(),
getTradingFeeApr(
fusefiClient,
voltageLpPools.map(pool => pool.address),
liquidityProviderFee
),
getPoolsData(pools),
]);
const pools = [...voltageLpPools, ...xVOLT];

const [{ rewardPerSecond, totalAllocPoint }, tradingAprs, { balances, allocPoints, tokenPerSecData }] =
await Promise.all([
getMasterChefData(),
getTradingFeeApr(
fusefiClient,
voltageLpPools.map(pool => pool.address),
liquidityProviderFee
),
getPoolsData(pools),
]);

for (let i = 0; i < pools.length; i++) {
const pool = pools[i];
Expand Down
9 changes: 0 additions & 9 deletions src/api/stats/fuse/getVoltagePrices.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/api/stats/getAmmPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import synapseLpPools from '../../data/ethereum/synapseLpPools.json';
import solidlyLpPools from '../../data/ethereum/solidlyLpPools.json';
import cantoLpPools from '../../data/canto/cantoLpPools.json';
import solidLizardPools from '../../data/arbitrum/solidlizardLpPools.json';
import velocimeterPools from '../../data/canto/velocimeterLpPools.json';
import velocimeterV2Pools from '../../data/canto/velocimeterV2LpPools.json';
import equilibrePools from '../../data/kava/equilibreLpPools.json';
import versePools from '../../data/ethereum/verseLpPools.json';
Expand All @@ -70,7 +69,6 @@ import velocorePools from '../../data/zksync/velocoreLpPools.json';
import veSyncPools from '../../data/zksync/veSyncLpPools.json';
import fvmPools from '../../data/fantom/fvmLpPools.json';
import bvmPools from '../../data/base/bvmLpPools.json';
import cvmPools from '../../data/canto/cvmLpPools.json';
import baseSwapPools from '../../data/base/baseSwapLpPools.json';
import ooeV2Pools from '../../data/bsc/ooeV2LpPools.json';
import draculaPools from '../../data/zksync/draculaLpPools.json';
Expand All @@ -85,7 +83,6 @@ import nilePools from '../../data/linea/nileVolatilePools.json';
import raPools from '../../data/fraxtal/raPools.json';
import nuriPools from '../../data/scroll/nuriVolatilePools.json';
import tokanPools from '../../data/scroll/tokanVolatilePools.json';
import pearlPools from '../../data/real/pearlLpPools.json';
import velodromeModePools from '../../data/mode/velodromeModePools.json';
import velodromeLiskPools from '../../data/lisk/velodromeLiskPools.json';
import equalizerSonicPools from '../../data/sonic/equalizerLpPools.json';
Expand All @@ -109,7 +106,6 @@ const pools = normalizePoolOracleIds([
...equalizerSonicPools,
...velodromeLiskPools,
...velodromeModePools,
...pearlPools,
...tokanPools,
...nuriPools,
...raPools,
Expand All @@ -126,14 +122,12 @@ const pools = normalizePoolOracleIds([
...baseSwapPools,
...fvmPools,
...bvmPools,
...cvmPools,
...veSyncPools,
...velocorePools,
...ramsesPools,
...versePools,
...equilibrePools,
...velocimeterV2Pools,
...velocimeterPools,
...solidLizardPools,
...cantoLpPools,
...solidlyLpPools,
Expand Down
8 changes: 3 additions & 5 deletions src/api/stats/getApys.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const { getMantleApys } = require('./mantle');
const { getFraxtalApys } = require('./fraxtal');
const { getModeApys } = require('./mode');
const { getMantaApys } = require('./manta');
const { getRealApys } = require('./real');
const { getSeiApys } = require('./sei');
const { getRootstockApys } = require('./rootstock');
const { getScrollApys } = require('./scroll');
Expand Down Expand Up @@ -71,9 +70,9 @@ const updateApys = async () => {
getMoonbeamApys(),
// getEmeraldApys(),
getOptimismApys(),
getKavaApys(),
// getKavaApys(),
getEthereumApys(),
getCantoApys(),
// getCantoApys(),
getZksyncApys(),
// getZkevmApys(),
getBaseApys(),
Expand All @@ -82,8 +81,7 @@ const updateApys = async () => {
getMantleApys(),
getFraxtalApys(),
getModeApys(),
getMantaApys(),
getRealApys(),
// getMantaApys(),
getSeiApys(),
getRootstockApys(),
getScrollApys(),
Expand Down
12 changes: 0 additions & 12 deletions src/api/stats/getNonAmmPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import getBeetsSonicPrices from './sonic/getBeetsSonicPrices';
import getBalancerZkevmPrices from './zkevm/getBalancerPrices';
import getVelodromeStablePrices from './optimism/getVelodromeStablePrices';
import getEquilibreStablePrices from './kava/getEquilibreStablePrices';
import getVoltagePrices from './fuse/getVoltagePrices';
import getTrisolarisPrices from './aurora/getTrisolarisPrices';
import getHermesStablePrices from './metis/getHermesStablePrices';
import getCurveKavaPrices from './kava/getCurvePrices';
import getSushiKavaPrices from './kava/getSushiPrices';
import { getGmxV2ArbitrumPrices } from './arbitrum/getGmxV2Prices';
import { getGmxArbitrumPrices } from './arbitrum/getGmxPrices';
import { getGmxAvalanchePrices } from './avax/getGmxPrices';
Expand All @@ -35,7 +33,6 @@ import getStargatePolygonPrices from './matic/getStargatePolygonPrices';
import getStargateOpPrices from './optimism/getStargateOpPrices';
import getStargateMetisPrices from './metis/getStargateMetisPrices';
import getStargateBasePrices from './base/getStargateBasePrices';
import getStargateKavaPrices from './kava/getStargateKavaPrices';
import getStargateMantlePrices from './mantle/getStargateMantlePrices';
import getStargateSeiPrices from './sei/getStargateSeiPrices';
import getOlpPrices from './optimism/getOlpPrices';
Expand All @@ -44,7 +41,6 @@ import getSolidlyEthStablePrices from './ethereum/getSolidlyStablePrices';
import getCantoStablePrices from './canto/getCantoStablePrices';
import { getKyberOptimismPrices } from './optimism/getKyberOptimismPrices';
import getSolidLizardStablePrices from './arbitrum/getSolidLizardStablePrices';
import getVelocimeterStablePrices from './canto/getVelocimeterStablePrices';
import getRamsesStablePrices from './arbitrum/getRamsesStablePrices';
import getMmyOptimismPrices from './optimism/getMmyOptimismPrices';
import getVelocoreStablePrices from './zksync/getVelocoreStablePrices';
Expand Down Expand Up @@ -84,7 +80,6 @@ import {
FRAXTAL_CHAIN_ID as FRX_CHAIN_ID,
GNOSIS_CHAIN_ID as GNO_CHAIN_ID,
OPTIMISM_CHAIN_ID,
REAL_CHAIN_ID,
} from '../../constants';
import getSolidlyStablePrices from './common/getSolidlyStablePrices';
import getEthSiloPrices from './ethereum/getEthereumSiloPrices';
Expand All @@ -93,7 +88,6 @@ import getGammaLineaPrices from './linea/getGammaPrices';
import getLynexStablePrices from './linea/getLynexStablePrices';
import getNileStablePrices from './linea/getNileStablePrices';
import { getMimSwapPrices } from './arbitrum/getMimSwapPrices';
import { getPearlTridentPrices } from './real/getPearlTridentPrices';
import { getBeefyCowArbPrices } from './arbitrum/getBeefyCowArbPrices';
import { getBeefyCowOPPrices } from './optimism/getBeefyCowOPPrices';
import getFtmIchiPrices from './fantom/getFtmIchiPrices';
Expand Down Expand Up @@ -154,7 +148,6 @@ export async function getNonAmmPrices(tokenPrices: Record<string, number>): Prom
getMmyOptimismPrices(tokenPrices),
getRamsesStablePrices(tokenPrices),
getEquilibreStablePrices(tokenPrices),
getVelocimeterStablePrices(tokenPrices),
getSolidLizardStablePrices(tokenPrices),
getCantoStablePrices(tokenPrices),
getKyberOptimismPrices(tokenPrices),
Expand All @@ -170,7 +163,6 @@ export async function getNonAmmPrices(tokenPrices: Record<string, number>): Prom
getStargateAvaxPrices(tokenPrices),
getStargateArbPrices(tokenPrices),
getStargateEthPrices(tokenPrices),
getStargateKavaPrices(tokenPrices),
getStargateLineaPrices(tokenPrices),
getStargateMantlePrices(tokenPrices),
getStargateSeiPrices(tokenPrices),
Expand All @@ -182,10 +174,8 @@ export async function getNonAmmPrices(tokenPrices: Record<string, number>): Prom
getGmxV2ArbitrumPrices(),
getGmxAvalanchePrices(tokenPrices),
getGmxArbitrumPrices(tokenPrices),
getSushiKavaPrices(tokenPrices),
getHermesStablePrices(tokenPrices),
getTrisolarisPrices(tokenPrices),
getVoltagePrices(tokenPrices),
getVelodromeStablePrices(tokenPrices),
getVelodromeModeStablePrices(tokenPrices),
getVelodromeLiskStablePrices(tokenPrices),
Expand Down Expand Up @@ -252,8 +242,6 @@ export async function getNonAmmPrices(tokenPrices: Record<string, number>): Prom
getMellowVeloPrices(OPTIMISM_CHAIN_ID, require('../../data/optimism/mellowVeloPools.json'), tokenPrices),
getMellowVeloPrices(BASE_CHAIN_ID, require('../../data/base/mellowAeroPools.json'), tokenPrices),
getBunniPrices(BASE_CHAIN_ID, require('../../data/base/alienBaseBunniPools.json'), tokenPrices),
getPearlTridentPrices(tokenPrices),
getSolidlyStablePrices(REAL_CHAIN_ID, require('../../data/real/pearlStableLpPools.json'), tokenPrices),
getBaseSiloPrices(tokenPrices),
getNuriStablePrices(tokenPrices),
getTokanStablePrices(tokenPrices),
Expand Down
13 changes: 0 additions & 13 deletions src/api/stats/kava/getStargateKavaPrices.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/api/stats/kava/getSushiPrices.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/api/stats/real/getPearlApys.js

This file was deleted.

Loading

0 comments on commit 13463cd

Please sign in to comment.