Skip to content

refactor: perf improvements + new card features - #1

Open
NFToby wants to merge 11 commits into
DefiLlama:mainfrom
NFToby:v2-update
Open

refactor: perf improvements + new card features#1
NFToby wants to merge 11 commits into
DefiLlama:mainfrom
NFToby:v2-update

Conversation

@NFToby

@NFToby NFToby commented Jan 26, 2026

Copy link
Copy Markdown

What

  • Split index.ts into smaller components & services for maintainability
  • Reached feature parity with the existing og-cards repo
  • Added support for a second metric/card (ie. TVL + fees)
  • Added optional 7-day bar charts beneath metrics
  • Renamed query params for clarity (breaking change vs v1)

Performance Benchmark

Rendering stack comparison

V2: Bun + Satori
V1: Node + Puppeteer

Request V2 V1
Avg 157ms 1238ms
Total (10 reqs) 1.57s 12.38s
Speedup ~7.8× faster baseline

This also reduces cold start time and removes the need for a headless browser.

Screenshots

Standard card
http://localhost:3000/?projectName=Lido&filetype=png&theme=dark&metricName=Total+Value+Locked&metricValue=%2427.336b&diff=4.8%25&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48

Lido (1)

Standard card with bar chart
http://localhost:3000/?projectName=Lido&filetype=png&theme=dark&metricName=Total+Value+Locked&metricValue=%2427.336b&diff=4.8%25&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48&barData=10,2,20,22,18,28,38
Lido (2)

Double card
http://localhost:3000/?projectName=Lido&filetype=png&theme=dark&metricName=Total+Value+Locked&metricValue=%2427.336b&diff=4.8%25&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48&metricName2=Fees%20(24hr)&metricValue2=$1.98m
Lido (5)

Double card with bar charts
http://localhost:3000/?projectName=Lido&filetype=png&theme=dark&metricName=Total+Value+Locked&metricValue=%2427.336b&diff=4.8%25&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48&metricName2=Fees%20(24hr)&metricValue2=$1.98m&barData=10,2,20,22,18,28,38&barData2=5,12,8,22,18,28,70
Lido (3)

Standard card with different metric (light mode)
http://localhost:3000/?projectName=Lido&filetype=png&theme=light&metricName=Next+Unlock+%7C+%24129%2C745&metricValue=in+6+hours&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48
Lido (6)

Standard card for homepage
http://localhost:3000/?metricName=Total%20Value%20Locked%20in%20DeFi&metricValue=$119.042b&diff=-1.16%25&projectLogo=https%3A%2F%2Ficons.llamao.fi%2Ficons%2Fprotocols%2Flido%3Fw%3D48%26h%3D48
image

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.

1 participant