TheOtherDavid / CoinCheck

A simple app that checks a crypto coin price and sends an SMS alert if there has been a big move recently.
1 stars 0 forks source link

Add support to store account balance in Coinbase Pro #20

Closed TheOtherDavid closed 3 years ago

TheOtherDavid commented 3 years ago

CBPro doesn't have a way to view portfolio balance over time. How do I know if I'm really making money, or if my balance is really just a function of fluctuations in the BTC price? I should save my portfolio balance every time CoinCheck runs. This should be a new table, PRTFL, with DTM, PD_ID, and QTY. Should I store price along with this? I would have to, or else I couldn't figure out how much I have of each in USD. DTM, PD_ID, QTY, PRC, USD_VAL This will require a new table in the DB, code to get account balances, code to pair up the current prices, and code to persist the account balances. Our list of products to get the prices of will not be hardcoded anymore, but instead be populated by the products in the response for the account. For now, we'll keep both the PRC and PRTFL tables, even though they're slightly redundant.

TheOtherDavid commented 3 years ago

Created PRTFL table with partition key PD_ID and sort key DTM.

TheOtherDavid commented 3 years ago

Checked in code to get balances from my account, and record them in my DB. I still need a way to display this data, but storing it is a good start.