Fill a wallet dashboard with plausible holdings
A crypto wallet or DeFi dashboard demo needs holdings that add up correctly. This fake crypto portfolio generator builds a set of fictional positions with quantities, prices, USD values and 24-hour changes that sum to a target total, so balances and pie charts look right without using real account data.
How it works
You choose how many assets to hold and a target total value. The generator splits the total into random weighted slices, one per coin, so the parts always add back to the whole. Each coin gets a fictional unit price and a signed 24-hour percent change; the quantity is derived so the position matches its slice:
valueUsd = totalTarget * weight_i / sum(weights)
quantity = valueUsd / priceUsd
The summary reports the portfolio total and a value-weighted 24-hour change. Export the result as a table or as JSON.
Worked example
Suppose you set a target of $10,000 across 4 assets. The generator might assign weights of 40%, 30%, 20%, and 10%, allocating $4,000, $3,000, $2,000, and $1,000 respectively. If the first coin has a fictional price of $48,000, the quantity for that holding would be $4,000 / $48,000 ≈ 0.0833. Each line then sums back to its slice, and all slices add to exactly $10,000 — so the grand total in your portfolio view will be correct to the cent.
What each field is for
| Field | Purpose |
|---|---|
symbol | Ticker shown in the holdings list |
priceUsd | Fictional unit price used to derive quantity |
quantity | Derived as valueUsd / priceUsd |
valueUsd | The coin’s share of the total |
change24h | Signed percentage, for coloring up/down indicators |
The weighted 24h change in the summary is calculated as a value-weighted average across all holdings, so it reflects the portfolio’s aggregate direction rather than a simple mean.
Practical use cases
- Wallet UI prototypes: drop the JSON directly into a dashboard component and render allocation rings and sparklines with fictional data that scales correctly.
- Component stories: pin a seed (if your version supports it) to keep Storybook stories reproducible between runs.
- Screenshot decks: use 3 to 5 holdings with a round headline value for a clean, readable screenshot that fills the frame without looking empty.
- Stress testing renderers: generate 20 or more holdings to verify your list handles many rows, long coin names, and edge-case negative changes.
Tips and edge cases
- Set the total to a round figure so the headline balance reads naturally in screenshots — $10,000 or $50,000 reads better than $9,843.17.
- Large holding counts with very low unit prices can produce quantities with many decimal places; make sure your frontend formats fractional quantities gracefully.
- The 24-hour change can be negative, so verify your UI’s down-arrow and red-color logic fires correctly, not just the upward case.
- Pull the JSON into a chart component to render an allocation pie that always sums to 100 percent because the weights are exhaustive by construction.