Closed Jbays closed 6 years ago
For each unique cryptocurrency, the balance table may only have one entry. The balance table now has one-to-one relationship with the coins_index table.
To accomplish, I wrote balance2.js -- a script that correctly updates the balance table while taking into account all adjustments from all trades.
The process to fully update the balance table: Run script updateBalancePurchase.js THEN balance2.js
Then balance table will show all available units for each crypto-currency.
NOTES: I suspect balance2.js could:
The balance table needs a one-to-one relationship with the coins_index table.
For each unique crypto, I should only have one balance. Otherwise knowing the actual balance for each unique crypto necessitates another query to the balance table -- summing up those entries.
This will block #24.
Annoying is that I'll have to change the schema -- yet again. :/