Skip to content

Commit

Permalink
oracle identity
Browse files Browse the repository at this point in the history
query key updated to avoid using cache
  • Loading branch information
cryptickoan committed Apr 13, 2022
1 parent e86777f commit ab62b12
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
40 changes: 21 additions & 19 deletions src/components/pages/Fuse/FusePoolInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ const AssetAndOtherInfo = ({ assets, poolOracle, tokensData }: { assets: USDPric
const oracleIdentity = useIdentifyOracle(
selectedAsset.oracle,
poolOracle,
selectedAsset.underlyingToken,
);
selectedAsset.underlyingToken
)

// Link to MPO if asset is ETH
const oracleAddress =
(selectedAsset.underlyingToken === ETH_TOKEN_DATA.address || selectedAsset.oracle === ETH_TOKEN_DATA.address)
Expand Down Expand Up @@ -511,23 +512,24 @@ const AssetAndOtherInfo = ({ assets, poolOracle, tokensData }: { assets: USDPric
crossAxisAlignment="center"
captionFirst={true}
/>

<SimpleTooltip label={oracleIdentity}>
<Link
href={`https://etherscan.io/address/${oracleAddress}`}
isExternal
_hover={{ pointer: "cursor", color: "#21C35E" }}
>
<CaptionedStat
stat={truncate(oracleIdentity, 20)}
statSize="md"
captionSize="xs"
caption={t("Oracle")}
crossAxisAlignment="center"
captionFirst={true}
/>
</Link>
</SimpleTooltip>
{ !oracleIdentity ? <Spinner/> :
<SimpleTooltip label={oracleIdentity}>
<Link
href={`https://etherscan.io/address/${oracleAddress}`}
isExternal
_hover={{ pointer: "cursor", color: "#21C35E" }}
>
<CaptionedStat
stat={truncate(oracleIdentity, 20)}
statSize="md"
captionSize="xs"
caption={t("Oracle")}
crossAxisAlignment="center"
captionFirst={true}
/>
</Link>
</SimpleTooltip>
}

<CaptionedStat
stat={
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/fuse/useOracleData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useIdentifyOracle = (
): string => {
const { fuse } = useRari();

const { data } = useQuery("Identifying Oracle " + oracleAddr, async () => {
const { data } = useQuery("Identifying Oracle " + tokenAddr, async () => {
if (tokenAddr && tokenAddr === ETH_TOKEN_DATA.address)
return "MasterPriceOracle";

Expand Down

1 comment on commit ab62b12

@vercel
Copy link

@vercel vercel bot commented on ab62b12 Apr 13, 2022

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.