Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize getting Price data #16

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
cd385df
added working price preloading using ccxt
scientes Mar 5, 2021
34f0c66
reformatting and documentation
scientes Mar 5, 2021
777c441
added type hints
scientes Mar 5, 2021
a1b9f8e
added walrus operator
scientes Mar 31, 2021
5089a9e
fixes smaller issues
scientes Mar 31, 2021
1ac3e77
change warning to error
scientes Mar 31, 2021
ed50892
PoC for a grpah based solution
scientes Apr 4, 2021
657666b
working graph implementation
scientes Apr 8, 2021
74935e1
better batching implementation
scientes Apr 8, 2021
48c24c8
revert accidental change
scientes Apr 8, 2021
50378a6
formatting
scientes Apr 8, 2021
e1f4581
formatting
scientes Apr 8, 2021
95deecc
fixed some mypy bugs
scientes Apr 8, 2021
7976ee6
black formatting
provinzio Apr 8, 2021
a0c8df5
fix mypy
scientes Apr 8, 2021
08f3402
flake compatible formatting (except E501)
scientes Apr 8, 2021
23f38b6
documentation
scientes Apr 8, 2021
3939e15
small formatting
scientes Apr 8, 2021
65cbfbf
RM `# type: ignore`
provinzio Apr 8, 2021
888dba8
Use logging instead of print
provinzio Apr 8, 2021
5d4f394
Order requirements-dev alphabetically
provinzio Apr 8, 2021
be5ab79
ADD all required modules explicitly
provinzio Apr 8, 2021
8928d6d
Use explicit import
provinzio Apr 8, 2021
b2f2074
FIX remove false *1000
provinzio Apr 8, 2021
700930a
REFACTOR PriceData.get_candles
provinzio Apr 9, 2021
3c036bb
ADD flake8-bugbear to show additional warnings
provinzio Apr 9, 2021
644c2a9
Adjust bug message, ccxt raises error when ohlc limit is exceeded
provinzio Apr 10, 2021
d28babd
REFACTOR PriceData.`preload_price_data_path`
provinzio Apr 10, 2021
2d31fc1
FIX `force_decimal` should raise ValueError
provinzio Apr 10, 2021
6acd035
ADD `get_avg_candle_prices`
provinzio Apr 10, 2021
6dcb6ce
UPDATE `get_candles` docstring
provinzio Apr 10, 2021
591c749
FIX ignore missing import of `ccxt` module
provinzio Apr 10, 2021
5226447
FIX mypy/flake8 errors and some refactoring graph
provinzio Apr 10, 2021
35536ae
ADD make venv and some comments in makefile
provinzio Apr 11, 2021
2e9b866
REFACTOR Getting time batches from operations...
provinzio Apr 11, 2021
842f731
ADD TODO: preferredexchange default only for debug purposes
provinzio Apr 11, 2021
cac907c
refractored path sorting
scientes Apr 27, 2021
dd8fb3e
better ratelimiting and exchanges are set via config
scientes Apr 27, 2021
98c049f
change from list to set
scientes May 2, 2021
0808511
fixed a bug which caused misses when looking up price_data
scientes May 26, 2021
6bda214
fix ratelimit for kraken
scientes Jun 15, 2021
c41b18e
Merge branch 'main' into ohlcv-batch
scientes Aug 15, 2021
908043e
Update requirements.txt
scientes Aug 15, 2021
25dd649
Merge branch 'main' into ohlcv-batch
scientes Sep 5, 2021
f0a52ca
fix formatting
scientes Sep 8, 2021
c56ba99
fix formatting
scientes Sep 8, 2021
08b7f41
Merge branch 'main' into ohlcv-batch
provinzio Nov 28, 2021
ada4859
UPDATE Use types for type hinting
provinzio Nov 28, 2021
ee6fdcf
warning if exchange for CSV export is not in found in CCTX list
Griffsano Dec 26, 2021
1e48809
Merge pull request #2 from Griffsano/ohlcv-batch
scientes Dec 26, 2021
f5ef07c
Merge branch 'main' into ohlcv-batch
scientes Dec 26, 2021
bbd8bb8
formatting
scientes Dec 26, 2021
8f24604
added progress counter and sorted operations before fetching prices
scientes Dec 31, 2021
84f7e86
kraken ignore and warning and formatting
scientes Dec 31, 2021
6fc0948
formatting
scientes Dec 31, 2021
11d5849
Ohlcv update (#4)
Griffsano Jan 10, 2022
080f475
unpin ccxt
scientes Jan 28, 2022
1f8f77e
Merge remote-tracking branch 'origin/main' into ohlcv-batch
provinzio Feb 6, 2022
1cb8a45
Merge remote-tracking branch 'origin/main' into ohlcv-batch
provinzio Feb 6, 2022
4f2dfe7
UPDATE warning when ccxt mapping is missing for exchange
provinzio Feb 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting
scientes committed Dec 26, 2021
commit bbd8bb81b9c2219d0c4c96e43d32ef3fc2312772
16 changes: 8 additions & 8 deletions src/taxman.py
Original file line number Diff line number Diff line change
@@ -251,23 +251,23 @@ def _evaluate_taxation_per_coin(
def evaluate_taxation(self) -> None:
"""Evaluate the taxation using country specific function."""
log.debug("Starting evaluation...")

if config.MULTI_DEPOT:
# Evaluate taxation separated by platforms and coins.
for _, operations in misc.group_by(
for platform, operations in misc.group_by(
self.book.operations, "platform"
).items():
for coin, _operations in misc.group_by(operations, "coin").items():
self.price_data.preload_prices(_operations, coin, platform)
self.price_data.preload_prices(_operations, coin, platform)
self._evaluate_taxation_per_coin(operations)
else:
for platform, _operations in misc.group_by(operations, "platform").items():
for coin, coin_operations in misc.group_by(_operations, "coin").items():
self.price_data.preload_prices(coin_operations, coin, platform)

for plat, _ops in misc.group_by(self.book.operations, "platform").items():
for coin, coin_operations in misc.group_by(_ops, "coin").items():
self.price_data.preload_prices(coin_operations, coin, plat)
# Evaluate taxation separated by coins in a single virtual depot.
self._evaluate_taxation_per_coin(self.book.operations)

def print_evaluation(self) -> None:
"""Print short summary of evaluation to stdout."""
# Summarize the tax evaluation.