You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are required for importing trade data from Binance for example.
Right now, we have asset_name as a field on Transaction.
Migration plan
add new fields to in-memory object (quantity_traded, quantity_received, symbol_traded, symbol_received)
Allow passing the new fields to constructor of Transaction
Deprecate usd_subtotal and quantity fields
Add migrate script to add the fields to existing DBs
write the values for 4 new fields to in-memory objects. (Still create Transactions using old syntax, but propagate it to new columns). This ability is critical for migration.
Move basis calculation logic to use NEW fields. Stop using usd_subtotal in basis.py. This is the most critical step for making sure basis calculations are still correct.
At this point we should be able to use both syntaxes. Either usd_subtotal and asset_name, or the fully specified one.
Migrate ALL usages of Transaction over to new syntax
Remove the deprecated parameters from Transaction constructor
The text was updated successfully, but these errors were encountered:
closes#62 !
# Test plan
```
$ PYTHONPATH=src python -m yabc testdata/binance/binance.csv
3 transactions to be reported
<CostBasisReport: Sold 1 BTC on 2017-01-01 11:22:00 for $1075. Exchange: binance. Profit:$1075.
<TX 2017-01-01 11:22:00 SELL 125.0 ETH for 1 BTC, from exchange binance. Fee 0.01 ETH>>
<CostBasisReport: Sold 125.0 ETH on 2017-01-01 11:23:00 for $1009. Exchange: binance. Profit:$0.
<TX 2017-01-01 11:23:00 SELL 1 BTC for 125 ETH, from exchange binance. Fee 0.01 ETH>>
<CostBasisReport: Sold 1 BTC on 2017-01-01 11:24:00 for $10030. Exchange: binance. Profit:$8955.
<TX 2017-01-01 11:24:00 SELL 10030 USD for 1 BTC, from exchange binance. Fee 0.01 BTC>>
total gain or loss for above transactions: 10030
total basis for above transactions: 2084
total proceeds for above transactions: 12114
Remaining coins after sales:
<TX 2017-01-01 11:24:00 BUY 1 BTC for 10025 USD, from exchange binance. Fee 0.01 BTC>
```
Support markets like ETH/BTC.
These are required for importing trade data from Binance for example.
Migration plan
usd_subtotal
andquantity
fieldsusd_subtotal
in basis.py. This is the most critical step for making sure basis calculations are still correct.At this point we should be able to use both syntaxes. Either
usd_subtotal
andasset_name
, or the fully specified one.The text was updated successfully, but these errors were encountered: