Created
November 9, 2021 13:35
-
-
Save kyranjamie/4ec0c7d85fe80d59b370488bd8cd1fc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
 | |
 | |
 | |
 | |
 | |
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