Skip to content

Commit

Permalink
Prices (yearn#70)
Browse files Browse the repository at this point in the history
* feat: add pricing support + refactor

* feat: update manifest and favicon

* fix: updating lock and package

* fix: early continue

* feat: error count

* fix: linting

* feat: add warning fields + NEW apy detection

* feat: add icon missing actions

* fix: ledger's fix doc

* fix: spacing

* fix: doc about meta to ydaemon

* fix: endpoint

* fix: invalid check on new and error APY

* feat: add image tester on tokens page

* feat: minor design update

* fix: undefined error

* feat: add current gross_apr

* fix: put warnings in anomalies

* fix: error ratio

* fix: switch to net

* feat: price upd
  • Loading branch information
Majorfi authored Sep 21, 2022
1 parent c9951ea commit 3ab42b8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/TokenEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ function TokenEntity({
sufix: (
<span>
{'for token '}
<a href={`${networks[chainID].explorerBaseURI}/address/${tokenData.address}`} target={'_blank'} className={`underline ${!tokenData.hasValidPrice ? '' : 'text-red-900'}`} rel={'noreferrer'}>
<a href={`${networks[chainID].explorerBaseURI}/address/${tokenData.address}`} target={'_blank'} className={`underline ${tokenData.hasValidPrice ? '' : 'text-red-900'}`} rel={'noreferrer'}>
{tokenData.name}
</a>
{tokenData?.hasValidPrice ? ` (${tokenData.price}$)` : ''}
</span>
)
}]} />
Expand Down
4 changes: 2 additions & 2 deletions components/VaultEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ function VaultEntity({
isValid: !aggregatedData.vaults[toAddress(vault.address)]?.hasErrorAPY,
prefix: 'APY is set to ',
errorMessage: '[ ERROR ]',
sufix: `for vault - (APY: ${format.amount((vault?.apy?.gross_apr || 0) * 100, 2, 4)}%)`
sufix: `for vault - (APY: ${format.amount((vault?.apy?.net_apy || 0) * 100, 2, 4)}%)`
}, {
isValid: !aggregatedData.vaults[toAddress(vault.address)]?.hasNewAPY,
isWarning: true,
prefix: 'APY is set to ',
errorMessage: '[ NEW ]',
sufix: `for vault - (APY: ${format.amount((vault?.apy?.gross_apr || 0) * 100, 2, 4)}%)`
sufix: `for vault - (APY: ${format.amount((vault?.apy?.net_apy || 0) * 100, 2, 4)}%)`
}]} />


Expand Down
2 changes: 2 additions & 0 deletions contexts/useYearn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const YearnContextApp = ({children}: {children: ReactElement}): ReactElem
address: toAddress(address),
name: TOKENS[address]?.name,
symbol: TOKENS[address]?.symbol,
price: TOKENS[address]?.price,
missingTranslations: missingTokensTranslations,
hasValidPrice: TOKENS[address]?.price > 0,
hasValidTokenIcon: true
Expand All @@ -179,6 +180,7 @@ export const YearnContextApp = ({children}: {children: ReactElement}): ReactElem
address: toAddress(address),
name: TOKENS[address]?.name,
symbol: TOKENS[address]?.symbol,
price: TOKENS[address]?.price,
missingTranslations: missingTokensTranslations,
hasValidPrice: TOKENS[address]?.price > 0,
hasValidTokenIcon: true
Expand Down
Empty file modified next.config.js
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function Index(): ReactNode {
</div>
<div className={'flex flex-col space-y-2 pb-6'}>
<b className={'text-lg'}>{'Results'}</b>
<div className={'mt-4 grid w-full grid-cols-1 gap-4 md:grid-cols-2'}>
<div className={'mt-4 grid w-full grid-cols-1 gap-4 lg:grid-cols-2'}>
{appSettings.shouldShowEntity === 'vaults' && vaults.map((vault: any, index: number): ReactNode => {
return (
<VaultEntity
Expand Down
1 change: 1 addition & 0 deletions types/entities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type TTokenData = {
address: string,
name: string,
symbol: string,
price: string,
missingTranslations: {[key: string]: string[]},
hasValidTokenIcon: boolean,
hasValidPrice: boolean
Expand Down

0 comments on commit 3ab42b8

Please sign in to comment.