diff --git a/src/adaptors/archly-finance/apy.ts b/src/adaptors/archly-v1/apy.ts similarity index 89% rename from src/adaptors/archly-finance/apy.ts rename to src/adaptors/archly-v1/apy.ts index 8e47c67f3e..414d9ab416 100644 --- a/src/adaptors/archly-finance/apy.ts +++ b/src/adaptors/archly-v1/apy.ts @@ -14,10 +14,7 @@ const ARC_ADDRESS = '0xa84df7afbcbcc1106834a5fed9453bd1219b1fb5'; const getApy = async () => { try { - const [arcPrice, pairs] = await Promise.all([ - getArcPrice(), - getPairs(), - ]); + const [arcPrice, pairs] = await Promise.all([getArcPrice(), getPairs()]); let gaugePairs = []; let nonGaugePairs = []; const multicalls = []; @@ -45,13 +42,17 @@ const getApy = async () => { // gauge pairs apr/apy gaugePairs = gaugePairs.map((pair, index) => { const rewardRate = gaugesRewardRates[index].toString(); - const aprReward = _calculateGaugeAPR(pair.reserveUSD, rewardRate, arcPrice); + const aprReward = _calculateGaugeAPR( + pair.reserveUSD, + rewardRate, + arcPrice + ); const aprFee = _calculateSwapFeeAPR( pair.volumeUSD, pair.reserveUSD, pair.stable ); - + pair.apyBase = Number(aprFee); pair.apyReward = Number(aprReward); return pair; @@ -63,7 +64,7 @@ const getApy = async () => { pair.reserveUSD, pair.stable ); - + pair.apyBase = Number(aprFee); pair.apyReward = Number(0); return pair; @@ -74,7 +75,7 @@ const getApy = async () => { .map(({ address, token0, token1, reserveUSD, apyReward }) => ({ pool: address, chain: utils.formatChain('telos'), - project: 'archly-finance', + project: 'archly-v1', symbol: `${token0.symbol}-${token1.symbol}`.toUpperCase(), tvlUsd: Number(reserveUSD), apyReward: apyReward, @@ -102,11 +103,7 @@ const _uniquePairs = (pairs) => { }); }; -const _calculateSwapFeeAPR = ( - volumeUSD, - reserveUSD, - stable -) => { +const _calculateSwapFeeAPR = (volumeUSD, reserveUSD, stable) => { const feeShare = new BN(volumeUSD) .times(stable ? STABLE_FEE_PERCENTAGE : VARIABLE_FEE_PERCENTAGE) .div(100); @@ -116,11 +113,7 @@ const _calculateSwapFeeAPR = ( return feeAPR; }; -const _calculateGaugeAPR = ( - reserveUSD, - rewardRate, - arcPrice -) => { +const _calculateGaugeAPR = (reserveUSD, rewardRate, arcPrice) => { const gaugeAPR = new BN(rewardRate) .div(1e18) .times(3600 * 24 * 365) diff --git a/src/adaptors/archly-finance/gauge_abi.json b/src/adaptors/archly-v1/gauge_abi.json similarity index 100% rename from src/adaptors/archly-finance/gauge_abi.json rename to src/adaptors/archly-v1/gauge_abi.json diff --git a/src/adaptors/archly-finance/index.ts b/src/adaptors/archly-v1/index.ts similarity index 100% rename from src/adaptors/archly-finance/index.ts rename to src/adaptors/archly-v1/index.ts diff --git a/src/adaptors/archly-finance/subgraph.ts b/src/adaptors/archly-v1/subgraph.ts similarity index 100% rename from src/adaptors/archly-finance/subgraph.ts rename to src/adaptors/archly-v1/subgraph.ts