Skip to content

Conversation

@kanerep
Copy link
Contributor

@kanerep kanerep commented Oct 7, 2025

This PR adds a range of useful features to the Token PNL and a touch up on the existing styling to be more aligned with the theme.

Features added:

  • Token quantity field
  • Dollar value/Percent return
  • Holding days
  • Estimated Annualised Return
  • Chart over selected time period (green for positive/red for negative)
  • Token statistics
  • Daily PnL grid
  • Strength comparison vs. BTC/ETH/SOL

Before:
Screenshot 2025-10-07 at 16 49 18

After:
Desktop

token-pnl-green-after-desktop.mov

Negative PNL State

Screenshot 2025-10-07 at 21 22 00

Mobile

token-pnl-after-mobile.mov

@kanerep kanerep marked this pull request as ready for review October 7, 2025 20:34
@kanerep kanerep changed the title Improved the Token PNL page enh: improves the token pnl page Oct 9, 2025
@kanerep
Copy link
Contributor Author

kanerep commented Nov 4, 2025

hey @mintdart, is this PR good to be merged? I noticed you made a couple of changes

@mintdart
Copy link
Contributor

mintdart commented Nov 6, 2025

date formatting is wrong, i selected september 1 to october 31 , but price chart shows from aug 31 to oct 30
Screenshot 3

end price is $108,300 in your PR
Screenshot 4

on https://defillama.com/token-pnl?start=1756684800&end=1761868800 it is $110,045
Screenshot 2

@kanerep
Copy link
Contributor Author

kanerep commented Nov 6, 2025

date formatting is wrong, i selected september 1 to october 31 , but price chart shows from aug 31 to oct 30 Screenshot 3

end price is $108,300 in your PR Screenshot 4

on https://defillama.com/token-pnl?start=1756684800&end=1761868800 it is $110,045 Screenshot 2

I will look right into it, thanks!

@kanerep
Copy link
Contributor Author

kanerep commented Nov 6, 2025

Good catch @mintdart, in production we do not include the end day (31st Oct), is this what we expect?

I have pushed the changes to match the production logic.

@mintdart
Copy link
Contributor

mintdart commented Nov 6, 2025

no, in production we do include 31st, start and end dates in calendar should match the dates on chart

@mintdart
Copy link
Contributor

mintdart commented Nov 6, 2025

just tested again after your change
Screenshot

  • now end date is off by 2 days
  • start date is off by 1 day

@kanerep
Copy link
Contributor Author

kanerep commented Nov 6, 2025

just tested again after your change Screenshot

  • now end date is off by 2 days
  • start date is off by 1 day

I see what you mean. How does this look? Let me know, I'll push if you are happy.

Screenshot 2025-11-06 at 19 40 30

@mintdart
Copy link
Contributor

mintdart commented Nov 6, 2025

looks good, does the start price, end price, all time high match to the one's on https://defillama.com/token-pnl ?

@mintdart
Copy link
Contributor

mintdart commented Nov 6, 2025

you can test if there's any issue with dates by setting your timezone to UTC+09:00

@kanerep
Copy link
Contributor Author

kanerep commented Nov 6, 2025

you can test if there's any issue with dates by setting your timezone to UTC+09:00

I believe it's working as expected now. I did test out the changing my timezone to Tokyo but didn't notice anything different curious to know more about that! All prices seem to match, we show the correct date on the chart and I noticed the percentage was only showing 1 decimal in the card section so I have changed that to match production too. I've pushed changes.

Here are screenshots of the prod/local:

Screenshot 2025-11-06 at 22 44 37 Screenshot 2025-11-06 at 22 58 07

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.

2 participants