Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Product: a crypto portfolio value tracker
During this conversation, we’ll talk about building a cryptocurrency portfolio tracker. Users can track the value of their portfolio across various cryptocurrencies.
- Track token (cryptocurrency) prices
- Track the value of your own token holdings
- Add historical transactions (i.e. when the user bought or sold a token)
- Fields:
- Token (i.e. Bitcoin)
- Date / Time
- Price (i.e. $50,000 USD per BTC)
- Amount (i.e. 0.4 BTC)
- Show portfolio total balance
- Show historical portfolio performance
- Bonus features
- Work with multiple base currencies (not just USD)
- Work with multiple portfolios
Product constraints:
- You can get price data from a pre-existing API with no rate limits or authentication.
- All data is stored on the client. No backend database is allowed for storing user data.
- Don't worry about authentication or syncing data across devices.
![Home page - portfolio view](
![1. Landing Page](
![2. Track a token](
![Viewing a specific token](
![Add a portfolio transaction](
User flows
- Track a token (not in their portfolio)
- See list of tracked tokens, no "portfolio" history
- View a token
- See price history of token
- Add a transaction
- View portfolio history, incorporating past balances and prices
Example of how the app works:
- I bought 1 BTC and 50,000 STX a week ago, each purchase worth $50,000
- My portfolio was worth $100,000
- Today, BTC has gone down by 5%, and STX has gone up by 10%.
- My Bitcoin is now worth $47,500
- My Stacks are worth $55,000
- My portfolio is now worth $102,500
- My portfolio is up 2.5%
Assume that an API for fetching historical price data is fully available.
Example APIs:
Get historical prices for a token
- ``
- Prices are reverse-chronological
- Assume you can use query parameters to change offset and interval
- `?before=1615581722112` - prices before timestamp
- `?interval=1d` - interval between each price tick
- Example response:
results: [
price: 1.0503,
timestamp: 1615581722112
price: 1.04,
timestamp: 1615581722112
Websocket for real-time price updates
- Example WebSocket message:
ticker: 'STXUSD',
price: 1.1725,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment