Skip to content

Commit

Permalink
fix: pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 30, 2023
1 parent c1a9365 commit 29b7f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions apps/ybribe/components/bribe/GaugeListRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ import type {TCurveGauge} from '@common/schemas/curveSchemas';

function GaugeRowItemWithExtraData({address, value}: {address: TAddress; value: bigint}): ReactElement {
const {tokens, prices} = useYearn();

const tokenInfo = tokens?.[address];
const tokenPrice = prices?.[address];
const tokenPrice = Number(prices?.[address]) / 1e6;
const decimals = tokenInfo?.decimals || 18;
const symbol = tokenInfo?.symbol || '???';
const bribeAmount = formatToNormalizedValue(toBigInt(value), decimals);
const bribeValue = bribeAmount * (Number(tokenPrice || 0) / 100);
const bribeValue = bribeAmount * Number(tokenPrice || 0);

return (
<div className={'flex h-auto flex-col items-end pt-0 md:h-14'}>
Expand Down
3 changes: 1 addition & 2 deletions apps/ybribe/components/claim/GaugeListRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ function GaugeRowItemWithExtraData({
minDecimals?: number;
}): ReactElement {
const {tokens, prices} = useYearn();

const tokenInfo = tokens?.[address];
const tokenPrice = Number(prices?.[address]) / 1000000;
const tokenPrice = Number(prices?.[address]) / 1e6;
const decimals = tokenInfo?.decimals || 18;
const symbol = tokenInfo?.symbol || '???';
const bribeAmount = formatToNormalizedValue(toBigInt(value), decimals);
Expand Down

1 comment on commit 29b7f83

@vercel
Copy link

@vercel vercel bot commented on 29b7f83 Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.