Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
feat(uniswap-v2): Added projected APY based on 24h volume (#835)
Browse files Browse the repository at this point in the history
* feat(uniswap-v2): Added projected APY based on 24h volume

* feat(uniswap-v2): Adjust fee percentatge
  • Loading branch information
wpoulin committed Jul 7, 2022
1 parent ea35e86 commit d39175e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/apps/uniswap-v2/helpers/uniswap-v2.pool.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class UniswapV2PoolTokenHelper {
appId,
groupId,
factoryAddress,
fee = 0.003,
fee = 0.3,
minLiquidity = 0,
hiddenTokens = [],
blockedPools = [],
Expand Down Expand Up @@ -179,13 +179,16 @@ export class UniswapV2PoolTokenHelper {
const volumeChangePercentage = poolVolumes.find(v => v.poolAddress === address)?.volumeChangePercentage ?? 0;
const isBlocked = blockedPools.includes(address);
const ratio = reservePercentages.map(p => `${Math.round(p * 100)}%`).join(' / ');
const projectedYearlyVolume = volume * 365;
const apy = (projectedYearlyVolume * 100) / liquidity;

// Display Props
const label = `${resolveTokenDisplaySymbol(tokens[0])} / ${resolveTokenDisplaySymbol(tokens[1])}`;
const secondaryLabel = ratio;
const images = tokens.map(v => getImagesFromToken(v)).flat();
const statsItems = [
{ label: 'Volume', value: buildDollarDisplayItem(volume) },
{ label: 'APY', value: buildPercentageDisplayItem(apy) },
{ label: 'Fee', value: buildPercentageDisplayItem(fee) },
{ label: 'Reserves', value: reserves.map(v => (v < 0.01 ? '<0.01' : v.toFixed(2))).join(' / ') },
{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) },
Expand Down

0 comments on commit d39175e

Please sign in to comment.