Skip to content

Commit

Permalink
Merge pull request #79 from agoric-labs/rs-error-handle-token-prices
Browse files Browse the repository at this point in the history
chore: compute price change if sortedOracleDailyPrices > 2
  • Loading branch information
rabi-siddique authored Jun 7, 2024
2 parents f6ee73a + d6cb18b commit 20c51cb
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/widgets/TokenPrices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function TokenPrices({ title = 'Summary', data, isLoading }: Props) {
// Determine 24h change in oracle price
const sortedOracleDailyPrices = token?.oracleDailyPrices?.sort((a, b) => b.dateKey - a.dateKey);
const changeValue =
sortedOracleDailyPrices.length > 0
sortedOracleDailyPrices.length >= 2
? (() => {
const oraclePriceYesterday =
sortedOracleDailyPrices[0].typeOutAmountLast / sortedOracleDailyPrices[0].typeInAmountLast;
Expand Down
Loading

0 comments on commit 20c51cb

Please sign in to comment.