Skip to content

Instantly share code, notes, and snippets.

Embed
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.
Features
- 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.
Wireframes
![Home page - portfolio view](https://paper-attachments.dropbox.com/s_EAA04FC639CB25FBBA330F95E8FDDBC1210C440493C2212A6B4E44EB577243DD_1615597817832_image.png)
![1. Landing Page](https://paper-attachments.dropbox.com/s_EAA04FC639CB25FBBA330F95E8FDDBC1210C440493C2212A6B4E44EB577243DD_1615597674180_image.png)
![2. Track a token](https://paper-attachments.dropbox.com/s_EAA04FC639CB25FBBA330F95E8FDDBC1210C440493C2212A6B4E44EB577243DD_1615597694442_image.png)
![Viewing a specific token](https://paper-attachments.dropbox.com/s_EAA04FC639CB25FBBA330F95E8FDDBC1210C440493C2212A6B4E44EB577243DD_1615597933758_image.png)
![Add a portfolio transaction](https://paper-attachments.dropbox.com/s_EAA04FC639CB25FBBA330F95E8FDDBC1210C440493C2212A6B4E44EB577243DD_1615597981018_image.png)
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%
API
Assume that an API for fetching historical price data is fully available.
Example APIs:
Get historical prices for a token
- `https://myapi.com/tokens/STXUSD/historical`
- 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