eth-portfolio-temp 0.1.8.dev0__tar.gz → 0.2.2.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eth-portfolio-temp might be problematic. Click here for more details.

Files changed (114) hide show
  1. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/PKG-INFO +1 -1
  2. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/exporter.rst +3 -0
  3. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_shitcoins.py +14 -0
  4. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_utils.py +7 -2
  5. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/_portfolio.py +29 -26
  6. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/balances.py +5 -1
  7. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/main.py +6 -0
  8. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/PKG-INFO +1 -1
  9. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.env.sample +0 -0
  10. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.github/workflows/black.yaml +0 -0
  11. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.github/workflows/compile.yaml +0 -0
  12. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.github/workflows/deploy_docs.yaml +0 -0
  13. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.github/workflows/mypy.yaml +0 -0
  14. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.github/workflows/release.yaml +0 -0
  15. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/.gitignore +0 -0
  16. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/Makefile +0 -0
  17. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/README.md +0 -0
  18. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/brownie-config.yaml +0 -0
  19. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/Makefile +0 -0
  20. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/alabaster.css +0 -0
  21. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/basic.css +0 -0
  22. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/custom.css +0 -0
  23. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/doctools.js +0 -0
  24. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/documentation_options.js +0 -0
  25. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/file.png +0 -0
  26. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/language_data.js +0 -0
  27. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/minus.png +0 -0
  28. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/plus.png +0 -0
  29. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/pygments.css +0 -0
  30. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/searchtools.js +0 -0
  31. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/_build/html/_static/sphinx_highlight.js +0 -0
  32. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/caching.rst +0 -0
  33. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/conf.py +0 -0
  34. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/index.rst +0 -0
  35. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/make.bat +0 -0
  36. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/docs/new-protocols.rst +0 -0
  37. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/__init__.py +0 -0
  38. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_argspec.py +0 -0
  39. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_cache.py +0 -0
  40. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_config.py +0 -0
  41. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_db/__init__.py +0 -0
  42. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_db/decorators.py +0 -0
  43. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_db/entities.py +0 -0
  44. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_db/utils.py +0 -0
  45. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_decimal.py +0 -0
  46. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_decorators.py +0 -0
  47. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_exceptions.py +0 -0
  48. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_ledgers/__init__.py +0 -0
  49. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_ledgers/address.py +0 -0
  50. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_ledgers/portfolio.py +0 -0
  51. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/__init__.py +0 -0
  52. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/_nonce.py +0 -0
  53. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/balances.py +0 -0
  54. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/token_transfer.py +0 -0
  55. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/transaction.py +0 -0
  56. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_loaders/utils.py +0 -0
  57. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_stableish.py +0 -0
  58. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_submodules.py +0 -0
  59. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_ydb/__init__.py +0 -0
  60. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/_ydb/token_transfers.py +0 -0
  61. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/address.py +0 -0
  62. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/buckets.py +0 -0
  63. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/constants.py +0 -0
  64. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/portfolio.py +0 -0
  65. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/__init__.py +0 -0
  66. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/_base.py +0 -0
  67. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/convex.py +0 -0
  68. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/dsr.py +0 -0
  69. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/README.md +0 -0
  70. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/__init__.py +0 -0
  71. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/_base.py +0 -0
  72. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/compound.py +0 -0
  73. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/liquity.py +0 -0
  74. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/maker.py +0 -0
  75. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/lending/unit.py +0 -0
  76. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/protocols/liquity.py +0 -0
  77. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/py.typed +0 -0
  78. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/structs/__init__.py +0 -0
  79. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/structs/modified.py +0 -0
  80. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/structs/structs.py +0 -0
  81. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/typing/__init__.py +0 -0
  82. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio/typing/balance/single.py +0 -0
  83. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/__init__.py +0 -0
  84. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/_args.py +0 -0
  85. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/_logging.py +0 -0
  86. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/_utils.py +0 -0
  87. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/Portfolio/Balances.json +0 -0
  88. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/dashboards.yaml +0 -0
  89. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/.grafana/datasources/datasources.yml +0 -0
  90. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/__init__.py +0 -0
  91. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/check.py +0 -0
  92. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/docker-compose.yaml +0 -0
  93. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/docker/docker_compose.py +0 -0
  94. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/py.typed +0 -0
  95. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/victoria/__init__.py +0 -0
  96. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_scripts/victoria/types.py +0 -0
  97. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/SOURCES.txt +0 -0
  98. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/dependency_links.txt +0 -0
  99. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/entry_points.txt +0 -0
  100. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/not-zip-safe +0 -0
  101. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/requires.txt +0 -0
  102. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/eth_portfolio_temp.egg-info/top_level.txt +0 -0
  103. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/pyproject.toml +0 -0
  104. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/renovate.json +0 -0
  105. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/requirements.txt +0 -0
  106. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/setup.cfg +0 -0
  107. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/setup.py +0 -0
  108. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/_test_completeness.py +0 -0
  109. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/conftest.py +0 -0
  110. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/fixtures.py +0 -0
  111. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/protocols/test_external.py +0 -0
  112. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/scripts/test_utils.py +0 -0
  113. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/test_portfolio.py +0 -0
  114. {eth_portfolio_temp-0.1.8.dev0 → eth_portfolio_temp-0.2.2.dev0}/tests/test_typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eth_portfolio_temp
3
- Version: 0.1.8.dev0
3
+ Version: 0.2.2.dev0
4
4
  Summary: eth-portfolio makes it easy to analyze your portfolio.
5
5
  Home-page: https://github.com/BobTheBuidler/eth-portfolio
6
6
  Author: BobTheBuidler
@@ -33,6 +33,9 @@ The Portfolio Exporter supports several command-line options to customize its be
33
33
  - ``--interval <interval>``
34
34
  The time interval between datapoints. default: 6h
35
35
 
36
+ - ``--concurrency <concurrency>``
37
+ The max number of historical blocks to export concurrently. default: 60
38
+
36
39
  - ``--first-tx-block <block>``
37
40
  The block of your portfolio's first transaction, if known. This value, if provided, allows us to speed up processing of your data by limiting the block range we need to query. If not provided, the whole blockchain will be scanned. default: 0
38
41
 
@@ -170,6 +170,19 @@ shitcoins: Final = {
170
170
  "0xc6a76f7ad66d0e6Ccd1AaAd6e7568c9bd55Dce62",
171
171
  "0xB4d4334eB5a251cbE5cC7Afb0Ba26119aCE62281",
172
172
  "0xE5c5AE39B98eFd9D3c9E0F2a5457D98fFA4b0b46",
173
+ # Generally looks like shit (symbol ERC20)
174
+ "0xe37be01D1337E77aCB0b4293DDb4D410D80010a7",
175
+ "0x7EeAcC32C81e4D78E9705fBf0b977f5A858Bf0F3",
176
+ "0x90133FF815ade1977EA2f1454dBC1d309EAA33f6",
177
+ "0x82ff6D346E424025B1F07e4C8D6527806e50fCA5",
178
+ "0x7C2bc9F685e1f78e42d236Ff819D89DDA864359d",
179
+ "0x3ea463dD031A384DB68d6fD2f37574248E7ffCfE",
180
+ "0x241b047e810c70AB2bB5C567391E0888c4791cbe",
181
+ "0x47D1b57e5B542808eeEd0C509583Fa12d023f05e",
182
+ "0x8a33B3e6f5C0049Cff6dEca0564F5fbDa0eBe9f9",
183
+ "0x84b2e82Ef534e8bE05276DBf4F9e5474fBeD5E59",
184
+ "0x022b5fE59fc45a29d58a7e45a2567b69b649d623",
185
+ "0x178d20220c22008cc1886d2E689cAeE4A5c3239b",
173
186
  # Tagged as well known address scam on Etherscan
174
187
  "0x59bed83a385571ffac0FC15A43f0f6f72e66Dccb",
175
188
  "0x2Ec109a0ceFEC70661a242a8B54cae8f45630397",
@@ -228,6 +241,7 @@ shitcoins: Final = {
228
241
  "0x89D3Ac7C32Aa14bEE6Fa90E041241dc4eEbbDFB3",
229
242
  "0x640c6fdAfbDaC9bfCe79943890fdc98f8d39bE3e",
230
243
  "0xA04a3a553548090a7b81D2de75B8a08Ee45860e1",
244
+ "0x1b8F28C0d410456FE04b8f421d00d6654F66AbB6",
231
245
  # fake DAI
232
246
  "0xf84f908E78f9295b53883AD9ACa38F86d513f03F",
233
247
  "0x20Dd160716b0387220Eea7B9951bDb51B3728DC4",
@@ -47,10 +47,15 @@ if TYPE_CHECKING:
47
47
 
48
48
  logger: Final = logging.getLogger(__name__)
49
49
 
50
- NON_STANDARD_ERC721: Final = {
50
+ NON_STANDARD_ERC721: Final[List[ChecksumAddress]] = {
51
51
  Network.Mainnet: ["0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB"], # CryptoPunks
52
52
  }.get(CHAINID, [])
53
53
 
54
+ SUPPRESS_ERROR_LOGS: Final[List[ChecksumAddress]] = {
55
+ # put tokens here when you don't expect them to price successfully and do not want to see the associated error logs
56
+ }.get(CHAINID, [])
57
+ """Put tokens here when you don't expect them to price successfully and do not want to see the associated error logs."""
58
+
54
59
 
55
60
  async def get_buffered_chain_height() -> int:
56
61
  """Returns an int equal to the current height of the chain minus `_config.REORG_BUFFER`."""
@@ -131,7 +136,7 @@ async def _get_price(token: AddressOrContract, block: Optional[int] = None) -> _
131
136
  elif isinstance(e.exception, NonStandardERC20):
132
137
  # Can't get symbol for handling like other excs
133
138
  logger.warning(f"NonStandardERC20 while fetching price for {token}")
134
- elif isinstance(e.exception, PriceError):
139
+ elif isinstance(e.exception, PriceError) and token not in SUPPRESS_ERROR_LOGS:
135
140
  logger.warning(
136
141
  f"PriceError while fetching price for {await _describe_err(token, block)}"
137
142
  )
@@ -40,8 +40,10 @@ class ExportablePortfolio(Portfolio):
40
40
  def __init__(
41
41
  self,
42
42
  addresses: Addresses,
43
+ *,
43
44
  start_block: int = 0,
44
45
  label: str = _DEFAULT_LABEL,
46
+ concurrency: int = 60,
45
47
  load_prices: bool = True,
46
48
  get_bucket: Callable[[ChecksumAddress], Awaitable[str]] = get_token_bucket,
47
49
  num_workers_transactions: int = 1000,
@@ -51,6 +53,7 @@ class ExportablePortfolio(Portfolio):
51
53
  addresses, start_block, label, load_prices, num_workers_transactions, asynchronous
52
54
  )
53
55
  self.get_bucket = get_bucket
56
+ self._semaphore = a_sync.Semaphore(concurrency)
54
57
 
55
58
  @cached_property
56
59
  def _data_queries(self) -> Tuple[str, str]:
@@ -88,36 +91,36 @@ class ExportablePortfolio(Portfolio):
88
91
  except Exception as e:
89
92
  log_error("Error processing %s:", dt, exc_info=True)
90
93
 
91
- @a_sync.Semaphore(60)
92
94
  async def get_data_for_export(self, block: BlockNumber, ts: datetime) -> List[victoria.Metric]:
93
- print(f"exporting {ts} for {self.label}")
94
- start = datetime.now(tz=timezone.utc)
95
-
96
- metrics_to_export = []
97
- data: PortfolioBalances = await self.describe(block, sync=False)
98
-
99
- for wallet, wallet_data in dict.items(data):
100
- for section, section_data in wallet_data.items():
101
- if isinstance(section_data, TokenBalances):
102
- for token, bals in dict.items(section_data):
103
- metrics_to_export.extend(
104
- await self.__process_token(ts, section, wallet, token, bals)
105
- )
106
- elif isinstance(section_data, RemoteTokenBalances):
107
- if section == "external":
108
- section = "assets"
109
- for protocol, token_bals in section_data.items():
110
- for token, bals in dict.items(token_bals):
95
+ async with self._semaphore:
96
+ print(f"exporting {ts} for {self.label}")
97
+ start = datetime.now(tz=timezone.utc)
98
+
99
+ metrics_to_export = []
100
+ data: PortfolioBalances = await self.describe(block, sync=False)
101
+
102
+ for wallet, wallet_data in dict.items(data):
103
+ for section, section_data in wallet_data.items():
104
+ if isinstance(section_data, TokenBalances):
105
+ for token, bals in dict.items(section_data):
111
106
  metrics_to_export.extend(
112
- await self.__process_token(
113
- ts, section, wallet, token, bals, protocol=protocol
114
- )
107
+ await self.__process_token(ts, section, wallet, token, bals)
115
108
  )
116
- else:
117
- raise NotImplementedError()
109
+ elif isinstance(section_data, RemoteTokenBalances):
110
+ if section == "external":
111
+ section = "assets"
112
+ for protocol, token_bals in section_data.items():
113
+ for token, bals in dict.items(token_bals):
114
+ metrics_to_export.extend(
115
+ await self.__process_token(
116
+ ts, section, wallet, token, bals, protocol=protocol
117
+ )
118
+ )
119
+ else:
120
+ raise NotImplementedError()
118
121
 
119
- print(f"got data for {ts} in {datetime.now(tz=timezone.utc) - start}")
120
- return metrics_to_export
122
+ print(f"got data for {ts} in {datetime.now(tz=timezone.utc) - start}")
123
+ return metrics_to_export
121
124
 
122
125
  def __get_data_exists_coros(self, dt: datetime) -> Iterator[str]:
123
126
  for query in self._data_queries:
@@ -26,7 +26,11 @@ async def export_balances(args: Namespace) -> None:
26
26
 
27
27
  interval = parse_timedelta(args.interval)
28
28
  portfolio = ExportablePortfolio(
29
- args.wallet, label=args.label, start_block=args.first_tx_block, load_prices=False
29
+ args.wallet,
30
+ label=args.label,
31
+ start_block=args.first_tx_block,
32
+ concurrency=args.concurrency,
33
+ load_prices=False,
30
34
  )
31
35
 
32
36
  if export_start_block := args.export_start_block or args.first_tx_block:
@@ -54,6 +54,12 @@ export_parser.add_argument(
54
54
  help="The time interval between datapoints. default: 6h",
55
55
  default="6h",
56
56
  )
57
+ export_parser.add_argument(
58
+ "--concurrency",
59
+ type=int,
60
+ help="The max number of historical blocks to export concurrently. default: 60",
61
+ default=60,
62
+ )
57
63
  export_parser.add_argument(
58
64
  "--first-tx-block",
59
65
  type=int,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eth_portfolio_temp
3
- Version: 0.1.8.dev0
3
+ Version: 0.2.2.dev0
4
4
  Summary: eth-portfolio makes it easy to analyze your portfolio.
5
5
  Home-page: https://github.com/BobTheBuidler/eth-portfolio
6
6
  Author: BobTheBuidler