I am building a system where users can own a currency pretty much like crypto. The idea is that the value of that currency changes every 24 hours based on certain factors.
Here's an example. There's a currency called "Coin" (CurrencyName) with an initial value of $1. The value changes every 24 hours, say the next day it becomes "$1.14". What's the best approach to record daily price? Should I create a "Value" column in the Currency Table and just update it every 24 hours while also updating another table say "Value History Table" for historical record?
User Table
- UserId INT PK
- Email VARCHAR(255)
- Password VARCHAR(255)
Currency Table
- CurrencyId INT PK
- CurrecyName VARCHAR(255)
- TotalSupply INT
Inventory Table
- CurrencyId INT FK
- UserId INT FK
- AmountOwned INT