Skip to content

Commit

Permalink
don't assume daily tvl has a value
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Jun 5, 2024
1 parent 8d17a9a commit 6eb57c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/src/app/stake/AllPools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ export const AllPools = () => {
const volume = (() => {
if (pool.volumeOverTime.daily.length > 0)
return parseFloat(
pool.volumeOverTime.daily[0].fusdc.valueScaled
pool.volumeOverTime.daily?.[0].fusdc.valueScaled ?? 0
);
return 0;
})();
const totalValueLocked = (() => {
if (pool.tvlOverTime.daily.length > 0)
return parseFloat(pool.tvlOverTime.daily[0]);
return parseFloat(pool.tvlOverTime.daily[0] ?? 0);
return 0
})();
return {
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/stake/pool/create/select-prime-asset/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const SelectPrimeAsset = () => {
id: pool.address,
// assume the first token is always the main token
volume: usdFormat(
parseFloat(pool.volumeOverTime.daily[0].fusdc.valueUsd),
parseFloat(pool.volumeOverTime.daily[0]?.fusdc.valueUsd ?? 0),
),
APR: 0, // TODO: calculate APR
duration: 0, // TODO: get duration
Expand Down

0 comments on commit 6eb57c1

Please sign in to comment.