Skip to content

Conversation

@ryangoree
Copy link
Member

@ryangoree ryangoree commented Feb 2, 2025

Fixes the total LP value in the portfolio for tokens with less than 18 decimals.

Fiat prices are always returned with the default decimals (18):

const price = data?.coins?.[defiLlamaTokenId]?.price;
return parseFixed(price).bigint;

But we were using the base token decimals when using it to determine price:

? fixed(totalOpenLpPositions ?? 0n, baseToken.decimals).mul(
fiatPrice,
baseToken.decimals,
).bigint

This was inflating the value for USDC pools:
Pasted image 20250201175004

@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2025

⚠️ No Changeset found

Latest commit: 3210983

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdrive-mainnet-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 0:25am
hyperdrive-sepolia-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 0:25am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
hyperdrive-js ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am
hyperdrive-mainnet-production ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am
hyperdrive-sepolia-production ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am
testnet-v1 ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am
testnet-v1.0.6 ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am
trading-competition ⬜️ Ignored (Inspect) Feb 2, 2025 0:25am

@ryangoree ryangoree merged commit f82e07e into main Feb 2, 2025
15 checks passed
@ryangoree ryangoree deleted the ryan-portfolio-value branch February 2, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants